From a8024aaaab9812d018cfa656d0dfce6ffedc123f Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 31 Jan 2020 14:35:54 +0100 Subject: [PATCH] radv: make sure to not submit any IBs when RADV_FORCE_FAMILY is set To prevent GPU hangs. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- docs/envvars.html | 2 ++ src/amd/vulkan/radv_debug.h | 1 + src/amd/vulkan/radv_device.c | 3 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 3 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 1 + src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h | 1 + 6 files changed, 11 insertions(+) diff --git a/docs/envvars.html b/docs/envvars.html index 124f42714cc..d8d86503ee1 100644 --- a/docs/envvars.html +++ b/docs/envvars.html @@ -583,6 +583,8 @@ Mesa EGL supports different sets of environment variables. See the
disable memory shaders cache
nongg
disable NGG for GFX10+
+
noop
+
do not submit any IBs
nooutoforder
disable out-of-order rasterization
noshaderballot
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h index 02691fe4c23..73833491b08 100644 --- a/src/amd/vulkan/radv_debug.h +++ b/src/amd/vulkan/radv_debug.h @@ -57,6 +57,7 @@ enum { RADV_DEBUG_ALL_ENTRYPOINTS = 0x4000000, RADV_DEBUG_DUMP_META_SHADERS = 0x8000000, RADV_DEBUG_NO_MEMORY_CACHE = 0x10000000, + RADV_DEBUG_NOOP = 0x20000000, }; enum { diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 890225f7b9f..4fc412dbc9c 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -312,6 +312,8 @@ radv_handle_env_var_force_family(struct radv_physical_device *device) else device->rad_info.chip_class = GFX6; + /* Don't submit any IBs. */ + device->instance->debug_flags |= RADV_DEBUG_NOOP; return; } } @@ -560,6 +562,7 @@ static const struct debug_control radv_debug_options[] = { {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS}, {"metashaders", RADV_DEBUG_DUMP_META_SHADERS}, {"nomemorycache", RADV_DEBUG_NO_MEMORY_CACHE}, + {"noop", RADV_DEBUG_NOOP}, {NULL, 0} }; diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index dbc7397ed93..4e29716b920 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -1235,6 +1235,9 @@ static int radv_amdgpu_winsys_cs_submit(struct radeon_winsys_ctx *_ctx, struct radv_amdgpu_ctx *ctx = radv_amdgpu_ctx(_ctx); int ret; + if (cs->ws->noop) + abort(); + assert(sem_info); if (!cs->ws->use_ib_bos) { ret = radv_amdgpu_winsys_cs_submit_sysmem(_ctx, queue_idx, sem_info, bo_list, cs_array, diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index a77508faf94..4310009ddb0 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -189,6 +189,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags) ws->use_local_bos = perftest_flags & RADV_PERFTEST_LOCAL_BOS; ws->zero_all_vram_allocs = debug_flags & RADV_DEBUG_ZERO_VRAM; + ws->noop = debug_flags & RADV_DEBUG_NOOP; ws->batchchain = !(perftest_flags & RADV_PERFTEST_NO_BATCHCHAIN); list_inithead(&ws->global_bo_list); pthread_mutex_init(&ws->global_bo_list_lock, NULL); diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h index edec0a1ed78..ca16c48a791 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h @@ -48,6 +48,7 @@ struct radv_amdgpu_winsys { bool use_ib_bos; bool zero_all_vram_allocs; bool use_local_bos; + bool noop; unsigned num_buffers; pthread_mutex_t global_bo_list_lock; -- 2.30.2