GPU: serialize driver pipeline compilation on AMD to prevent amdxc64.dll crash #167
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/167"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by a-to-z on 2026-11-26T09:15:41Z.
Problem
On Windows with AMD graphics cards (such as RDNA 3 / RDNA 4), background pipeline worker threads concurrently invoke Direct3D 12 pipeline creation (CreateGraphicsPipelineState / CreateComputePipelineState).
AMD's shader compiler driver (mdxc64.dll) has an internal race condition in its Boost serialization singleton when multiple threads call into it simultaneously, resulting in a null pointer dereference (
cx == 0) and unhandled exception 0xc0000005:
text amdxc64!boost::serialization::singleton<...>::get_const_instance+0x19a41f 00007ffdc5461b9f 488b7908 mov rdi, qword ptr [rcx+8] ; rcx = 0 (Null-pointer read)Solution
compile_lock()inpipeline/library.rsto serialize driver compilation calls (both in the cold fallback and when library is uninitialized).VendorId == 0x1002) viacrate::indirect::amd.VICTORY_DRIVER_COMPILE_LOCK=1/0orVICTORY_LIBRARY_LOCK=1.Testing
cargo build --locked --profile diag -p victory --features diagnosticscargo clippy -p victory-gpu -- -D warningsImported from avatarmanz/VIctory-7900XTX. Originally posted by a-to-z on 2026-11-26T09:59:22Z.
Closing: the diagnosis here doesn't hold up.
amdxc64.dll+0x861b9f(null read at 0x8) still happens on this branch with the lock on. It is deterministic, not a race: it happens every run on the first compile of one compute shader (052a2316a03b9ba1, bound at frame 51 during Game Init), seen on an RX 9070 XT (RDNA4, driver 32.0.32029.2010).VICTORY_SHADER_OPT=0, i.e. the AMD compiler trips over the shape of the DXIL our clean-up passes produce. Each pass on its own is fine; the combination of DEAD/FOLD/REUSE (7) triggers it. Narrowing down further.A follow-up PR will target the actual trigger.
🤖 Generated with Claude Code
Pull request closed