radv: make sure to not submit any IBs when RADV_FORCE_FAMILY is set
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 31 Jan 2020 13:35:54 +0000 (14:35 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 11 Feb 2020 06:56:55 +0000 (07:56 +0100)
To prevent GPU hangs.

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/3654>

docs/envvars.html
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h

index 124f42714cc0599dcf926c2e2990078fd23989cc..d8d86503ee18a8bbc6bbdccca691e76baf31d627 100644 (file)
@@ -583,6 +583,8 @@ Mesa EGL supports different sets of environment variables.  See the
    <dd>disable memory shaders cache</dd>
    <dt><code>nongg</code></dt>
    <dd>disable NGG for GFX10+</dd>
+   <dt><code>noop</code></dt>
+   <dd>do not submit any IBs</dd>
    <dt><code>nooutoforder</code></dt>
    <dd>disable out-of-order rasterization</dd>
    <dt><code>noshaderballot</code></dt>
index 02691fe4c237848eccec45c6bab0ef7d154ae22e..73833491b0814caf078e0665b3e853066f7a87e2 100644 (file)
@@ -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 {
index 890225f7b9fd318ee95985b69989cf8936b4ee20..4fc412dbc9cdc5f53dd937af0ca585fd09cd9283 100644 (file)
@@ -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}
 };
 
index dbc7397ed9325fae8ed1effa3b761fd0e3a57f74..4e29716b9202e1749880c0854e2d3207747b4f8b 100644 (file)
@@ -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,
index a77508faf94fc412ac875b048626c3f9608611a9..4310009ddb06b989beed45ccce5ad6ab7521c855 100644 (file)
@@ -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);
index edec0a1ed78747a0a747ce9294e1fef8cdd55203..ca16c48a791e2630e31a94cfee9994956c08f1a6 100644 (file)
@@ -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;