radv: make the GDS/GDS OA buffer objects resident
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 2 Nov 2022 12:53:58 +0000 (13:53 +0100)
committerEric Engestrom <eric@engestrom.ch>
Wed, 9 Nov 2022 21:22:05 +0000 (21:22 +0000)
commit68b469ba1a8803b32e7d95ae32440bddfffb2b66
treea5932e5de26056f4ec0d90bb61d6f98dfa121e5a
parent4acfc6a9bed85e53b9a839436b7936eae84ddfe5
radv: make the GDS/GDS OA buffer objects resident

GDS is used for NGG queries/streamout (GFX10+ only) and the BOs were
only added to the graphics queue because compute doesn't need them.
Though, the kernel emits a GDS switch when a queue submission doesn't
use GDS. That means that submitting jobs on the compute queue without
GDS can reset the state of the graphics queue and lead to GPU hangs.

The only viable solution for now is to make the GDS BOs resident to
avoid resetting the state between queues. This shouldn't introduce
more syncs between queues because GDS BOs are similar for both.

This fixes a GPU hang with Warhammer Chaosbane during loading time and
possibly some spurious random GPU hangs. Note that this GPU hang was
workarounded on the Steam side with RADV_DEBUG=nongg.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19466>
(cherry picked from commit 26c8fedc1bb12fa8f3d6c646308f4b46756d77c7)
.pick_status.json
src/amd/vulkan/radv_device.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c