Repository navigation
D3D12.X: XCL_GPU_WAIT_RELEASE_MS sets when a stalled GPU wait is released - #1046
papasmurph0 wants to merge 1 commit into
Conversation
…ased A Wait64BitValueX bridged to a GPU queue.Wait is released on the CPU after GPU_WAIT_WATCHDOG_TIMEOUT (5 s) so a GPU cycle cannot hang the queue. On an NVIDIA GPU the producer is often only late: the console list that writes the value is still being translated, held by the driver's build of a big compute pipeline (2 - 115 s each for the retail title of xcl-dev#505). The release then lets the waiting compute queue read memory the producer has not written yet. Measured on an RTX 4080 SUPER with the retail title of xcl-dev#505 at its world load, every dispatch run (no skipped dispatch): with the 5 s release, "GPU queue.Wait ... did not complete within 5000 ms (... completed=0x0) - released on CPU" was followed by device removal (0x887a0006); with XCL_GPU_WAIT_RELEASE_MS=180000 the same phase had no device removal while the builds finished (70 - 115 s). The default stays 5 s; a value above 0 replaces it. Assisted-by: Claude Code (Claude Opus 5.5)
|
Ran the new watchdog test and the whole 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 Not tested: a retail title or 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. |
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Windows / NVIDIA retail test of Tested
Not 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). |
|
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 ( Tested
If 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 Not tested
AI use
|
|
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 @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 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. |
Part 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