Skip to contentSkip to conversation

amdgpu: fix multi-process hang issue

PATCH In review Emily Deng 2 participants 2 messages Aug 22, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 amdgpu: fix multi-process hang issue

SWDEV-146499: hang during multi vulkan process testing

cause:
the second frame's PREAMBLE_IB have clear-state and LOAD actions, those actions ruin the pipeline that is still doing process in the previous frame's work-load IB.

fix:
need insert pipeline sync if have context switch for SRIOV (because only SRIOV will report PREEMPTION flag to UMD)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -1
index 5c22cfd..47817e0 100644
@@ -165,8 +165,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		return r;
 	}
 
+	need_ctx_switch = ring->current_ctx != fence_ctx;
 	if (ring->funcs->emit_pipeline_sync && job &&
 	    ((tmp = amdgpu_sync_get_fence(&job->sched_sync, NULL)) ||
+	     (amdgpu_sriov_vf(adev) && need_ctx_switch) ||
 	     amdgpu_vm_need_pipeline_sync(ring, job))) {
 		need_pipe_sync = true;
 
@@ -201,7 +203,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 	}
 
 	skip_preamble = ring->current_ctx == fence_ctx;
-	need_ctx_switch = ring->current_ctx != fence_ctx;
 	if (job && ring->funcs->emit_cntxcntl) {
 		if (need_ctx_switch)
 			status |= AMDGPU_HAVE_CTX_SWITCH;
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1534939678-11489-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 22.08.2018 um 14:07 schrieb Emily Deng:

Quoted 8 lines

SWDEV-146499: hang during multi vulkan process testing

cause:
the second frame's PREAMBLE_IB have clear-state and LOAD actions, those actions ruin the pipeline that is still doing process in the previous frame's work-load IB.

Quoted 7 lines

fix:
need insert pipeline sync if have context switch for SRIOV (because only SRIOV will report PREEMPTION flag to UMD)

Much better, patch is Reviewed-by: Christian König <[email protected]>

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -0
index 5c22cfd..47817e0 100644
@@ -165,8 +165,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
  		return r;
  	}
 
+	need_ctx_switch = ring->current_ctx != fence_ctx;
  	if (ring->funcs->emit_pipeline_sync && job &&
  	    ((tmp = amdgpu_sync_get_fence(&job->sched_sync, NULL)) ||
+	     (amdgpu_sriov_vf(adev) && need_ctx_switch) ||
  	     amdgpu_vm_need_pipeline_sync(ring, job))) {
  		need_pipe_sync = true;
 

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 208

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -1
@@ -201,7 +203,6 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
  	}
 
  	skip_preamble = ring->current_ctx == fence_ctx;
-	need_ctx_switch = ring->current_ctx != fence_ctx;
  	if (job && ring->funcs->emit_cntxcntl) {
  		if (need_ctx_switch)
  			status |= AMDGPU_HAVE_CTX_SWITCH;

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