Repository navigation
Recompiler: identify direct DXIL shaders for AMD drivers - #1
Closed
philip-roy-jones wants to merge 1 commit into
Closed
philip-roy-jones wants to merge 1 commit into
philip-roy-jones wants to merge 1 commit into
Conversation
The Radeon RX 580 driver exited while creating a pipeline from a validated direct compute shader. Emit the XCL producer in llvm.ident for each shader stage. The kernel now runs with the expected output and the direct vertex and pixel shaders draw the reference triangle. Assisted-by: Codex (GPT-6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The upstream review is in ivall/xcl#1471. It contains the same fix commit,
2146140, stacked on xcl-dev#1426.Part of xcl-dev#1269. This is a one-commit fix for the direct-DXIL branch in xcl-dev#1426.
On the Radeon RX 580, Microsoft's validator accepted the direct compute kernel, but creating its pipeline terminated the test process in
amdxc64.dll(0xc0000005). The HLSL reference ran on the same card. Adding the LLVM producer metadata lets the direct kernel run and return the expected values. @Sr-0w reported the same metadata requirement for the assembly path on RDNA3. Original findingWhat is in it
gpu/dxil/shader.rsemits!llvm.identwith producerXCLin the shared shader constructor. The regression ingraphics_tests.rschecks the referenced metadata node in compute, vertex, pixel and mesh disassembly. The README documents the opt-in switches.Tested
2146140bbc7c8cd022714c3c40d023875b74ee36, Radeon RX 580 (driver 31.0.21925.1001, native wave64), Ryzen 7 7700X, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, DXC 1.9.2609.5. Debug tests and release smoke builds.cargo test -p xcl --lib gpu::dxil:: -- --test-threads=4 --nocapturereported 66 passed, 0 failed, 2 ignored. 17 of the passes were hardware skips (15 wave32, 2 mesh). The direct compute kernel returned the expected buffer, and direct VS/PS drew the reference triangle. The new metadata check failed on the parent and passed here.XCL_DIRECT_DXIL=1,cargo test -p xcl --lib -- gpu::recomp::tests::gpu_divergence_through_exec gpu::recomp::tests::gpu_scalar_loop_and_scc --exact --test-threads=1 --nocapturereported 2 passed, 0 failed, 0 ignored.cargo build --workspacesucceeded.cargo test --workspace --no-fail-fast -- --test-threads=4lost its library test process. Running the 514 unreported library cases separately completed the inventory. Across the workspace, 795 reported passing, 21 failed, 1 crashed and 43 were ignored. 19 of the passes printed hardware skips (15 wave32, 4 mesh). All 22 unsuccessful tests also failed individually on the clean parent065aef3, including the process exit ingpu_wave64_ps_whole_wave_reductions..\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouchedpassed locally with DXC 1.9 and hardware adapter selection disabled. It reported 816 passed, 0 failed, 43 ignored and 1 filtered. 231 passes were explicit skips. A timer assertion failed during a concurrent run and passed on the isolated rerun. With the installed Windows SDK DXC 1.8.2502.11, the library test process exited indxil.dllon both the parent and this head.pso::console_to_dxil_inwith four memory windows and fresh XCL caches, in HLSL/direct/direct/HLSL order. It selected the first four distinct native-wave64 CS records with 64–4096 input bytes (156–2916 bytes observed). Validation and pipeline creation were outside the timer.Regression run
scripts/smoke.ps1 -Game <retail folder> -Xcl <release exe> -Seconds 60with the same RX 580,XCL_DIRECT_DXIL=1and separate empty XCL caches. Both processes exited early with0xc0000409. The smoke helper recorded no final frame total. Repeating both runs with Windows SDK DXC 1.8 andXCL_DIRECT_DXIL=allproduced the same exit on both revisions. The WARP software renderer reported device removal on both.Upstream main
PR head
Not tested
AI use