Skip to content

[upstream #1046] D3D12.X: XCL_GPU_WAIT_RELEASE_MS sets when a stalled GPU wait is released - #102

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1046
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1046

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Part of xcl-dev#505.

A Wait64BitValueX bridged to a GPU queue.Wait (xcl-dev#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 xcl-dev#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 like XCL_WAIT_TIMEOUT_MS next 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

  • NVIDIA GeForce RTX 4080 SUPER (driver 32.0.16.1088), Ryzen 7 7800X3D, Windows 11 build 26200, rustc 1.100.0 MSVC, release.
  • cargo test --release --workspace -- --test-threads=4: 728 passed, 0 failed, 41 ignored (XCL_DXC_DIR set). 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.
  • The retail title of Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub xcl-dev/xcl#505 at its world load, on a local tree (main beaa245 + 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:
    • 5 s release: 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, then D3D12 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: on main the title's own watchdog ("GPU Loc Sig") ends it in that phase first.

Regression run

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 4080 SUPER
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1305 (PresentX 1305)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 9015 MB

this PR:

xcl-smoke v1
commit: b3351c069c0750b87b0e4af394465ad59c6c0db7
gpu: NVIDIA GeForce RTX 4080 SUPER
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1231 (PresentX 1231)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 9337 MB

Not tested

  • AMD and Intel GPUs; Wine.
  • The default (unset) is unchanged, so the regression runs above only show that nothing else changed; neither reaches the world load in 60 s.
  • A first main run of the same title ended in an early assert (0x80000003) before its first frame; the main block above is the run after it.

AI use

  • Claude Code with Claude Opus 5.5: found the release in the logs, wrote the change, the test and this description; the runs were made on my PC.

https://claude.ai/code/session_01SEW8zXNUmMq1tRUZpstWXS


Mirror of xcl-dev#1046 (auto-synced, do not edit).

…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)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1046 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1046 branch November 25, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants