Skip to content

NVIDIA: ExecuteCommandLists to a compute queue behind a wait-before-signal GPU wait never returns; the driver recurses until the title thread's stack overflows #3526

Backlog

Description

@KOLESNiii

On NVIDIA, the retail game stops at world load: one ExecuteCommandLists on the title's submit thread never returns, the NVIDIA user-mode driver (nvwgf2umx) recurses inside it about 1,000 levels deep, and the title thread's 1 MiB stack overflows (thread '<unknown>' has overflowed its stack, exit 0xc0000005). It happens once per run, at the same point, on both the Series X and the Series S profile.

What the evidence points to (inference, not proven yet)

  1. At world load the title arms Wait64BitValueX waits on its four compute queues (q1–q4) for a value that the graphics queue (q0) signals only in a list the title has not submitted yet. XCL bridges each one to a GPU queue.Wait (wait-before-signal, try_gpu_wait in list_x.rs).
  2. The same title thread then submits more lists to one of the waiting queues. In the Series S run's dump the stuck call is the title's 16-list submission to q1, one of the queues blocked at that wait.
  3. Inside that call nvwgf2umx checks the free space of a command ring, finds too little, flushes, and the flush calls the same check again. The ring of a queue stopped at an unsatisfied fence wait never drains, so the check never passes and each level recurses deeper. The q0 list that would satisfy the wait is never submitted: the thread that would submit it is the one stuck in the driver.
  4. XCL's GPU-wait watchdog (XCL_GPU_WAIT_TIMEOUT_MS, default 5000 ms) would release the waits on the CPU, but wait_expired restarts every armed wait's clock while pso_async::title_held() is true. Since d4c6d34 that is true during any PC call of 250 ms or more, and since 52e9014 during build holds. In these runs the title is in pipeline waits during the whole window, and then in the stuck submit itself, so the watchdog never fires (also not with a 1 s timeout).

D3D12 allows waiting on a fence before its signal is submitted, so step 2 is legal API use; the driver blocking in ExecuteCommandLists instead of queuing the work is what turns it into a deadlock. That is my reading of the dump and logs; the GPU trace that should confirm the queue state is still being analysed.

Related

Hardware: RTX 2070 SUPER 8 GB, driver 621.40 (nvwgf2umx 32.0.16.2140), Ryzen 5 3600XT, Windows 11. Not seen on AMD here: I have no AMD card.

Experiments, traces and dumps follow in the comments.

AI use: Claude Code (Claude Opus 5.5) ran the builds and the queued runs, analysed the logs, dumps and traces, and wrote this issue. I checked the figures.

Activity

  1. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Runs so far (all warm caches after a full startup preparation, XCL_PREPARE_ALL=1, release builds, RTX 2070 SUPER 8 GB, driver 621.40; one run each)

    run build settings beyond the base what happened
    A main 3b6a91e + open PRs + #1368 (c1595135) – wait-before-signal at world load, stuck ExecuteCommandLists, stack overflow at ~290 s
    B same minidump same, ~340 s; first dump of the recursion
    C same XCL_GPU_WAIT_TIMEOUT_MS=1000 stuck submit at 652 s ("has not returned for 2096 ms" at 654.1 s), overflow; the watchdog never fired
    D C + local experiment: the watchdog pauses only for build holds (XCL_WATCHDOG_BUILD_HOLDS_ONLY=1) 1000 ms timeout, XCL_WAIT_TIMEOUT_CONTINUE=1 three waits armed at 337.8 s; the watchdog released them on the CPU at 338.96–339.39 s; the q1 submit stayed stuck (7 s), then DXGI_ERROR_DEVICE_HUNG 0x887a0006
    E D + XCL_DRED=1, full dump a build hold paused the watchdog again; stack overflow; 34.6 GB full dump
    F D + local experiment: XCL_WBS_CPU=1 keeps a wait whose producer is not submitted on the CPU instead of a GPU queue.Wait 1000 ms timeout, continue, DRED title idled on a menu for 8.7 h (scripted A press came too early), world load at 31,377 s; the CPU waits each timed out after 2 s; then a q1 submit stuck at 31,385 s and DXGI_ERROR_DEVICE_HUNG
    G current main 9dfbe3e + #3318 #3321 #3323 #3325 #3328 #3330 #3336 #3377 #3242 #3364, 3292b09 reverted (#2867) Series S profile (XCL_DEVICE_TYPE=lockhart), DRED, full dump, WPR CPU+GPU trace eight waits armed at 501.8 s; no submits 505–570 s; q1 submit stuck at ~570 s (reported 572.3 s); stack overflow at ~850 s; 31.7 GB full dump

    Notes:

    • Runs D and F end in a TDR instead of a stack overflow. Both released waits early (on the CPU after a timeout), so the compute work ran without its dependency. I read those TDRs as a side effect of the experiments, not as the original failure. Runs A, B, C, E and G, which leave the waits alone, all end in the stack overflow.
    • Before D3D12.X: translated compute pipelines are made with node mask 0 #1368 the title never got this far (it froze in compiles on the title thread), so this failure is not new with D3D12.X: translated compute pipelines are made with node mask 0 #1368, only reachable now.
    • Base instrumentation in every run: XCL_ACTIVITY XCL_HEAP_WINDOWS XCL_HEAP_FLAT XCL_STALL_TRACE_DETAIL XCL_PSO_TRACE XCL_GPU_PROFILE XCL_SYNC_TRACE XCL_LOOK_STATS XCL_DIRECT_DXIL_STATS, plus typeperf, nvidia-smi and (from D on) an elevated circular WPR CPU+GPU capture saved at the end of the run.
  2. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Crash dump of run G (Series S, current main)

    The overflowing thread is the title's submit thread (the same thread the watch reported as "ExecuteCommandLists on thread 10676 has not returned for 2056 ms"). Bottom of its stack:

    xcl!...::real::QUEUE_SLOTS::f
    xcl!...::real::queue_dispatch
    xcl!...::real::q_execute_command_lists            title_lists len 0x10, mapped len 0xb, submitted len 0
    xcl!...::list_x::execute_submission_plan_until_failure_on
    xcl!...::queue_submit::with
    xcl!...::real::q_execute_command_lists::closure
    xcl!...::list_x::submit_title_chunk              queue = 0x7ee3c070
    xcl!...::alloc_pool::SubmissionGate::submit_receipted
    D3D12Core!CCommandQueue<0>::ExecuteCommandLists
    D3D12Core!CCommandQueue<0>::ExecuteCommandListsImpl+0x2fc
    nvwgf2umx!OpenAdapter12+0xbddc
    nvwgf2umx!OpenAdapter10+0x18052f … +0x1860a4      (about 10 frames)
    nvwgf2umx!NVAPI_Thunk+0x2a3853
    nvwgf2umx+0x1f1c52
    then about 1,000 levels of
      nvwgf2umx+0x1f430f -> NVAPI_DirectMethods+0x1cd58 -> +0x1ed5d -> nvwgf2umx+0x1f199b
    and, nearer the top,
      nvwgf2umx+0x1f430f -> +0x1f12ae -> NVAPI_Thunk+0x2a20eb -> +0x1f15cc
    until __chkstk faults at the stack guard (stack 0x0b0d0000–0x0b1d0000, 1 MiB)
    
    • Which queue: list_x::QUEUE_IDS (the table behind the q0/q1 names in the log) holds [0x7ee3c320, 0x7ee3c070, 0x22b879e0, 0x22b87c90, 0x22b884a0]. The stuck call's queue 0x7ee3c070 is q1, one of the four compute queues waiting for q0's value. It was the first chunk of the title's 16-list submission, so none of it had reached the driver.
    • The recursion: disassembly of nvwgf2umx+0x1f1200–0x1f12a9 (driver 621.40) compares a ring's free space (fields at +0x38 and +0x58 of the ring object, thresholds 0x2000 / 0x10000 / 0x40000 / 0x100000) with the size needed, and calls +0x1f3cd0 when it does not fit; that call ends up back in the same check. My reading: the ring belongs to the waiting queue and cannot drain while that queue's GPU wait is unsatisfied.
    • Other threads at the time of the crash: 18 DXC/translation workers idle on channels, 7 in nvgpucomp64 compiling, pipeline workers idle, one XCL thread blocked in queue_submit::Lease::enter behind the stuck submit, two in pso_async::Wait::until_done, several title threads parked in game code. No XCL thread was waiting on a fence.
    • Runs B and E have the same stack shape (about 4,100 frames, same five addresses); in run E no residency or paging calls were on any stack.

    Dumps are 31–35 GB each and contain game memory, so I cannot attach them. I can run any debugger command on them on request.

  3. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Sync and watchdog evidence from the logs

    Run G (Series S, current main), title submit thread 10676:

    [501.773] Wait64BitValueX at 0x70417fc68 >= 0x26cc bridged to GPU queue.Wait (waiter=q1/ty2, prod=qSome(0)/tySome(0); wait-before-signal, after_write64=false)
    [501.823] ... 0x70417fc78 >= 0x26cc ... waiter=q2
    [501.862] ... 0x70417fc88 >= 0x26cc ... waiter=q3
    [501.904] ... 0x70417fc98 >= 0x26cc ... waiter=q4
    [501.933 – 502.004] four more, 0x70417fca8 … 0x70417fcd8, q1–q4
    

    Then, from the 2 s activity lines:

    time (s) presents submits draws dispatches
    499.6 18 55 116 81
    501.7 0 10 629 146
    503.7 0 16 124 110
    505.7 – 570.6 0 0 0 – 234 per 2 s (4,388 dispatches recorded at 519.9 s)
    572.3 "ExecuteCommandLists on thread 10676 has not returned for 2056 ms"
    • Thread 10676 logs nothing between 502.0 s and its stuck submit. Over the same window other title threads wait for graphics pipelines being built (2–21 s of waits per 2 s, across threads), because this cache had no graphics pipelines prepared yet.
    • The XCL_GPU_PROFILE 2 s lines stop at 502.6 s; the 20 s summary at 522.9 s reports 4,556 ops in flight.
    • No "GPU queue.Wait … did not complete within 5000 ms" in this run: the watchdog's clock was restarted the whole time by title_held() (pipeline waits over 250 ms, then the stuck submit itself).
    • In every run this wait pattern occurs once, at world load, right before the failure (run D: 3 waits at 337.8 s; run G: 8 at 501.8 s; run F: 3 kept on the CPU at 31,378 s). It does not occur during hours on the menus.

    Run F (waits kept on the CPU), sync trace at the stall, times relative to it:

    -7662.968 q0 EXECUTE 1 lists: be980/70180[W0>=27aok | ]
    -6441.137 q1 EXECUTE 1 lists: d9b50/1bb80[Wf68>=e41d8 | Sf70=e41d8]
    -6439.668 q1 wait 0x70417ff68 (op 7) 0xe41d8: on the CPU            (timed out after 2000 ms)
    -4057.671 q1@1 signal 0x70417ff70 = 0xe41d8
    -4041.483 q2 EXECUTE 1 lists: d5320/283c0[W78>=e41d8 | S80=e41d8]
    -4041.126 q2 wait 0x704180078 (op 7) 0xe41d8: on the CPU            (timed out after 2000 ms)
    -2028.102 q2@1 signal 0x704180080 = 0xe41d8
    -2019.858 q0@1868723 signal 0x70417ff68 = 0xe41d8
    -2019.798 q0@1868724 signal 0x704180078 = 0xe41d8
    -2002.016 q1 EXECUTE 1 lists: dcb70/2b5c0[We58>=e41d8 | Se60=e41d8 Se68=e41d8]
    -2001.515 q1 wait 0x70417fe58 (op 7) 0xe41d8: on the CPU
       0      q1 ExecuteCommandLists stands still -> DXGI_ERROR_DEVICE_HUNG
    
    • The q0 values the compute queues wait for (f68, 78) were signalled 8 ms after q2's own signal (80), so q0's progress appears to depend on the compute queues' signals: the title's queues wait on each other in both directions, and that only works if each queue keeps running up to its waits. That is a reading, not proven.
    • The log line "kept on the CPU (its producer is not submitted)" in this experiment was wrong for f68 / 78: their q0 producer had been submitted.

    The ring holds 1,500 events; in run D routine q0 entries overwrote the compute-queue entries before the dump, so it cannot show the edges.

  4. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Video memory, and what the Series S run changed

    At the point of failure every run is far over the video memory budget Windows gives the process (8 GB card):

    run profile video memory in use (local) budget over
    F, on the menu for 8.7 h Series X 6,950 MB 6,887 MB 62 MB
    F, 30 s into world load Series X 13,696 MB 6,965 MB 6,731 MB
    G, world load Series S (title memory 8,192 MiB) 12,224 – 12,260 MB 7,040 – 7,123 MB 5,100 – 5,184 MB
    • In run F during the load: nvidia-smi showed 4–13 % GPU use with the card's memory full (7.8 GB); one 268-byte compute shader (cs 3608ac24bd857bba, 256×256 groups of 8×8) took 203 ms for one dispatch; q0's work took about 5.6 s to reach its signal.
    • I first suspected memory oversubscription as the cause: a GPU starved by paging never frees ring space. The dump of run G (stuck call on a queue behind an unsatisfied wait) and the fact that the failure always follows the one wait-before-signal pattern point to the synchronisation instead. Oversubscription may still make the window longer (slow q0 work, slow pipeline builds), so I have not ruled it out.
    • The Series S profile did not bring video memory under budget (12.2 GB), so run G does not separate the two.

    Cache and builds used: run G's cache is a cold Series S preparation of the same build (26,308 shaders, 0 errors, compute pipelines in 2,544 s, no graphics pipelines because no earlier Series S run had recorded any).

  5. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Not done yet / next steps

    • GPU trace of run G (5.2 GB WPR CPU+GPU, DxgKrnl with QueuePacket / DmaPacket / PagingQueuePacket / MakeResident events): being analysed now. It should show whether q1's context is held at the wait packet while q0 is idle or busy, and whether paging runs during the window. I'll add the result here.
    • The fix I would test first (not written yet): don't hand the driver a GPU queue.Wait whose producer is not submitted; keep the waiting queue's later lists on the CPU side (in submission order) until the producer is submitted, then submit them behind a GPU wait that can be satisfied. vkd3d-proton handles wait-before-signal this way, by deferring the submission. Together with it: the watchdog should not count a stuck driver call as a reason to pause (title_held() / wait_expired).
    • A check that needs AMD: whether AMD's driver queues the work behind an unsatisfied wait (then the title would only stall at this point, not crash). Results from anyone on RDNA are welcome: run to world load with XCL_SYNC_TRACE=1 and look for bridged to GPU queue.Wait (… wait-before-signal …) followed by has not returned.
    • Not tested: AMD; other NVIDIA drivers than 621.40; with the title's graphics pipelines prepared (the Series S cache had none, which lengthened the window to 67 s).

    The two experiment switches from runs D and F are local commits for now; I can push them to a branch if anyone wants to reproduce.

  6. Gevroska commented on Nov 30, 2026

    @Gevroska

    @KOLESNiii I found the same Wait64 queue pattern in two saved RTX 3080 loading runs on 206b8ff9, one cold and one warm. In each run, the thread that had previously logged PresentX enqueued eight wait-before-signal bridges after the last interval with a present. Four COMPUTE queues accounted for two waits each, and all eight records pointed to the same DIRECT queue as the possible producer.

    The first bridge appeared 33.6 s after the last positive present interval on the cold run and 1.3 s after it on the warm run. Eight is the per-process logging limit, so later waits may also have occurred.

    The markers confirm that the native queue.Wait calls returned after enqueueing the waits. The logs don’t show which queue eventually signalled those fences or whether the waits completed. Both runs reached their time limits without a crash or device removal. I can corroborate the queue pattern on a second GPU, but I didn’t reproduce the stack overflow.

    I used Codex GPT-6.2 Sol to analyze the traces. The queue counts, thread identity, and timing were independently checked against both full logs. Codex GPT-6.2 Astra drafted this comment.

    I reviewed and approved this comment before posting.

  7. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    Correction: the stuck submit is caused by XCL_GPU_PROFILE=1, not by the wait-before-signal

    Every run in this issue had XCL_GPU_PROFILE=1 on (my profiling template sets it). That profiler records a timestamp EndQuery before and after every dispatch, plus a ResolveQueryData. On this driver, too many timestamp queries in one compute-queue submission make ExecuteCommandLists recurse until the stack overflows, and a resolve of them on a compute queue hangs the GPU. A small D3D12 test reproduces both, with no title and no XCL.

    Standalone test (RTX 2070 SUPER, driver 621.40)

    One ExecuteCommandLists of a list of trivial dispatches, nothing else on the device:

    queue per dispatch dispatches result
    compute nothing 1,000,000 fine (92 ms)
    compute ResolveQueryData only 6,000 fine
    compute WriteBufferImmediate marker only 6,000 fine
    compute 2 timestamp EndQuery 2,000 fine
    compute 2 timestamp EndQuery 3,000 / 4,000 / 6,000 stack overflow inside ExecuteCommandLists
    compute 2 timestamp EndQuery, 8 lists × 1,000 in one call 8,000 stack overflow
    compute EndQuery + ResolveQueryData 100 DXGI_ERROR_DEVICE_HUNG (the call takes ~0.5 s)
    direct the profiler's whole pattern 6,000 fine

    The recursion is the same nvwgf2umx frame cycle as in the dumps above. With a 512 MB stack (XCL_DRIVER_STACK_MB, experiment), the call ran for 54 minutes and still overflowed, so it does not finish.

    Ruled out by the same test: an unsatisfied GPU wait in front of the submissions, with 20,000 submits, 858 MB of shader code, or 20 GB of buffers on a 7.2 GB budget. Nothing blocked.

    In the title

    • The stuck submission at world load is a q1 (compute) list of 23,558 operations: WriteBufferImmediate, Dispatch, WriteBufferImmediate, ResolveQueryData, repeated (DRED, run H3). The GPU finished 110 of them before the hang.
    • The world load is where compute lists first get that big. The wait-before-signal comes just before it, which is why I took it for the cause.
    • An experiment that never hands the driver a wait without a submitted producer (XCL_WBS_HOLD) made no difference. It held and replayed every such wait correctly, then the replayed q1 submission stood still with 0 unmet waits and every queue idle, and the run ended in DEVICE_HUNG.

    Without the profiler (same build, Series S, warm, 2 runs)

    • H5 (no profiler, no hold): no crash and no stuck driver call. The title passes the wait-before-signal at 366 s. It then records very slowly for the rest of the 10 minutes (0 presents), because its threads wait for graphics pipelines being built. This cache had none prepared: 605 driver compiles started after the waits, and 604 finished.
    • H4 (no profiler, hold on): GPU page fault at 298 s, before the world load. It happened in a list of CopyTextureRegion calls, at an address where a resource had just been freed, with 5–6 GB over the video memory budget. The hold was not active yet. This looks like a separate problem; one run so far.

    So with the profiler off, the world-load waits on this title do not deadlock on NVIDIA. What's left at that point is the cold-pipeline wait (and the page fault, to be checked).

    What this changes

    • The fix I proposed above (deferring wait-before-signal submissions) is not needed for this. I am not opening it as a PR.
    • XCL_GPU_PROFILE should not record per-op timestamps on compute lists on NVIDIA, or should cap them per submission, well below about 4,000 queries.
    • Not tested: AMD, other NVIDIA drivers, other GPUs. Results of the test on other cards are welcome; I can post its source (about 150 lines, windows crate).

    Runs: commit b19c39c9 (experiment branch on top of the build named above), Series S device type, warm cache from fee84e55, 10–15 min each, through the local queue.

    AI use: Claude Code (Claude Opus 5.5) wrote the experiments and the test, ran them on my PC and wrote this.

  8. KOLESNiii commented on Nov 30, 2026

    @KOLESNiii
    ContributorAuthor

    A/B request: does XCL_GPU_PROFILE timing on compute lists break your driver too? Fix in draft #3540.

    As in my correction above: on NVIDIA 621.40 (RTX 2070 SUPER), timestamp queries on compute lists break the driver. One compute ExecuteCommandLists with about 3,000 or more of them overflows the stack inside nvwgf2umx, and a resolve of them on a compute queue hung the GPU with 100 dispatches. Direct queues were fine with 6,000. #3540 makes XCL_GPU_PROFILE and XCL_GPU_TIMES time only direct lists unless XCL_GPU_PROFILE_COMPUTE=1. Before turning compute timing off for everyone, I'd like to know which GPUs and drivers actually have the problem.

    What to run (any title that gets to a heavy compute scene, the same one on both sides):

    • Build: D3D12.X: GPU profilers time only direct lists unless asked for compute #3540's head (3ef4593d, branch KOLESNiii:d3d12x-gpu-profile-direct-only), cargo build --release -p xcl.
    • Run A: XCL_GPU_PROFILE=1 XCL_GPU_PROFILE_COMPUTE=1 (compute timing on, as on main today).
    • Run B: XCL_GPU_PROFILE=1 only (this PR's default).
    • Same save point or scripted presses on both, e.g. XCL_PRESS_AT=25:A, warm DXIL cache, other programs closed. Run A, B, A, B if you can; 10 minutes or until the title is past its heaviest load.

    What to paste back:

    • GPU + driver, CPU, RAM, Windows build.
    • For each run: whether it got past the load, stood still (no presents), or ended with a device removal / DXGI_ERROR_DEVICE_HUNG / a stack overflow, and when.
    • The last few D3D12.X: XCL_GPU_PROFILE lines and any device removed / DRED lines from xcl.log.

    A run where compute timing is fine is just as useful as one where it breaks: if only NVIDIA has the problem, the default can depend on the vendor. AMD (RDNA2/3/4) and other NVIDIA drivers are what I most need; I can only test NVIDIA 621.40 here.

    If you'd rather test the driver alone: the standalone test is about 150 lines with the windows crate. Say so and I'll post it.

    Our environment: RTX 2070 SUPER 8 GB, driver 621.40, Ryzen 5 3600XT, 32 GB, Windows 11 Home 26300, rustc 1.100.1.

    AI use: Claude Code (Claude Opus 5.5) wrote this request and the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions