D3D12.X: XCL_GPU_CULPRIT names the dispatches a stalled queue has not done #1323
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1323
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1323"
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?
@IvyNotFound on GitHub · 2026-11-24 14:46 UTC · original
IvyNotFound:gpu-culprit→main· +297 −1 · 6 files · 1 commits · openDiagnostics only, off by default. Part of #505.
When the GPU-wait watchdog releases a wait, its lines (and #1123's chain line) say which queues wait on which, but not what the GPU is running at that point. @larelgit measured the GPU at 100 % during these stalls on #505, so something executes and does not end. With
XCL_GPU_CULPRIT=1, XCL marks every dispatch it records and logs, at the release, the dispatches that started and are not done, with their console compute shader.How: around each dispatch the list writes a running number into a readback buffer with
WriteBufferImmediate,MARKER_INbefore andMARKER_OUTafter, one pair of words per PC list. A list whose last number in is above its last number out has work that started and is not done. The dispatches between the two are logged with the console CS (fnv64of the title's CS bytecode, the name of its file indxil\translated), the PC pipeline and the groups. Once per burst of releases, 4 s apart, 8 times at most. DRED breadcrumbs would give the op in flight on a device removal. But with DRED on, the driver did not take its cached pipelines here: a 1.99 MB compute pipeline took 153 s to build, and the retail title never got past its start.What is in it
crates/xcl/src/hle/d3d12x/culprit.rs(new):enabled,note_compute;before_dispatch/after_dispatch(the markers);slot_forgives each PC list a slot, and none once the buffer's 16 384 slots are taken (the list is then not recorded, so no slot past the buffer is ever read);open_lists/not_done(what is in flight);on_watchdog_release(the log).a_list_with_a_marker_in_above_its_marker_out_is_open,a_list_past_the_last_slot_gets_none, and the GPU testgpu_markers_of_a_finished_list_match.bind.rs: markers aroundDispatchand around theExecuteIndirectof a translated compute pipeline.console_list.rs: markers around a console-recorded dispatch.real.rs:CreateComputePipelineStatenotes the console CS of the pipeline it returns (the old body is nowcreate_compute_pso, unchanged).list_x.rs: the watchdog callsculprit::on_watchdog_releaseafter its release lines.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4ata79d09d(rebased ontomain9e3831e) withXCL_SAMPLE_RPF,_DLLS,_TTPF,_BVH4,_BK2,_AWCset: 779 passed, 0 failed, 41 ignored;SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).gpu_markers_of_a_finished_list_matchran on the RTX 5080.scripts/smoke.ps1,XCL_PRESS_A_AT=15:main9e3831eand this heada79d09d);XCL_GPU_CULPRIT=1andXCL_PSO_WAIT_MS=50(into world loading) atc30f414(this commit before a change to how an indirect dispatch is labelled in the log). The markers were on from 7.1 s. At the first release (106.9 s), 3 of 358 lists had dispatches started and not done, e.g.#27175: cs b78fa10b425b8e54, pipeline 0x13a997ac0, groups 160x90x1. At the next release (114.3 s) the same three were still open. The run ended in the title's0xc0000409at ~124 s, as somemainruns of this title do (https://github.com/ivall/xcl/issues/505#issuecomment-7130913073). No device removal.main47efa2e(posted on #505: https://github.com/ivall/xcl/issues/505#issuecomment-7132618087) named, at each stall, one list with a run of 1-D dispatches of one CS whose first never finished, e.g. CSb6043104de672057, 16x1x1, then 7 more of it; another run CS2c83ffd798d07451, 4355x1x1, then 13 more.Regression run
main:
this PR:
Not tested
WriteBufferImmediatethere)WriteBufferImmediateper dispatch)AI use
🤖 Generated with Claude Code
@Aniseto on GitHub · 2026-11-24 14:52 UTC · original
Ran the new
culpritmodule tests at7fa2ade:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
a_list_with_a_marker_in_above_its_marker_out_is_openandgpu_markers_of_a_finished_list_matchpass. These are unit-level tests, so the adapter is not the variable; the datapoint is the Windows 11 build 26200 / MSVC 14.44.35207 / DXC 1.9.2609.5 toolchain.Not tested: the diagnostic against a real stalled queue (no unpacked title here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.
@futurepro62 on GitHub · 2026-11-24 14:56 UTC · original
Full-suite run on NVIDIA and AMD to go with the
culpritcheck above. Tested exact head7fa2ade(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.a_list_with_a_marker_in_above_its_marker_out_is_open,gpu_markers_of_a_finished_list_match.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 15:18 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 707-709 passed, 0 failed, 21 ignored.Thanks!
@Mischief8713 on GitHub · 2026-11-24 15:55 UTC · original
GPU run of
7fa2adeon Windows (NVIDIA GTX 1660 Ti, Turing): 709 passed, 0 failedTested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64)mainat930e8b4on the same machine: lib 707 passed, 0 failed, 21 ignored;e2e3 passedmain.hle::d3d12x::culprit::tests::gpu_markers_of_a_finished_list_matchanda_list_with_a_marker_in_above_its_marker_out_is_openran and passed. Earlier reports on this PR are Blackwell only, so this adds Turing.Not tested
scripts/smoke.ps1run, so no regression runXCL_GPU_CULPRITset was not exercised, since that needs a titleAI use
@crosettiremi on GitHub · 2026-11-24 16:54 UTC · original · edited 2026-11-24 17:00 UTC
I exercised the dispatch marker fixture on Windows with an RX 7900 XT on a downstream XCL stack carrying 7fa2ade. The readback buffer was created and the completed list's marker-in and marker-out fixture passed.
I also tested bounded slot registration locally. At capacity, existing lists keep their slot and a new list receives no slot. This keeps the slot registry consistent with the readback buffer's capacity when later diagnostics enumerate it. The focused module with that additional check passed all three tests and the release build completed. The game runs that motivated this check reported a partly executed command list with Dispatch next in DRED. I haven't attributed those hangs to a specific shader.
Hardware follow-up with the markers enabled and the same saved profile: the log confirmed marker initialization. The game was still presenting in the 116.1 s sample and then terminated on the title's write to zero at +0x23cf683. No device removal or watchdog-release marker report was recorded in this run, so it did not identify a stalled dispatch.
@IvyNotFound on GitHub · 2026-11-24 17:53 UTC · original
Thanks @crosettiremi, you were right about the slot bound: once the 16 384 slots were taken, a new list was still put in the map with a slot past the buffer, and the next watchdog report would have read it. Fixed in
a79d09d(squashed into the PR's commit, rebased ontomain9e3831e):slot_forgives a new list no slot when the buffer is full and leaves it out of the map, and the lists that have one keep it. Testa_list_past_the_last_slot_gets_none.At
a79d09don an RTX 5080:cargo test --workspace --no-fail-fast -- --test-threads=4779 passed, 0 failed, 41 ignored; the new runs are in the description.AI use: Claude Code (Claude Opus 5.5) wrote the fix, the test and this reply, and ran the tests and the runs.
@not-rex on GitHub · 2026-11-24 23:19 UTC · original
RTX 3080 (10 GB, driver 610.88), retail 1.0.2.1 into the world with
XCL_GPU_CULPRIT=1: one stalled dispatch named, an indirect CS.Tested: this PR at
a79d09d3merged onto9e3831e1+ #1123 + #1254 (diagnostics), release, warm DXIL cache and save,XCL_PSO_WAIT_MS=50, A at 30 and 40 s, 400 s.#101at 87.8 s, 28 presents after it (last at 126.1 s), 12GPU queue.Wait … 5000 mstimeouts (first at 130.7 s), 10 cycle breaks; the title's watchdog (+0x23cf683) at 178.4 s; peak commit 32.6 GB.0x15e270a1a0: marker in #19676, last marker out #19675". The one dispatch is cs18567a5f0145bde9, indirect, up to 1 dispatch.50625695d2e6cbe7,206ed63b96be21a1); neither hash appears in this run's log.On this card the stall also goes away when split-wave64 compute and mesh programs are refused (#505, comment 7142113187), so
18567a5f0145bde9is likely a split-wave64 program, though I haven't confirmed that from its code.Not tested: more than one run; without
XCL_PSO_WAIT_MS.AI use: Claude Code (Claude Opus 5.5) ran the run on my machine through a scripted runner and wrote this report.
@DavidM1911 on GitHub · 2026-11-26 04:53 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.