Repository navigation
VS / PS: the 32-lane form on every GPU that can run 32-lane waves (RD… - #155
Conversation
…NA2) D3D12 has no WaveSize for graphics shaders, so the driver picks the wave size of a wave64 VS / PS. On an RX 6600 XT (RDNA2, reports 32-64 lanes) the driver runs pixel shaders in waves of 32, but `wave32_only()` is false for a 32-64 range, so VS / PS did not get the `upper_lanes` form and `v_readlane` 32 wrapped to lane 0: gpu_wave64_ps_whole_wave_reductions summed twice (928 vs 464), issue #42. `pso::graphics_wave32` (range includes 32) now decides the split flag for VS / PS at PSO creation (plain, mesh and GS pipelines' PS), in the test runner and in `xcl shaders --precompile`; compute, mesh and geometry programs keep `wave32_only`. The form checks the wave size at run time, so a driver that picks 64 lanes is unaffected. Tested on an RX 6600 XT (driver 32.0.21045.29003): cargo test --workspace, 569 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FSrXQbQ1CgygrnUUsgR2st
bb96e89 to
fc4b2d4
Compare
|
tested this on my rtx 4080 super (driver 621.24). built main (956a476) and the pr (fc4b2d4) separately and ran the same tests on both, with XCL_SPLIT_WAVE64 unset. all three wave64 gpu tests passed on both builds (ps reductions, ps spill slots, vs spill slots/identity). the reduction test reported 32-lane waves in both cases, and the wave path selection unit test passed too. so far no regressions on my nvidia setup, at least in these tests. can't say anything about the original rx 6600 xt issue though. |
|
Tested on RDNA3: AMD Radeon RX 7800 XT (16 GB, reports 32–64 lanes), driver 32.0.32015.7029, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17 (SDK 10.0.26100.0). The RX 6600 XT failure reproduces on RDNA3 and this PR fixes it:
* The remaining failure is So on RDNA3, as on RDNA2, the driver runs wave64 pixel shaders in 32-lane waves. Gating the VS / PS form on |
|
tested this on my rx 7800 xt (driver 32.0.32029.2010, windows 11 build 26300.9974) and can confirm the same failure: 928 vs 464 on main (956a476), twice. with XCL_SPLIT_WAVE64=1 the test passes. |
|
Thanks @Vencite, @TheHoracio and @CodeByCon for testing. Summary so far:
So RDNA2 and RDNA3 both run wave64 PS in 32-lane waves despite reporting 32–64; the fix applies there and leaves NVIDIA unchanged. Still rebased on current |
|
Merged (main 2abc562). The conflict with lazy pipeline creation, now on main, was resolved: the |
On an RX 6600 XT (discrete RDNA2, reports 32–64 lanes) the driver runs wave64 pixel shaders in 32-lane waves, so
gpu_wave64_ps_whole_wave_reductionsfailed:wave32_only()is false for a 32–64 range, VS / PS did not get theupper_lanesform, andv_readlane32 wrapped to lane 0 (the sum doubled: 928 vs 464). Details in #42.Change:
pso::graphics_wave32(the adapter's range includes 32) now decides the split flag for VS / PS:real.rs: plain VS+PS pipelines, and the PS of mesh and GS pipelinesrunner::split_for,on_gpu) and the spill-slot tests' expectationsxcl shaders --precompile, so its cache keys match the runtime'sCompute, mesh and geometry programs keep
wave32_only(they set[WaveSize(64)]). Theupper_lanesform checksxcl_hw32at run time, so a driver that picks 64 lanes runs the program as before. On RDNA GPUs, wave64 VS / PS with constant or slot reads now get the 32-lane form's HLSL; 64-lane-only GPUs are unchanged. Doc:docs/wave64-on-wave32.md.Tested: RX 6600 XT, driver 32.0.21045.29003, Windows 11 23H2:
cargo test --workspace: 568 passed, 0 failed (before:gpu_wave64_ps_whole_wave_reductionsfailed; it passed only withXCL_SPLIT_WAVE64=1). Not tested on RDNA4 or NVIDIA.🤖 Generated with Claude Code