Skip to content

Direct DXIL (nvidia-dev): one-wave split compute groups spin at every exchange because of #1727, whose barrier cause was disproved #3114

Backlog

Description

@afpruivo

On nvidia-dev, the direct translator meets the two halves of a one-wave split compute group (33–64 threads) through the counter exchange instead of a group barrier, and that costs one retail program 2.6x its GPU time (8.4 → 3.3 ms a frame on an RTX 3090). The reason given for the counters is #1727's GPU hangs, but #1727 was later bisected to the sparse VRAM test (#614), and in 16 parallel test runs here barrier meets did not hang.

Where it comes from

Measured (RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release; tree nvidia-dev 54225f58 + #609 + #2551 + local profiling hooks)

A local switch gives a compute group of one console wave Partner::Present (group barrier) again. It also keeps such a group's lanes past a thread limit in, with their EXEC bits clear (compute_gate without leave), so neither half can leave before an exchange. The per-lane bridge form (recomp::lower_dxil) keeps the counters, since one half can be in a block alone there. Mesh programs are not changed.

  1. Hangs: cargo test --release -p xcl --lib -- gpu --test-threads=4 with XCL_DIRECT_DXIL=1, the two arms interleaved, 16 runs each: 0 hangs or device removals in either arm. With barriers, the same 7 tests fail in every run, all of them assertions of the counter form (a_single_split_wave_of_a_compute_group_exchanges_without_a_group_barrier, split_lds_reads_meet_after_writes, a_split_wave64_compute_program_stays_whole, three dispatch_chain_* "stays whole" checks) and a cache test the switch bypasses. All other GPU tests passed, including gpu_compute_thread_limits_leave_the_lanes_past_them_out. (A separate abort, "coherent window could not be restored … error 487", hit both arms in some runs of a first batch; it is not related to this.)
  2. Retail title, 700 s each, no crash or device removal, XCL_GPU_TIMES=16,420 (16 frames from 420 s), same inputs:
b78fa10b425b8e54 (CS_DepthProcessingHBO, 160x90 groups, split in halves) all programs split-halves programs frame (wall)
counters (nvidia-dev today) 8.4 ms 159.1 ms 51.7 ms 144.7 ms
group barrier 3.3 ms 155.9 ms 45.6 ms 147.3 ms
HLSL form (for reference) 3.2 ms 145.9 ms

The program's direct DXIL with counters has 137 spin exchanges (an atomic add, a wait loop of atomics and two fences each); with the barrier it has 269 group barriers, and its DXIL shrinks from 126 KB to 89 KB. The frame time does not move: on this tree other work bounds the frame, so this is GPU time freed, not frames gained yet. The remaining ~46 ms in split programs are mostly groups of several console waves, which need the counters (C22 on #3011 is about those).

Suggestion: give one-wave split compute groups the group barrier again on the direct path, as the HLSL path has, with the early-leave guard above and the counter-form tests changed to match. I have not opened a PR; I can, if this direction is wanted. The direct exchange also meets twice per exchange where the HLSL one meets once (double-buffered slots), which could halve the barriers again.

Not tested: Blackwell (#1727's hangs were on RTX 5070 / 5060 Ti) and other NVIDIA cards; AMD with the split form forced; output equality in play (the picture is black on this tree); mesh programs; the retail driver time-out 1be95b1b's message also mentions (I saw none in this run).

AI use: Claude Code (Claude Opus 5.5) wrote the local switch, ran the tests and the runs, and drafted this issue; I checked the numbers against the logs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions