D3D12.X: XCL_GPU_WAIT_RELEASE_MS sets when a stalled GPU wait is released #1046
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!1046
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1046"
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?
@papasmurph0 on GitHub · 2026-11-24 10:49 UTC · original
papasmurph0:gpu-wait-release-ms→main· +24 −2 · 1 files · 1 commits · closed without mergingPart of #505.
A
Wait64BitValueXbridged to a GPUqueue.Wait(#795) is released on the CPU after a fixed 5 s (GPU_WAIT_WATCHDOG_TIMEOUT) so a GPU cycle cannot hang the queue. On an NVIDIA GPU the producer is often only late, not stuck: the console list that writes the value is still being translated, held by the driver's build of a big compute pipeline. For the retail title of #505 at its world load those builds took 2 – 115 s each here. The release then lets the waiting compute queue run on memory the producer has not written yet.XCL_GPU_WAIT_RELEASE_MS=<ms>(above 0) replaces the 5 s. Unset, nothing changes.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs:gpu_wait_watchdog_timeout()/release_after(), read once likeXCL_WAIT_TIMEOUT_MSnext to it; the sync watchdog and its log line use it. Test:a_gpu_wait_is_released_after_xcl_gpu_wait_release_ms_or_the_default.Tested
cargo test --release --workspace -- --test-threads=4: 728 passed, 0 failed, 41 ignored (XCL_DXC_DIRset). SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64). The new test also passes on its own.mainbeaa245+ open PRs, every dispatch run – no skipped dispatches – and a local change that keeps the title's own watchdog from ending the process), before and after setting the variable:GPU queue.Wait at 0x704180158 >= 0x4e1 did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(1)/tySome(0), recorded=0x4e1, submitted=0x4e1, completed=0x0) – released on CPU, thenD3D12 device removed: 0x887a0006.XCL_GPU_WAIT_RELEASE_MS=180000: no device removal through the same phase while the driver finished builds of 70 – 115 s.This is not a measurement of
main+ this PR alone: onmainthe title's own watchdog ("GPU Loc Sig") ends it in that phase first.Regression run
main:
this PR:
Not tested
mainrun of the same title ended in an early assert (0x80000003) before its first frame; themainblock above is the run after it.AI use
https://claude.ai/code/session_01SEW8zXNUmMq1tRUZpstWXS
@Aniseto on GitHub · 2026-11-24 11:11 UTC · original
Ran the new watchdog test and the whole
list_xunit set atb3351c0: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.
The default and
XCL_GPU_WAIT_RELEASE_MSpaths behave as described here. 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 next to the author's run.Not tested: a retail title or
scripts/smoke.ps1(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.
@DavidM1911 on GitHub · 2026-11-24 11:24 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
cargo test -p xcl --lib wait: 14 passed, 0 failed — includes the newa_gpu_wait_is_released_after_xcl_gpu_wait_release_ms_or_the_default.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@tiagonleal on GitHub · 2026-11-24 14:34 UTC · original
Windows / NVIDIA retail test of
b3351c069c, merged ontomain47efa2e+ #684 + #1124 (clean here, treef882c7c).Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4(debug) onf882c7c: 746 passed, 0 failed, 41 ignored. SKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A, the same build alternated with and withoutXCL_GPU_WAIT_RELEASE_MS=60000, warm DXIL / driver-blob caches (few compute builds over 5 s by now):XCL_GPU_WAIT_RELEASE_MSqueue.Wait … released on CPU0xc0000005ingame+0x4684e7(read at0xfd3fd1574), 121.3 s+0x23cf683write at 0x0, 136.5 sD3D12 device removed: 0x887a0006, 131.0 sD3D12 device removed: 0x887a0006, 124.5 sNot tested: other values; more runs (two each, and runs of the same build vary a lot here: the same tree without this PR reached 200 s twice and 132 s once earlier); AMD / Intel.
Run and written with Claude Code (Claude Opus 5.5).
@imnicho on GitHub · 2026-11-24 19:17 UTC · original
A measurement for the same problem, with a variant that needs no setting: the watchdog does not count the time in which a bind is waiting for a pipeline (
pso_async::title_held(), from #1288).Tested
mainb7aa9f3+ #266 + #684 + #1288 + #1316 / #1448, heap windows on, plus a local change of 9 lines inlist_x.rsbehind a local switch: whiletitle_held()is true, the watchdog's poll movesarmed_atof every armed wait on by the time polled.XCL_NETWORK=0, scripted pad, binds waiting (noXCL_PSO_WAIT_MS), 330 s runs of the same executable with the switch off and on, in turn, 2 rounds, on a cache that has the pipelines up to that point as driver blobs.Wait64BitValueXbridged toqueue.WaitIf you would like that in this PR, in place of the setting or beside it, I can send the diff. Otherwise I would open it as a small PR of its own once #1288 is in, since it needs
title_held().Not tested
XCL_PSO_WAIT_MS(there a bind waits 50 ms at most, so this rule hardly applies), AMD, Windows 11.AI use
@papasmurph0 on GitHub · 2026-11-24 19:56 UTC · original
Thanks all for the runs.
@imnicho: your variant is the better fix. It keeps the release where it helps and stops it exactly when the producer is only held by a bind, with no setting to tune. Please open it as its own PR once #1288 is in. I'd rather not fold it in here, since it depends on
title_held(). If it lands, this setting becomes a diagnostic knob at most, and I'm fine with closing this PR in its favour.@tiagonleal: "the producer is stuck rather than late" matches what I see on an RTX 4080 SUPER with the retail title, once the big compute pipelines come from driver blobs. In the last run here (local tree, every compute PSO the title had used before loaded from disk), the stall at ~1,320 presents was a title thread inside
CreateComputePipelineState, compiling one of the title's screen-probe programs in the driver. Those translate to 14–29 MB of DXIL here: one is 72 KB on the console, with 76,699 instructions and 1,377s_getpc/s_setpcpairs. Meanwhile the GPU sat idle (2–3 %) and the process commit rose from 33 to 65 GB within ~5 minutes. The waiting compute queues' producer list can't be submitted until that compile ends, so no release timeout short of the compile time resolves it.AI use: Claude Code (Claude Opus 5.5) ran the runs on my PC and wrote this comment; I asked for it to be posted.
Pull request closed