Skip to contentSkip to conversation

drm/amdgpu: disable gpu-sched load balance for uvd_enc

PATCH In review Nirmoy Das 3 participants 3 messages Sep 2, 2020 – Sep 3, 2020

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/amdgpu: disable gpu-sched load balance for uvd_enc

On hardware with multiple uvd instances, dependent uvd_enc jobs may get scheduled to different uvd instances. Because uvd_enc jobs retain hw context, dependent jobs should always run on the same uvd instance. This patch disables GPU scheduler's load balancer for a context that binds jobs from the same context to a uvd instance.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +2 -0
index 7cd398d25498..c80d8339f58c 100644
@@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
 	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
 	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 
+	/* disable load balance if the hw engine retains context among dependent jobs */
 	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
 	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
 	    hw_ip == AMDGPU_HW_IP_UVD) {
 		sched = drm_sched_pick_best(scheds, num_scheds);
 		scheds = &sched;

--
2.28.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by on v1 1/1
#1 lore raw

Am 02.09.20 um 12:15 schrieb Nirmoy Das:

Quoted 8 lines

On hardware with multiple uvd instances, dependent uvd_enc jobs may get scheduled to different uvd instances. Because uvd_enc jobs retain hw context, dependent jobs should always run on the same uvd instance. This patch disables GPU scheduler's load balancer for a context that binds jobs from the same context to a uvd instance.

Quoted 22 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +2 -1
index 7cd398d25498..c80d8339f58c 100644
@@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
  	scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
  	num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 
+	/* disable load balance if the hw engine retains context among dependent jobs */
  	if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
  	    hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+	    hw_ip == AMDGPU_HW_IP_UVD_ENC ||
  	    hw_ip == AMDGPU_HW_IP_UVD) {
  		sched = drm_sched_pick_best(scheds, num_scheds);
  		scheds = &sched;
--

2.28.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

Hi Alex,

If possible, please squash this with:

commit e0300ed8820d19fe108006cf1b69fa26f0b4e3fc

drm/amdgpu: disable gpu-sched load balance for uvd

Regards,

Nirmoy

Quoted 36 lines · Christian König

Am 02.09.20 um 12:15 schrieb Nirmoy Das:

Quoted 8 lines

On hardware with multiple uvd instances, dependent uvd_enc jobs may get scheduled to different uvd instances. Because uvd_enc jobs retain hw context, dependent jobs should always run on the same uvd instance. This patch disables GPU scheduler's load balancer for a context that binds jobs from the same context to a uvd instance.

Quoted 24 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++

  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +1 -0
index 7cd398d25498..c80d8339f58c 100644
@@ -114,8 +114,10 @@ static int amdgpu_ctx_init_entity(struct 
 amdgpu_ctx *ctx, u32 hw_ip,
       scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
       num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 
+    /* disable load balance if the hw engine retains context among 

dependent jobs */
      if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
          hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+        hw_ip == AMDGPU_HW_IP_UVD_ENC ||
          hw_ip == AMDGPU_HW_IP_UVD) {
          sched = drm_sched_pick_best(scheds, num_scheds); scheds = &sched;

Signature · 1 line
2.28.0
Quoted 6 lines
Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cnirmoy.das%40amd.com%7C14abaffe97944d1732a008d84f306f01%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637346416736947845&sdata=1F8al%2F7xTX2sjhoUI88UNE2mjWPJxNpFslmAuBJjevU%3D&reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx