Re: [PATCH v3 0/5] GPU workload hints for better performance

2022-09-27 Thread Sharma, Shashank




On 9/27/2022 7:13 PM, Michel Dänzer wrote:

On 2022-09-27 18:59, Sharma, Shashank wrote:

Hey Michel,
Thanks for the review coments.

On 9/27/2022 6:24 PM, Michel Dänzer wrote:

On 2022-09-26 23:40, Shashank Sharma wrote:

AMDGPU SOCs supports dynamic workload based power profiles, which can
provide fine-tuned performance for a particular type of workload.
This patch series adds an interface to set/reset these power profiles
based on the workload type hints. A user can set a hint of workload
type being submistted to GPU, and the driver can dynamically switch
the power profiles which is best suited to this kind of workload.

Currently supported workload profiles are:
"None", "3D", "Video", "VR", "Compute"

V2: This version addresses the review comment from Christian about
chaning the design to set workload mode in a more dynamic method
than during the context creation.

V3: Addressed review comment from Christian, Removed the get_workload()
  calls from UAPI, keeping only the set_workload() call.

Shashank Sharma (5):
    drm/amdgpu: add UAPI for workload hints to ctx ioctl
    drm/amdgpu: add new functions to set GPU power profile
    drm/amdgpu: set GPU workload via ctx IOCTL
    drm/amdgpu: switch GPU workload profile
    drm/amdgpu: switch workload context to/from compute


Where are the corresponding Mesa changes?



This series here was to get the feedback on the kernel side design first. As 
you can see from the patch history, we have already changed the design once and 
this is V2. So I thought it would be a good idea to get the feedback on kernel 
UAPI, before starting sending patches to mesa.


In general, it's not possible to review UAPI without the corresponding 
user-space code. I don't think this is an exception.




Sure, good that we already have got the kernel inputs we wanted, now the 
next version will be with corresponding MESA changes.


- Shashank


Re: [PATCH v3 0/5] GPU workload hints for better performance

2022-09-27 Thread Michel Dänzer
On 2022-09-27 18:59, Sharma, Shashank wrote:
> Hey Michel,
> Thanks for the review coments.
> 
> On 9/27/2022 6:24 PM, Michel Dänzer wrote:
>> On 2022-09-26 23:40, Shashank Sharma wrote:
>>> AMDGPU SOCs supports dynamic workload based power profiles, which can
>>> provide fine-tuned performance for a particular type of workload.
>>> This patch series adds an interface to set/reset these power profiles
>>> based on the workload type hints. A user can set a hint of workload
>>> type being submistted to GPU, and the driver can dynamically switch
>>> the power profiles which is best suited to this kind of workload.
>>>
>>> Currently supported workload profiles are:
>>> "None", "3D", "Video", "VR", "Compute"
>>>
>>> V2: This version addresses the review comment from Christian about
>>> chaning the design to set workload mode in a more dynamic method
>>> than during the context creation.
>>>
>>> V3: Addressed review comment from Christian, Removed the get_workload()
>>>  calls from UAPI, keeping only the set_workload() call.
>>>
>>> Shashank Sharma (5):
>>>    drm/amdgpu: add UAPI for workload hints to ctx ioctl
>>>    drm/amdgpu: add new functions to set GPU power profile
>>>    drm/amdgpu: set GPU workload via ctx IOCTL
>>>    drm/amdgpu: switch GPU workload profile
>>>    drm/amdgpu: switch workload context to/from compute
>>
>> Where are the corresponding Mesa changes?
>>
>>
> This series here was to get the feedback on the kernel side design first. As 
> you can see from the patch history, we have already changed the design once 
> and this is V2. So I thought it would be a good idea to get the feedback on 
> kernel UAPI, before starting sending patches to mesa.

In general, it's not possible to review UAPI without the corresponding 
user-space code. I don't think this is an exception.


-- 
Earthling Michel Dänzer|  https://redhat.com
Libre software enthusiast  | Mesa and Xwayland developer



Re: [PATCH v3 0/5] GPU workload hints for better performance

2022-09-27 Thread Sharma, Shashank

Hey Michel,
Thanks for the review coments.

On 9/27/2022 6:24 PM, Michel Dänzer wrote:

On 2022-09-26 23:40, Shashank Sharma wrote:

AMDGPU SOCs supports dynamic workload based power profiles, which can
provide fine-tuned performance for a particular type of workload.
This patch series adds an interface to set/reset these power profiles
based on the workload type hints. A user can set a hint of workload
type being submistted to GPU, and the driver can dynamically switch
the power profiles which is best suited to this kind of workload.

Currently supported workload profiles are:
"None", "3D", "Video", "VR", "Compute"

V2: This version addresses the review comment from Christian about
chaning the design to set workload mode in a more dynamic method
than during the context creation.

V3: Addressed review comment from Christian, Removed the get_workload()
 calls from UAPI, keeping only the set_workload() call.

Shashank Sharma (5):
   drm/amdgpu: add UAPI for workload hints to ctx ioctl
   drm/amdgpu: add new functions to set GPU power profile
   drm/amdgpu: set GPU workload via ctx IOCTL
   drm/amdgpu: switch GPU workload profile
   drm/amdgpu: switch workload context to/from compute


Where are the corresponding Mesa changes?


This series here was to get the feedback on the kernel side design 
first. As you can see from the patch history, we have already changed 
the design once and this is V2. So I thought it would be a good idea to 
get the feedback on kernel UAPI, before starting sending patches to 
mesa. The mesa/libdrm changes are ready and I was using those mixed with 
libdrm/test/amdgpu stuff to validate the series.


Now I will fine tune them to match the feedback here, and send the 
updated series.


- Shashank


Re: [PATCH v3 0/5] GPU workload hints for better performance

2022-09-27 Thread Michel Dänzer
On 2022-09-26 23:40, Shashank Sharma wrote:
> AMDGPU SOCs supports dynamic workload based power profiles, which can
> provide fine-tuned performance for a particular type of workload.
> This patch series adds an interface to set/reset these power profiles
> based on the workload type hints. A user can set a hint of workload
> type being submistted to GPU, and the driver can dynamically switch
> the power profiles which is best suited to this kind of workload. 
> 
> Currently supported workload profiles are:
> "None", "3D", "Video", "VR", "Compute"
> 
> V2: This version addresses the review comment from Christian about
> chaning the design to set workload mode in a more dynamic method
> than during the context creation.
> 
> V3: Addressed review comment from Christian, Removed the get_workload()
> calls from UAPI, keeping only the set_workload() call.
> 
> Shashank Sharma (5):
>   drm/amdgpu: add UAPI for workload hints to ctx ioctl
>   drm/amdgpu: add new functions to set GPU power profile
>   drm/amdgpu: set GPU workload via ctx IOCTL
>   drm/amdgpu: switch GPU workload profile
>   drm/amdgpu: switch workload context to/from compute

Where are the corresponding Mesa changes?


-- 
Earthling Michel Dänzer|  https://redhat.com
Libre software enthusiast  | Mesa and Xwayland developer



[PATCH v3 0/5] GPU workload hints for better performance

2022-09-26 Thread Shashank Sharma
AMDGPU SOCs supports dynamic workload based power profiles, which can
provide fine-tuned performance for a particular type of workload.
This patch series adds an interface to set/reset these power profiles
based on the workload type hints. A user can set a hint of workload
type being submistted to GPU, and the driver can dynamically switch
the power profiles which is best suited to this kind of workload. 

Currently supported workload profiles are:
"None", "3D", "Video", "VR", "Compute"

V2: This version addresses the review comment from Christian about
chaning the design to set workload mode in a more dynamic method
than during the context creation.

V3: Addressed review comment from Christian, Removed the get_workload()
calls from UAPI, keeping only the set_workload() call.

Shashank Sharma (5):
  drm/amdgpu: add UAPI for workload hints to ctx ioctl
  drm/amdgpu: add new functions to set GPU power profile
  drm/amdgpu: set GPU workload via ctx IOCTL
  drm/amdgpu: switch GPU workload profile
  drm/amdgpu: switch workload context to/from compute

 drivers/gpu/drm/amd/amdgpu/Makefile   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 14 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c|  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c   | 42 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h   |  1 +
 .../gpu/drm/amd/amdgpu/amdgpu_ctx_workload.c  | 93 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c   | 15 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h   |  3 +
 .../gpu/drm/amd/include/amdgpu_ctx_workload.h | 54 +++
 drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h   |  5 +
 include/uapi/drm/amdgpu_drm.h | 17 
 12 files changed, 243 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx_workload.c
 create mode 100644 drivers/gpu/drm/amd/include/amdgpu_ctx_workload.h

-- 
2.34.1