D3D12.X: XCL_QUEUE_NO_TIMEOUT, and a line per title command queue #3674
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3674"
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?
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-12-02T05:54:49Z.
Requested by Prime
Open-world runs of a game title on an RTX 3060 Ti 8 GB ended with
DXGI_ERROR_DEVICE_HUNGat the same place in the game in two runs. The direct queue and three async compute queues had been on one frame for 2.4-3.4 s, local video memory was 0.4-1.2 GB over its budget, and the async queues' service p99 was already 2.2 s the minute before. This looks like work that runs past Windows' 2 s GPU timeout while memory pages, not a translator bug. The new switchXCL_QUEUE_NO_TIMEOUTmakes the title's compute queues (or its direct and compute queues) withD3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT, so Windows lets that work finish instead of removing the device. It is off by default. Each title command queue now also gets one log line at creation: its type, priority, console and PC flags, and whether its GPU timeout is on.Related: #3260 changes how
CreateCommandQueueX(#48) reads the console's queue desc and splitscreate_command_queue_x; the two will conflict, and the switch should apply on top of whichever desc translation lands. #2748 logs when a device hang was Windows' GPU timeout; this one is a way around it.What is in it
crates/xcl/src/hle/d3d12x/device_x.rs:XCL_QUEUE_NO_TIMEOUT(read and logged once) addsDISABLE_GPU_TIMEOUTto the PC desc of compute, or direct and compute, queues; copy queues never. A log line per title queue (first 32). Unit tests for the parsing and the flag.Tested
1c8b5514):cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnupasses. The test suite was not run on this exact branch.Regression run
Not tested
scripts/smoke.ps1on this branch; AMD.Switches
XCL_QUEUE_NO_TIMEOUT: default unset (0): queues get the GPU timeout the console asked for.compute: compute queues have no GPU timeout.all: direct and compute queues have none.=0is the same as unset.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:17:54Z.
Review (head
11fdcfd8, diff read, not a merge-check; checks red):PR checksrefuses it because Regression run has noxcl-smokeblock on head11fdcfd830and none on a commit of main. Tested also has no suite counts: onlycargo checkfor the gnu target, while CONTRIBUTING asks forcargo test --workspaceon a GPU with the real counts.pc_queue_desc(crates/xcl/src/hle/d3d12x/device_x.rs~76, already on main) passes the console's bit 0 through as PCDISABLE_GPU_TIMEOUT. So a compute queue that the title makes with flags 3 (the commit message says the retail game uses 2 or 3) already has no GPU timeout on main, andcomputedoes nothing for it. The description also says the direct queue q0 was stuck for 2.4-3.4 s, andcomputeleaves q0 with its timeout. Nothing yet shows which of q0/q1/q3/q4 lacked the flag. The new per-queue line answers that, so the motivation should be checked against it before this is presented as the fix for that hang. "Whether the switch on its own gets past the hang" is rightly listed under Not tested.create_command_queue_x(~162) returns theCreateCommandQueueHRESULT unchanged, so with the switch on, a failed create fails the title's queue instead of retrying without the flag. The flag value is the same one main already forwards from bit 0, so a failure is unlikely, but it is untested and only matters when the switch is on.XCL_WAIT_TIMEOUT_MS~351,XCL_DUMP_ON~427). A user-facing workaround that can freeze the desktop should be listed there with that warning. Right now it is only in the PR text.Fine: the default path is unchanged by reading. When the switch is unset/
0,with_no_timeout(.., AsAsked)returns the desc unchanged (unit-tested), the env var is read once throughOnceLock, and the only additions are one "off" line and the queue line. The queue line is logged only when a queue is created, capped at 32, and the string is built only when it is logged, so it does not touch the hot path. Copy queues are never changed. A nulldescbehaves as before. Compared with #3673: that PR is the progress-fence diagnostics that produce the service-time numbers quoted here. It touches different files (gpu_progress.rs,list_x.rs,watch.rs), merges cleanly with this one, and the two are complementary, not duplicates.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:38:04Z.
Test report (not a merge-check:
PR descriptionred)base:
1c8b551475head:
11fdcfd830merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2909 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3674#issuecomment-7340674393 and its findings stand. Most serious: main already passes the console's bit 0 through as
DISABLE_GPU_TIMEOUT, so the switch may not affect the queues that hung.performance: 60 s smoke of a retail title, main
1c8b5514vs this merge (11fdcfd8): 1652 -> 1674 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 17287 MB, 0 device removals, 0 crashes.assessment: merges, builds and passes the whole suite on current main, and the smoke run is clean; the blocking point is in the review: main already passes the console's bit 0 through as
DISABLE_GPU_TIMEOUT, so the switch may not affect the queues that hunghardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T15:57:54Z.
merge-check
base:
16c2fd082ahead:
11fdcfd830merge: clean
build: ok
tests: 3012 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 3 medium, 2 nits (below)
performance: 60 s smoke run: 1683 → 1647 frames (97 % of main), peak commit 18505 → 17819 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 231 s there, 0 device removals, 0 crashes, 2.7 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet:
PR descriptionis red; otherwise no blocking finding, the suite passes and the smoke run is cleanhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: Adds an opt-in XCL_QUEUE_NO_TIMEOUT that makes the title's compute queues (or direct and compute queues) with DISABLE_GPU_TIMEOUT, plus one log line per title queue. The head has not changed since my earlier review: the default path is unchanged and nothing in the code blocks it. Still open: the switch may not touch the queues that hung, and the README is not updated.
Medium
computechanges nothing for it. The direct queue that was also stuck for 2.4-3.4 s keeps its timeout undercompute. Use the new per-queue line from a hanging run to show which queues lacked the flag before presenting this as the fix for that hang.Nit
async(as compute) and1andon(as all), and any other value quietly means off (it is only logged). The description documents onlycompute,alland0. Document the extra values or drop them.Checked and fine
How this was tested
16c2fd08, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main16c2fd08and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.