RDNA 4: a raw view's size asked through a handle of its own (amdxc64.dll+0x861b9f) #357
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!357
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-357"
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?
@DTsordas on GitHub · 2026-11-26 18:21 UTC · original
DTsordas:fix/rdna4-raw-size-handle→main· +99 −4 · 6 files · 1 commits · openFixes the AMD shader compiler crash on RDNA 4 reported in #8, #44 and #60, with a smaller change than #55, and only on RDNA 4 hosts. That answers the two points #55 was left open for: it does not conflict with main, and it changes nothing for other AMD cards.
The cause
AMD's compiler faults in
CreateComputePipelineState(amdxc64.dll+0x861b9f, a read of0x8) on a program where a raw buffer'sgetDimensionsand a load from that same buffer get their handles from the same index value.I narrowed one of the crashing programs (
bvh_skinning:CSComputeTreeAnim,a567b9ef845fb680) down by cutting parts out of it and handing each version to the driver. The rest pointed the same way:udivthat turns bytes into records,waveReadLaneFirston the size, andDisableOptimizationsall made no difference.NonUniformResourceIndexon the second handle. Anor 0on the index is no help either, because the driver folds it away.VICTORY_SHADER_OPTbit 4) merges equal index computations, so it creates more of these programs. That explains whyVICTORY_SHADER_OPT=59helped some cards and not others.size_tests::the_record_count_of_a_structured_buffer_read_by_indexis a minimal repro. On unmodified main it kills the test process on an RX 9060 XT.The change (99 lines, 6 files)
descriptor_dataasks a raw view's size through a handle of its own. Its index is computed again and kept out of the clean-up passes (Module::mark/keep_since, whichopt.rshonours), and the handle is markedNonUniformResourceIndex. No value changes, because the index is uniform. A waterfall's per-lane handle is left as it is, since it is marked already.0x7550..=0x75ff(Navi 48: RX 9070, 9070 XT, Radeon AI PRO R9700; Navi 44: RX 9060 XT). RDNA 3 lies below that range (0x744cis the RX 7900 XTX). The adapter log line now showsrdna4=.VICTORY_RAW_SIZE_HANDLE=1/=0turns it on or off on any host, for example for offlinetranslateruns, which open no device. The shader cache keys on it as a fifth host setting (host_settings).size_testsalways use the new form, because their size reads run on the host's GPU.nonuniform_handles, which counts per-lane accesses, so the waterfall tests are unchanged.Tested
RX 9060 XT 16 GB (gfx1200,
0x7590), Ryzen 5 5600X, 64 GB, Windows 11. Drivers 32.0.32015.7029 (26.10.1) and 32.0.32029.2010 (26.11.2). Diagnostics build ofc9c932cplus this commit.translate --pipelinesover every shader of the title, one hash prefix per processCS_RaytracingResolve, plus 4 tree-animation programs (bvh_skinning×3,GpuParticleUpdate:CS_UpdateSkinnedAttachMeshTreeParticles) that fault at everyVICTORY_SHADER_OPTsettingVICTORY_RAW_SIZE_HANDLE=0the_record_count_of_a_structured_buffer_read_by_index0xc0000005)cargo test -p victory-shadervictory warm --used(with and without the renderer patches)play.ps1with and withoutVICTORY_PORT_*rdna4=truecargo clippy --workspace --all-targets --all-features -- -D warningsfails on main without this change too (descriptor_sites.rs:277,watch.rs:3626).victory-shader, where most of this change lives, is clean.I did not test on RDNA 3 or NVIDIA. There, the translation is the same as before unless
VICTORY_RAW_SIZE_HANDLE=1is set.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.