GPU: serialize driver pipeline compilation on AMD to prevent amdxc64.dll crash #167
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!167
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/167/head"
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?
@a-to-z on GitHub · 2026-11-26 09:15 UTC · original
a-to-z:fix/amd-pipeline-compiler-race→main· +31 −5 · 3 files · 2 commits · closed without mergingProblem
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 warnings@a-to-z on GitHub · 2026-11-26 09:59 UTC · original
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