Repository navigation
Recompiler: keep compute shaders on single loop budget to avoid AMD LLPC crash - #2947
real-alponzo wants to merge 1 commit into
Conversation
…LPC crash Keep real compute shaders (Mode::Compute in recomp/mod.rs and compute in dxil/kernel.rs) on the single-budget loop counter instead of per-region multi-PHI budgets (VAR_BUDGET_OWNER / VAR_BUDGET_TOTAL), preventing amdxc64.dll+0xd2a411 null-deref crashes on RDNA2 (xcl-dev#2874) while preserving Mode::Kernel for unit tests. Verified live on RX 6800 (driver 32.0.21045.29003): 0 driver crashes past 279 s (previously crashed at ~157 s on cs-2e0055c25f49848a, cs-6e148dbd563de205, cs-62b584e061c05fc5). Assisted-by: Antigravity (Gemini 4 Neon)
|
NVIDIA correctness check for the behavior #2793 added. I built the exact
The first count was correct in every case, and all 32 lane outputs matched. On direct DXIL the untouched word retained the initial OpenAI Codex assisted with verification. |
|
RDNA2 data and one test-coverage point, adding to @ettehn's measurement above. 1. The spin-wait tests stay green because they run in 2. RDNA2 title data on this question (RX 6800, driver 32.0.21045.5002, so a different driver from the description's 29003; same retail title; the details are in my #2874 comment):
The device loss is not clearly caused by the change, because 3. Lib suite on this head ( Title runs of this exact head: see the update below. AI use: Claude Code (Claude Opus 5.5) read the diff and tests, ran the suite through a local runner, and wrote this comment. The title numbers come from the runs referenced in #2874. Update: title runs of this exact head on the RX 6800 (driver 32.0.21045.5002, release,
Frames are 97 % of the base and peak commit is the same, within the limits. |
|
NVIDIA run (listed as untested), with an RX 9070 XT in the same PC: the PR changes no GPU test result on either card. Tested: head
No test changes result between base and PR on either card. The failures are the same with and without the PR, so they come from
This is RDNA4 and Ampere running the unit and GPU tests. It doesn't cover the LLPC crash on RDNA2 with retail shaders. Not tested: RDNA2, a title run, release, Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
First RDNA3 / native-Windows data for this head: no crash on either side, so this does not show the fix. Hardware: RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003, 64 GB RAM, Windows 11 Pro 10.0.26200, Rust 1.100.0, release builds. Unit test:
Longer title runs (480 s, scripted A presses every 8 s from t=16 s through the menu, 2 runs per side, alternating):
Not tested: in-world play, a base build that crashes on this setup, cold-cache runs (the compiler path that crashed on RDNA2), and the AI use: Claude Code (Claude Sonnet 5.5) built both revisions, ran the commands above on this machine and wrote this report. |
Keep real compute shaders (
Mode::Computeinrecomp/mod.rsandcomputeindxil/kernel.rs) on the single-budget loop counter instead of per-region multi-PHI loop budgets (xcl_bown/xcl_btotal), fixing theamdxc64.dll+0xd2a411(null dereference read at0x138) crash on AMD RDNA2 drivers during retail world load.Fixes #2874.
Why
00fe5aec(Recompiler: limit per-region loop budgets to compute and kernel shaders #2865) disabled per-region loop budgets on graphics/mesh stages to avoid AMD LLPC crashing on multi-PHI loop headers, but kept them enabled onMode::Compute.amd-dev@bf7c82eewith an AMD Radeon RX 6800 (RDNA2, driver32.0.21045.29003), three retail compute shaders (cs-2e0055c25f49848a/03f8856c87ce1c90,cs-6e148dbd563de205/5b2e76933254ac96, andcs-62b584e061c05fc5/4db60c607c5af7fb) still crashedamdxc64.dll+0xd2a411 (read at address 0x138)during world load (~157 s).Mode::Kernelenabled for unit tests) eliminated allamdxc64.dll+0xd2a411crashes completely: withdriver-crashes.txtcleared, the retail title ran for1454 s(~24.2 min) into the open world with0driver compiler crashes (driver-crashes.txtremained empty).What is in it
crates/xcl/src/gpu/recomp/mod.rsandcrates/xcl/src/gpu/dxil/kernel.rsto enablebudget_regions(&loops)only forMode::Kernel/kernel.gpu::recomp::tests::per_region_loop_budgets_are_compute_onlyincrates/xcl/src/gpu/recomp/tests.rsto assertMode::Kernelemitsxcl_bown/xcl_btotalwhileMode::Compute,Mode::Pixel, andMode::Meshkeep the single-budget CFG.Regression run
Base (
main):PR head (
bfb40311):Tested
rustc 1.100.0, DXC 1.9.2602.17.cargo test -p xcl --lib per_region_loop_budgets_are_compute_only -- --nocapture:1 passed; 0 failed; 0 ignored; 1693 filtered out..\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60on8b957becandbfb40311(blocks above).XCL_PREPARE=0,XCL_DEVICE_TYPE=lockhart, cleandriver-crashes.txt): ran1454 s(~24.2 min) with0amdxc64.dll+0xd2a411crashes (previously crashed at ~157 s on 3 compute shaders).Not tested
cargo test --workspaceonamd-dev(noteamd-devhas pre-existing no-GPU CI failures unrelated to this change).AI use
amdxc64.dll+0xd2a411crash from live RX 6800 logs, implemented the fix and test update, ran the test and paired smoke runs, and drafted this PR description.