From 9a21ac2730217f32dfd714e483004403779d194e Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Mon, 12 May 2025 09:12:28 +0000 Subject: [PATCH] winsys/amdgpu: Remove assert about user fence in amdgpu_fence_wait The assertion `assert(afence->seq_no <= *user_fence_cpu)` in `amdgpu_fence_wait` can trigger a Mesa exit during GPU mode2 resets in virtualized guest environments. A GPU reset can cause the hardware to discard commands, including the one that updates the user fence BO (`*user_fence_cpu`). This leaves `*user_fence_cpu` with an older value, while `afence->seq_no` (from command submission) is newer, leading to `afence->seq_no > *user_fence_cpu` and triggering the assert. Removing this assert prevents Mesa from exiting in this reset scenario. No adverse side effects observed during testing. The assert appears overly strict for hardware reset events where command completion is not guaranteed. Signed-off-by: Wei Zhao Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp index 6b4f2b38489..6ce19bb6826 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp @@ -212,10 +212,6 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout, abs_timeout, 0, NULL)) return false; - /* Check that guest-side syncobj agrees with the user fence. */ - if (user_fence_cpu && afence->aws->info.is_virtio) - assert(afence->seq_no <= *user_fence_cpu); - afence->signalled = true; return true; }