#857

AMD Windows driver crashes creating lds_fuzz wave64 programs translated with --wave64-emulate

OpenUlteriorMotive00opened 10h ago

On an AMD RDNA2 iGPU under the AMD Windows driver, vk_compute_test and vk_pipeline_check crash with an access violation (exit 0xC0000005) for most wave64 lds_fuzz.py programs translated with --wave64-emulate. Found while running TEST-71; counts in #166.

Setup: AMD Radeon(TM) Graphics, Ryzen 7 9800X3D iGPU (RDNA2, PCI 1002:13C0), AMD proprietary driver 2026.04.17 (32.0.21042.62), Vulkan 1.4.315, subgroup 32..64. Windows 11 Home 10.0.26300. Main dedd75c, MSVC 14.44, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0. VK_LOADER_DRIVERS_SELECT=*amd*, VK_LOADER_LAYERS_DISABLE=~implicit~.

Repro (no game files):

python -I tools/lds_fuzz.py --programs 1 --seed 1 --wave 64 --emulate --work <dir>
runtime\build\vk_pipeline_check.exe <dir>\spirv

Both crash every time (vk_pipeline_check stops after "checking 1 shaders", exit -1073741819), so the crash is in compute pipeline creation, inside the driver, before any dispatch.

What I checked:

  • Seed 1, 100 programs: 58 of the 100 emulated wave64 programs crash; the other 42 run and match. Programs 0, 1 and 2 crash on every rerun.
  • The same programs pass on the same GPU without --emulate (native wave64), and pass with --emulate on an RTX 5070 (617.42).
  • The crashing SPIR-V passes spirv-val --target-env vulkan1.3. Program 0 uses only Shader, Int64 and PhysicalStorageBufferAddresses, LocalSize 64 1 1; its ds ops are ds_cmpst_rtn_b32, ds_max_rtn_i32, ds_read_b32, ds_read_i8_d16_hi, ds_read2st64_b32, ds_sub_rtn_u32, ds_swizzle_b32, ds_write_b32, ds_write2_b32, ds_wrxchg_rtn_b32.
  • valu_fuzz.py --emulate (f16 and mem) runs fine on this GPU, 200/200 each, so it looks specific to the LDS emulation path.

Not checked: other AMD Windows driver versions, a discrete RDNA2 card, or which op triggers it (I haven't minimised the program). Possibly a driver compiler bug, but the translator might be able to avoid it.

AI-assisted: found and written up with Claude Code. Synthetic programs only, no game data.

Activity

10
UlteriorMotive0010h ago

Narrowed down. It isn't a particular ds op: an empty lds_fuzz program (only the harness's own LDS writes and reads) crashes too. Delta-debugging that program's assembly leaves 5 instructions. With --wave64-emulate this crashes vk_pipeline_check on the AMD iGPU every time, and removing any one of the 5 makes it compile:

; group: 64,1,1
; rsrc2: 0x40088
; mattr: +wavefrontsize64,-wavefrontsize32
s_mov_b64 exec, -1
ds_write_b32 v6, v7
ds_write_b32 v6, v7
v_add_nc_u32_e32 v7, 320, v0
v_lshlrev_b32_e32 v6, 2, v7
s_endpgm

The emulated output splits the two writes into switch cases 0 and 2 of the round loop. Case 2 ends by storing the new v6 into the %vgpr Function array. Hand edits to that SPIR-V (all pass spirv-val):

EditAMD 2026.04.17
nonecrash
drop the v6 store at the end of case 2ok
store v6 to another register (v9) insteadok
store a constant into v6ok
drop both LDS storesok
both LDS indices constantok
only case 0's LDS index constantcrash
drop either LDS store alonecrash
no inner chain loop, or no x_buf round atomicscrash
%vgpr array 8..128 entries instead of 256crash
LDS stores Volatile, %vgpr loads Volatile, UMin instead of & 0x3ff, OpAtomicExchange instead of OpStorecrash

So the trigger is a private register that, within the round loop, is used as a dynamic Workgroup-array index in two switch cases and then rewritten from a value that depends on another register. That looks like an AMD shader-compiler bug. I haven't found a translator-side workaround yet.

Why it might matter beyond the fuzzer: --wave64-emulate auto turns emulation on when any GPU is 32-wide. A Ryzen-iGPU + NVIDIA PC (like this one) gets emulated shaders, and if the runtime ever picks the iGPU, emulated LDS code can crash the driver. On an AMD-only PC, auto mode keeps emulation off, so this wouldn't come up.

AI-assisted (Claude Code). Synthetic programs only.

bobcatchris9h ago

Not reproduced on an AMD RDNA3 desktop GPU, with the same llvm-mc version as the report.

Setup: AMD Radeon RX 7900 XTX (RDNA3, gfx1100), AMD driver 26.10.1 (LLPC), Vulkan 1.4.359, Windows 11 build 26200, main d1211d0, MSVC 19.39, llvm-mc 21.1.8. No game files.

Your repro, with your loader environment (VK_LOADER_DRIVERS_SELECT=*amd*, VK_LOADER_LAYERS_DISABLE=~implicit~):

python -I tools/lds_fuzz.py --programs 1 --seed 1 --wave 64 --emulate --work <dir>
  -> 1/1 programs that ran match (emulated); 0 mismatched, 0 harness errors
runtime\build\vk_pipeline_check.exe <dir>\spirv
  -> cs: 1 modules ok, 0 failed / cs pipelines: 1 ok, 0 failed, 0 skipped

Scaled up to 20 programs (--programs 20 --seed 1 --wave 64 --emulate): 20 modules ok, 20 pipelines ok, 0 failed, 0 skipped, and the fuzzer reports 20/20 match, 0 harness errors. No access violation, so the emulated wave64 SPIR-V does not by itself break pipeline creation here.

That points at the RDNA2 iGPU / its driver (32.0.21042.62) rather than the shape of the translated module — but I could not cover that case myself: my Ryzen 7 7800X3D's RDNA2 iGPU does not enumerate as a Vulkan device on this machine (only the discrete 7900 XTX shows up), so the iGPU path is untested here.

Two things that would narrow it on your side: whether it still reproduces on current main (d1211d0 — the translator has moved since dedd75c, e.g. 87700c0 for wave32 ds_bpermute), and, if it does, whether vk_pipeline_check also crashes for a non-fuzzer wave64 emulated module from runtime/test/shaders — that separates "every emulated wave64 module" from "these lds_fuzz programs".

AI-assisted.

StebanSchrader9h ago

Does not reproduce on a Radeon 780M (RDNA3 iGPU, Ryzen 7 7840HS) with an older AMD driver, 24.10.20.01 (Windows 32.0.11020.1002), Windows 11 26200, main 4a36bb1, llvm-mc 23.1.6, MSVC 19.44:

  • lds_fuzz.py --programs 100 --seed 1 --wave both --emulate: 191/200 match, 0 harness errors. The 9 mismatches are the known wave32 bpermute ones (#253).
  • The repro from the issue (--programs 1 --seed 1 --wave 64 --emulate, then vk_pipeline_check): both exit 0.

Two variables differ from your setup (RDNA3 instead of RDNA2, and an older driver), so this doesn't say which one matters. The 5-instruction reduction was not run.

No game files used. AI-assisted run (Claude Code).

TheHoracio9h ago

Reproduced on the same iGPU with a newer driver, and with an RDNA3 dGPU in the same PC as a control.

  • PC: Ryzen 7000-series desktop iGPU, AMD Radeon(TM) Graphics 0x1002:0x13c0 (RDNA2, the device ID from the report), plus an RX 7800 XT (RDNA3) in the same machine.
  • Driver: AMD 26.10.1 (Windows 32.0.21045.16010 on the iGPU), newer than the report's 2026.04.17 (32.0.21042.62).
  • Software: Windows 11 Pro 26300, main d1211d0, MSVC 14.44, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0.
  • GPU selection: VK_LOADER_DEVICE_ID_FILTER=0x1002:0x13c0 and VK_LOADER_LAYERS_DISABLE=~implicit~, so only the iGPU is visible.
run on the iGPUresult
the issue's repro (--programs 1 --seed 1 --wave 64 --emulate, then vk_pipeline_check)crash: exit 3221225477, 0 dump bytes; vk_pipeline_check stops after "checking 1 shaders"
lds_fuzz.py --programs 100 --seed 1 --wave both --emulate142/142 that ran match, 58 harness errors (all w64)
the same without --emulate200/200, 0 errors

The 58 crashing programs are the same count as in the report, and 0, 1 and 2 are among them: 0 1 2 5 7 8 10 11 12 15 17 20 21 22 27 28 29 30 32 34 36 37 39 40 41 42 43 44 45 47 49 51 52 55 56 59 61 62 63 66 67 68 69 71 74 75 76 79 80 81 82 85 86 87 88 89 93 97.

Control: the RX 7800 XT runs this series on the same 26.10.1 driver with 0 harness errors (seed 1, 200 programs, --emulate: 380/400 match, and the 20 mismatches are only the #253 bpermute class). The two driver releases behave the same on this RDNA2 iGPU, and an RDNA3 card on the newer one is unaffected. So this looks like the shader compiler's RDNA2 (gfx103x iGPU) path, not a one-off driver build.

One consequence for --wave64-emulate auto: on a PC like this one, with an AMD iGPU and an AMD dGPU and both 64-wide, auto mode keeps emulation off, so the runtime is not exposed. The risk is the iGPU + NVIDIA combination the report describes. Synthetic programs only. AI-assisted.

ItsJaved7h ago

Not reproduced on an older AMD proprietary driver on an RDNA2 iGPU:

  • Setup: AMD Radeon(TM) Graphics (RDNA2 Ryzen 7000 iGPU, 0x1002:0x164e), AMD driver 23.20.44 (Windows 31.0.22044.1, Vulkan 1.3.262, subgroup 32..64), Windows 11, main 48ad23f (also tested at 43d4703), MSVC 19.51.36247.0, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0, VK_LOADER_DRIVERS_SELECT=*amd*, VK_LOADER_LAYERS_DISABLE=~implicit~.
  • python -I tools/lds_fuzz.py --programs 1 --seed 1 --wave 64 --emulate + vk_pipeline_check: 1/1 match, cs pipelines: 1 ok, 0 failed, exit 0.
  • python -I tools/lds_fuzz.py --programs 100 --seed 1 --wave 64 --emulate: 100/100 match (emulated); 0 mismatched, 0 skipped, 0 not translated, 0 harness errors, exit 0.

So the RDNA2 iGPU wave64-emulate LDS compiler crash started on a newer AMD driver after 23.20.44. No game files. AI-assisted.

liang-kai-shui6h ago

Another data point: an RDNA2 iGPU with the same device ID as @ItsJaved's older-driver non-repro, but a newer driver, crashes the same way.

Setup: AMD Radeon(TM) 610M (RDNA2 iGPU, PCI 1002:164E), AMD proprietary driver 2.0.353 (Windows 32.0.21045.29003), Vulkan 1.4.315, subgroup 32..64, Windows 11 Home 10.0.26300, main 48ad23f, runtime/test binaries from the CI Runtime artifact of run 44993959859 (MSVC), llvm-mc 23.1.6, SPIRV-Tools v2026.4, selected with LEONIDA_VK_DEVICE=Radeon.

  • The issue's repro, python -I tools/lds_fuzz.py --programs 1 --seed 1 --wave 64 --emulate: cs_ldsfuzz_s1_0_w64 crashes vk_compute_test (exit 3221225477, 0 of 8192 dump bytes); vk_pipeline_check on that spirv directory also crashes with -1073741819 after "checking 1 shaders", so it is pipeline creation as in the report.
  • --programs 50 --seed 1 --wave both --emulate: 69/69 that ran match, 31 harness errors, all _w64 (indices 0 1 2 5 7 8 10 11 12 15 17 20 21 22 27 28 29 30 32 34 36 37 39 40 41 42 43 44 45 47 49).
  • The same without --emulate: 100/100. valu_fuzz.py --family f16/mem with --emulate: 100/100 each.

ItsJaved's 1002:164E on 23.20.44 did not crash; this 1002:164E on 32.0.21045.29003 does. Same device ID, so the iGPU model is not the variable, which is consistent with the driver regression after 23.20.44 that the older-driver run suggests.

AI-assisted. No game files.

ReSo726h ago

Reproduced on the same iGPU device ID with an older driver than the report.

  • Setup: AMD Radeon(TM) Graphics, Ryzen 9 9950X3D iGPU (RDNA2, PCI 1002:13C0), AMD driver 25.10.30 (Windows 32.0.21030.31, dated 2025-09-02), Vulkan 1.4.315, subgroup 32..64, Windows 11 Pro 10.0.26300, main 48ad23f, MSVC 14.50, llvm-mc 21.1.8, Vulkan SDK 1.4.363.1, LEONIDA_VK_DEVICE=radeon.
  • python -I tools/lds_fuzz.py --seed 1 --emulate (50 programs, both waves): 69/69 programs that ran match, 31 harness errors, all wave64, all vk_compute_test exit 3221225477 (0xC0000005) with 0 dump bytes. Programs 0, 1, 2, 5, 7 and 8 are among them; none of the 50 wave32 programs crash.
  • Same GPU without --emulate: 100/100. valu_fuzz.py --emulate f16 and mem: 100/100 each.
  • RTX 5070 Ti (617.42) in the same PC, lds_fuzz.py --seed 1 --emulate: 100/100.

So 32.0.21030.31 already has it: 31 of 50 emulated wave64 programs crash here.

poke900310-lgtm4h ago

Not reproduced on RDNA4 with the current driver.

Setup: RX 9070 XT (RDNA4, gfx1201, native wave64), AMD driver 26.11.1 (LLPC, Windows 32.0.32015.16001), Vulkan 1.4.359, Windows 11 Pro N 10.0.26200, main 4a36bb1, local llvm-mc. Nothing else was using the GPU.

runresult
lds_fuzz seed 1, 100 programs, wave64 --emulate100/100 run and match, 0 crashes, exit 0
same again (rerun)100/100, 0 crashes
seeds 2 and 3, --emulate100/100 each, 0 crashes
seeds 1-3 native wave64100/100 each
vk_pipeline_check on the emulated SPIR-V, seeds 1-3all compile, exit 0, about 0.19 s mean per pipeline (native about 0.05 s)
the 5-instruction reduction from above, emulated and nativeboth compile, exit 0

So with this thread's RDNA3 results, everything so far points at the RDNA2 compiler path in AMD's driver. RDNA3 and RDNA4 handle the same emulated programs fine, including programs 0-2 of seed 1. The emulated pipelines do compile about 4x slower than native here, but nowhere near a problem.

AI-assisted run (Claude Code); counts only, no game data.

UlteriorMotive002h ago

Update from the reporter, for anyone looking at a translator-side fix.

Scope. With the reports above and #1280, this is the RDNA2 shader compiler in the current AMD Windows driver: iGPUs 1002:13C0 and 1002:164E on drivers 32.0.21030.31 through 32.0.21045.29003, and a discrete RX 6800 in #1280. 23.20.44 on 1002:164E doesn't crash. RDNA3 (7900 XTX, 7800 XT, 780M) and RDNA4 (9070 XT) don't crash. #1280 is the same bug (same 31/50 seed-1 indices and the same amdvlk64.dll fault).

More things that don't avoid it. These were tried on the 5-instruction reduction, AMD 32.0.21042.62, main bb2e184. Every edited module passes spirv-val, and every one still crashes vkCreateComputePipelines:

editresult
%vgpr register array in Private storage instead of Functioncrash
LDS index bounded with idx < 0x400 ? idx : 0 (OpSelect) instead of & 0x3ffcrash
LDS array wrapped in a struct, accessed as lds.m[idx]crash
LDS index bitcast to a signed intcrash
the 0x3ff mask loaded from a Private variable instead of a constantcrash
index stored to a Function temp and reloaded Volatile before the access chaincrash
VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT on the pipelinecrash
no VkPipelineShaderStageRequiredSubgroupSizeCreateInfocrash

With the earlier table, every change that avoids it so far changes what the program computes: dropping or retargeting the register write, or making the LDS indices constant. So I don't have a translator workaround to propose.

Until there is one, the practical guard is in the runtime: don't run --wave64-emulate LDS shaders on an RDNA2 device under the AMD Windows driver. That device runs wave64 natively, so the runtime could translate without emulation for it, or prefer the other GPU, when the PC also has a 32-wide one. I haven't written that, and I don't know whether the runtime picks its shader set per device yet.

AI-assisted (Claude Code). Synthetic programs only, no game data.

wildheathen2h ago

A standalone SPIR-V reproducer for this, 73 lines, that doesn't need the translator, plus the exact fault address. AI-assisted. Same iGPU and driver as the report (Ryzen 7 9800X3D, 1002:13C0, 32.0.21042.62), main 426023a.

(I'd opened #1280 for this before finding this issue; closing it as a duplicate. @Mustafaiq1998x's RX 6800 results there, with 32.0.21045.1000 and 32.0.21045.29003, belong here too.)

Same reduction, independently. Delta debugging cs_ldsfuzz_s1_0_w64 (305 instructions) ends at 6 instructions with the same shape as the 5 above: two LDS ops split into switch cases 0 and 2, a store whose address register is rewritten afterwards by v_add_nc_u32 + v_lshlrev_b32.

ds_max_rtn_i32 v21, v6, v20 offset:584
s_mov_b64 exec, -1
ds_wrxchg_rtn_b32 v35, v6, v31 offset:0
buffer_store_dword v6, v7, s[0:3], 0 offen
v_add_nc_u32_e32 v7, 128, v0
v_lshlrev_b32_e32 v7, 2, v7

Fault address. Under the Windows debug API, the unhandled exception for the original program and the reduced one is at amdvlk64.dll+0x7e45f3 (32.0.21042.62), in vkCreateComputePipelines; on #1280 the RX 6800 reports 0x7E4623 and 0x7E4613 on 32.0.21045.x, which looks like the same function in a later build. I matched candidates on this exact address, because a spirv-reduce run without that filter slid to a variant whose loops never exit, and that one faults at +0xd95f1a, a different crash.

Standalone SPIR-V. spirv-reduce filtered on +0x7e45f3, then hand-written and minimized. spirv-val --target-env vulkan1.2 passes; it faults at +0x7e45f3 on the iGPU, and creates and runs normally on an RTX 5080 (621.24). Run with vk_compute_test <spv> 1 dump.

amd_7e45f3_repro.spvasm
; Crashes amdvlk64.dll 32.0.21042.62 at +0x7e45f3 in vkCreateComputePipelines (RDNA2 iGPU).
               OpCapability Shader
               OpCapability Int64
               OpCapability PhysicalStorageBufferAddresses
               OpExtension "SPV_KHR_physical_storage_buffer"
               OpMemoryModel PhysicalStorageBuffer64 GLSL450
               OpEntryPoint GLCompute %main "main"
               OpExecutionMode %main LocalSize 64 1 1
               OpDecorate %ra ArrayStride 4
       %void = OpTypeVoid
         %fn = OpTypeFunction %void
       %bool = OpTypeBool
       %uint = OpTypeInt 32 0
      %ulong = OpTypeInt 64 0
     %uint_0 = OpConstant %uint 0
     %uint_1 = OpConstant %uint 1
     %uint_2 = OpConstant %uint 2
     %uint_4 = OpConstant %uint 4
   %uint_128 = OpConstant %uint 128
   %uint_256 = OpConstant %uint 256
       %true = OpConstantTrue %bool
       %p_fu = OpTypePointer Function %uint
       %p_fb = OpTypePointer Function %bool
         %ra = OpTypeRuntimeArray %uint
       %p_ra = OpTypePointer PhysicalStorageBuffer %ra
        %p_u = OpTypePointer PhysicalStorageBuffer %uint
       %main = OpFunction %void None %fn
      %entry = OpLabel
       %flag = OpVariable %p_fb Function %true
         %pc = OpVariable %p_fu Function %uint_0
         %it = OpVariable %p_fu Function %uint_0
               OpBranch %head
       %head = OpLabel
               OpLoopMerge %exit %cont None
               OpBranch %body
       %body = OpLabel
        %pcv = OpLoad %uint %pc
               OpSelectionMerge %sm None
               OpSwitch %pcv %dflt 0 %c0 2 %c2
         %c0 = OpLabel
               OpStore %flag %true
               OpBranch %sm
         %c2 = OpLabel
          %e = OpLoad %uint %it
         %e64 = OpUConvert %ulong %e
          %f = OpLoad %bool %flag
               OpSelectionMerge %st None
               OpBranchConditional %f %do %st
         %do = OpLabel
        %ptr = OpConvertUToPtr %p_ra %e64
         %pe = OpAccessChain %p_u %ptr %uint_0
               OpStore %pe %uint_256 Aligned 4
               OpBranch %st
         %st = OpLabel
         %ad = OpIAdd %uint %uint_128 %e
         %sl = OpSelect %uint %f %ad %uint_256
         %sh = OpShiftLeftLogical %uint %sl %uint_2
               OpStore %it %sh
               OpStore %pc %uint_1
               OpBranch %sm
       %dflt = OpLabel
               OpBranch %sm
         %sm = OpLabel
               OpBranch %cont
       %cont = OpLabel
        %itv = OpLoad %uint %it
        %it1 = OpIAdd %uint %itv %uint_1
               OpStore %it %it1
       %more = OpULessThan %bool %it1 %uint_4
               OpBranchConditional %more %head %exit
       %exit = OpLabel
               OpReturn
               OpFunctionEnd

No translator code is in it, so it should be usable as is in a report to AMD. Removing any one of these makes pipeline creation succeed (3 runs each):

  • the loop;
  • the two-case OpSwitch (an if on pc, or a switch with only case 2, compiles);
  • the physical-buffer store;
  • the if around the store (without it the fault moves to +0x7e556a);
  • the OpSelect on the flag loaded from a Function variable;
  • the shift;
  • the write-back to the same Function variable the store's address was loaded from;
  • the OpStore %pc.

That matches your table: the trigger is a private variable that feeds an address in the round loop and is rewritten from a value derived from itself. Here the address is a physical-buffer pointer instead of a Workgroup index, so the LDS ops in the original only serve to split the program into switch cases.