From 4cd710a261a2214aa2f40a45131128c9f19c05f6 Mon Sep 17 00:00:00 2001 From: elwrcl Date: Thu, 20 Aug 2026 21:54:03 +0300 Subject: [PATCH] hasvk: Skip zero-sized compute dispatches on gen7. GPGPU_WALKER has no encoding for a zero group count, so passing one through walks the full dimension and the command never retires, hanging rcs0 (GPU HANG ecode 7:1:8ff8ffff, EIR and PGTBL_ER both clear). A zero dispatch is legal and defined as a no-op, so drop it at record time. through walks the full dimension and the command never retires, hanging rcs0 (GPU HANG ecode 7:1:8ff8ffff, EIR and PGTBL_ER both clear). A zero dispatch is legal and defined as a no-op, so drop it at record time. Gen9+ uses COMPUTE_WALKER and handles this in hardware, which is why upstream anv carries no equivalent guard. Fixes dEQP-VK.compute.pipeline.basic.empty_workgroup_{all,x,y,z} and empty_shader, which previously aborted the run and could take the whole machine down. compute.pipeline.* now 20285 cases, 0 fail. --- src/intel/vulkan_hasvk/genX_cmd_buffer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/vulkan_hasvk/genX_cmd_buffer.c b/src/intel/vulkan_hasvk/genX_cmd_buffer.c index 204931b..61e1b97 100644 --- a/src/intel/vulkan_hasvk/genX_cmd_buffer.c +++ b/src/intel/vulkan_hasvk/genX_cmd_buffer.c @@ -4811,6 +4811,18 @@ void genX(CmdDispatchBase)( if (cmd_buffer->state.conditional_render_enabled) genX(cmd_emit_conditional_render_predicate)(cmd_buffer); + /* A dispatch with a zero group count is legal and defined to do nothing. + * GPGPU_WALKER has no encoding for "no groups at all" though, so passing + * zero through walks the full dimension and the command never retires: + * dEQP-VK.compute.pipeline.basic.empty_workgroup_* hangs rcs0 every time + * (GPU HANG ecode 7:1:8ff8ffff). Gen9+ uses COMPUTE_WALKER and handles + * this in hardware, which is why upstream anv carries no such guard. + */ + if (groupCountX == 0 || groupCountY == 0 || groupCountZ == 0) { + trace_intel_end_compute(&cmd_buffer->trace, 0, 0, 0, 0); + return; + } + emit_cs_walker(cmd_buffer, pipeline, false, prog_data, groupCountX, groupCountY, groupCountZ);