Wave64 -> Wave32 Fix for NVIDIA RTX Cards (6b82bc7d22016cb5 & a10179ab7eda0dc3)

Context:
NVIDIA RTX GPUs only execute 32-lane waves (Wave32) and reject any DXIL compute
shader that requires WaveSize(64) with E_INVALIDARG (0x80070057) at PSO creation.
In VIctory's shader translator (crates/victory-shader/src/emit/lower.rs), most
GFX10 Wave64 compute programs already lower cleanly to paired 32-lane host waves.
These two hashes fail for two different reasons, and each has a clean fix:


1) a10179ab7eda0dc3 (64-thread group, LDS read + write inside divergent branch)

Why it fails:

  • Runs 64-thread groups with an LDS read and write inside a single divergent
    lane branch region (15 branches), so lds_meetings() rejects splitting it across
    two 32-lane waves without risking a barrier hang.
  • Same shape as sibling 64-thread shaders:
    5e3dd99e0f067aee, ae0deeafe219c15c, 57f1b81de55c2842.

How to fix:


2) 6b82bc7d22016cb5 (1024-thread group, CS_CollectTriangles_Meshlets class)

Why it fails:

  • Runs 1024-thread groups AND already uses the full 32 KiB D3D12 group shared
    memory (LDS) budget.
  • When lower.rs tries to append its paired 32-lane exchange slots and wave
    counter into LDS, total LDS exceeds D3D12's 32 KiB hardware limit, so
    CreateComputePipelineState fails with 0x80070057.
  • Placing a full group barrier inside s_cbranch_execz also hangs other waves.

How to fix:

  1. Spill the wave exchange slots and wave counter out of LDS into a scratch root
    UAV (e.g. u251) so group shared memory stays within D3D12's 32 KiB limit.
  2. Open the s_cbranch_execz divergent lane branches around those exchange regions
    so both 32-lane halves of each console wave enter together and sync with a
    paired half sync (no full group barrier inside the branch).

Quick Verification Tip:

  • Run with VICTORY_WAVE_WHY=1 to print the exact reason any remaining Wave64
    program refused Wave32 lowering (group size, LDS usage, and blocking ops).
  • Validate emitted DXIL and run: cargo test -p victory-shader
Edit

Pub: 28 Nov 2026 16:08 UTC

Views: 325