GPU: NVIDIA's shader compiler overflows the pipeline worker's 2 MB stack and the pipeline is refused as out of memory (fix on a fork) #966
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Marvisak/VIctory. Originally posted by Peppacodes on 2026-11-24T14:35:45Z.
What's wrong
The driver compiles host pipelines on VIctory's pipeline worker threads (
victory-pipelines-N,crates/victory-gpu/src/pipeline/make.rs). Those threads use Rust's default 2 MB stack.On an RTX 5080 (driver 32.0.16.1692), NVIDIA's compiler recursed past that while creating a world compute pipeline:
The driver catches the overflow and reports it as
E_OUTOFMEMORY. The program's dispatches are then dropped every frame. TheE_OUTOFMEMORYrefusals after a first-chance exception innvgpucomp64.dllreported on #233 and #334 may have the same cause on some drivers.Fix
GPU: pipeline workers get a 64 MB stack for the driver's compilerd09c31b, onmain(ffe310e). One file, +8 lines:Builder::stack_size(64 << 20)on the workers.A 64 MB stack is reserved address space; only the pages the compiler actually uses are committed.
Result
Same game build and scene on the RTX 5080. The tree is #940's branch plus #587 and #452.
c7d7a6283fad3cd60x8007000Ehost pipeline shaders=[compute c7d7a6283fad3cd6]Checks
Run on the branch itself (
main+ this commit), Windows 11, Rust 1.98.1, with the CI's commands:cargo test --workspace --locked --no-fail-fast: 342 passed, 0 failed, 6 ignored.frame::tests::waits_end_on_ticks_and_count_framesfailed once in a first run under load and passed three times alone; #689 is about that test.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.rustfmt --edition 2024 --checkonmake.rs: no new differences (the file has the same 3 onmain).cargo xtask policy: 154 files ok.Not checked
std::thread::Builderthreads inhost.rsever run the driver's compiler.No game files used. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T14:55:28Z.
We checked
d09c31bon an RTX 4090 with Wine and vkd3d-proton 3.2. A small DXC compute shader went through the normal pipeline queue. On the named worker, the measured stack reservation was 2 MiB with the default builder and 64 MiB with the patch. Both workers created the pipeline successfully.This confirms the reservation changes on the thread that calls the driver. The same-scene RTX 5080 comparison in your report remains the evidence for admission of the title shader
c7d7a6283fad3cd6. Our Wine control used a different shader. For other reports of0x8007000E, a matching shader hash and a worker-stack diagnostic would help distinguish this case.Imported from Marvisak/VIctory. Originally posted by NuraadGit on 2026-11-24T16:27:34Z.
A control for the same program: on an RTX 2080 (Turing, driver 616.56),
c7d7a6283fad3cd6gets its host pipeline in both world runs I checked, with default-size worker stacks. Neither log has a0x8007000E. The stack: JMAN730's fork + #493 + #189 (d0fd9bf, Wave32) + #206 + #667 + #704 + #878 + #489, loop limit 32.So the overflow depends on the driver, the architecture or the emitted module (our wave lowering and loop limit differ), not on the title's program alone. That still leaves a larger stack worth having for the drivers that recurse.
AI-assisted (Claude Code). The hardware, title copy and runs are the user's.
Imported from Marvisak/VIctory. Originally posted by 465d6a0eac on 2026-11-24T17:49:48Z.
Thank you for this, @Peppacodes! Many pull requests here are still waiting to be merged, so I've ported your fix (
d09c31b) to 465d6a0eac/AgentRecompVI, a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/36. You're credited as the author there. This stays the original.Test results
cargo clippy(both variants) andcargo test --workspacepass (429 passed, 0 failed).Imported from Marvisak/VIctory. Originally posted by luisaugustz on 2026-11-24T18:10:19Z.
AMD data point: the 64 MB worker stack does not prevent the
amdxc64.dllcompiler crash on RDNA 4On an RX 9070 XT (Adrenalin 32.0.32029.2010), compiling some
CS_RaytracingResolvepipelines crashes inside AMD's compiler on the pipeline workers:With
d09c31b(64 MB worker stacks), the same address crashes the same way, in-game and offline (translate --pipelines, one program). It's a null read, not a stack overflow, so this fix doesn't cover it. Details and the affected programs are on #71.We have kept the larger stack anyway: no regression in several world runs on this card.
AI-assisted (Claude Code): measured on this machine.
Imported from Marvisak/VIctory. Originally posted by rouges78 on 2026-11-24T18:25:29Z.
I tried to reproduce this without the title on a second NVIDIA card. It did not reproduce, but the measurements may be useful. Synthetic shaders only, no game data.
Host: Windows 11 Pro (build 26300), RTX 4080, NVIDIA driver 621.14 (32.0.16.2114), native.
Method: a small probe creates a compute pipeline on a fresh thread and reads how much of that thread's stack was committed afterwards (the high-water mark, in 4 KiB pages). A second thread samples the caller's RIP and RSP during the call.
CreateComputePipelineState, on that thread's own stack: in a 4 s compile, 2,764 of 2,902 samples were insidenvgpucomp64.dll, the thread's CPU time matched the wall time, and RSP never left its stack.dxil.dllaccepts the ones I validated).cargo test -p victory-shadercreates stay at or below 40 KiB as well.So on this driver the stack depth does not follow shader size or any of these shapes, which fits the RTX 2080 control above: the overflow needs something specific to the emitted module, or to the driver or architecture (the report is 616.92 on a 5080; I only have 621.14 on a 4080). I can't tell which. Nothing here argues against the 64 MB stack.
What would answer "is 64 MB enough" is the same number on the worker that compiles that shader. The measurement is about 20 lines with no new dependency (below); logged after a pipeline is made, it is also the worker-stack diagnostic asked for above.
Committed-stack high-water mark of the current thread
AI-assisted (Claude Code), from runs on my machine.
Imported from Marvisak/VIctory. Originally posted by alessiodeia on 2026-11-24T20:26:28Z.
Another
0x8007000Esource on NVIDIA that a bigger stack does not cover: a null read inside the compiler, fixed by a driver update. RTX 2070 SUPER (Turing).On driver 617.42, every
host pipeline refused … (0x8007000E)in my world runs comes right after a caught first-chance exception at the same compiler address:It is not a stack overflow: there is no
has overflowed its stackand no0xc00000fd. The counts match one to one: 38 exceptions and 38 refusals on one tree, 85 and 85 on a tree that translates more programs. All of them come during the first ~9 minutes of pipeline creation.After updating to 621.40 (same
victory.exe, same tree, two 30-minute runs) there were 0 compiler exceptions and 0 refused pipelines. The tree ismainffe310e+ #439 + #979's two commits + #1130 + #1065 + #493 #587 #282 #876 #67 #490 #464 #984 +fix/unaligned-buffer-srv.So for a
0x8007000Ereport, check the first-chance line just above the refusal.nvgpucomp64.dll+0x315a411(read 0x8) on 617.x points to a driver update, and a stack overflow points to this fix. Like @luisaugustz'samdxc64.dllcase, this one is a null read rather than stack depth.One caveat from the same runs on 621.40: one of the two ended at 10 minutes in with
DXGI_ERROR_DEVICE_REMOVED(0x887A0005, not_HUNG) and empty DRED breadcrumbs. The other ran the full 30 minutes. I don't have a cause for that one yet.No game data attached. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:57:30Z.
Automated triage for the maintainers.
Confirmed on
main. Incrates/victory-gpu/src/pipeline/make.rs,queuespawns thevictory-pipelines-Nworkers withstd::thread::Builder::new().name(...)and nostack_size, so they get Rust's default 2 MB stack, and the driver's compiler runs on them. The overflow innvgpucomp64.dllthat ends in a refused pipeline (0x8007000E) fits that. Open PR #1129 ("GPU: give pipeline workers room for NVIDIA's shader compiler") carries the same change, so review can continue there. Your branchfix/pipeline-worker-stackcan be compared with it.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:37:15Z.
Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, RTX 5060 Ti, driver 621.24, Rust 1.98.1 MSVC), commit
d09c31b:cargo test -p victory-gpu --locked --no-fail-fast-> 50 passed, 0 failed, 1 ignored. Synthetic tests only, no game files.Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:38:02Z.
Addendum: this branch is far behind current main (the
victory-gpudelta is 37 files, ~11.2k lines), so the run above is the branch as-is on its old base; it needs a rebase before a clean cherry-pick. The change itself is one file, +8 lines (Builder::stack_size(64 << 20)).Imported from Marvisak/VIctory. Originally posted by Venom2054 on 2026-11-26T14:38:08Z.
I tested another variable for
c7d7a6283fad3cd6on an RTX 5070 Ti. With the loop limit held at 16,384, I reassembled the emitted DXIL withllvm.loop.unroll.disableon the loop back edge. The instructions and runtime worker-stack settings were the same. Windows SDK validation passed. All four output words matched an independent CPU sum in eight GPU readbacks (0 to 4,097 input elements). The largest case takes 65 loop iterations.In two Series S prologue runs on the same local fork executable (
3e760edbase), save and initial cache, I replaced just this shader's cache entry. The original loggedE_OUTOFMEMORYand the captured frame contained two dropped dispatches for this shader. With the annotation, D3D12 created the pipeline and the capture recorded twodispatch 1x1x1calls. The run completed 191 seconds in the 3D scene.This gives a shader-side option to investigate alongside the worker-stack change in #1129. The final camera positions differed, so I have no comparable FPS or visual result. AI-assisted testing.
Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T02:28:33Z.
Related Wine/NVIDIA diagnostic caveat, not a reproduction of your stack-overflow cause and not a test of
d09c31b:E_OUTOFMEMORYcan also hide a different native pipeline result on our vkd3d path.Dirty local VIctory base
3ed7d725+ #1893e39e340, scoped XMem/copy-only alias fixes, #2121 paging/stride fix, #2101 filter and #1701 mode; Linux6.17/Wine11, RTX4060 Laptop8GiB/NVIDIA590.48.01,16GiB RAM. Diagnostic-relaxed vkd3d2576c0b4adfae4a+(two unrelated from_iface relaxations + mingw PATHCCH compatibility), not stock certification. Pipeline workers still use the default builder stack; no local stack-overflow exception was observed.During bounded180s loading (prologue card then black), native output repeatedly shows:
-13isVK_ERROR_UNKNOWN, notVK_ERROR_OUT_OF_HOST_MEMORYorVK_ERROR_OUT_OF_DEVICE_MEMORY. At this vkd3d commit,state.c:7023-7029turns any negative graphics result into a null pipeline;6149-6158converts a null library/early pipeline intoE_OUTOFMEMORY, losing the original error. The normalhresult_from_vk_resultmapping is not what preserves the result here.One exact pair: VIctory vertex
022926508d7aa8ba+ pixelc3f65a5eb6b8cbb3; native root signature12ff75d8987ee4ca, vertex shader hash2422d8612de66bee. Nine graphics/mesh refusals surfaced as OOM; four compute refusals surfaced as E_FAIL. Same9/4 counts also existed in our pre-texture-filter run. Current run minimum availableRAM4998.5MiB, GPUpeak4488MiB, scopepeak6248.9MiB, all below unchanged safety cutoffs; deliberate180s wall stop, no matching kernel OOM/reset messages. This doesn't exclude a compiler-internal allocation/stack failure; it does mean the HRESULT alone cannot establish one.Useful next diagnostic is an isolated exact failing pipeline with native error/stack evidence (and default versus larger worker reservation if applicable), rather than assuming every0x8007000E needs a larger global RAM budget. Retained evidence
20261127T022056Z-console.log(first graphics failure near line4034), resources/rendering summary; no assets or shader binaries published.AI-assisted source/log analysis and executed trial: omp/OpenAI GPT-6 Astra.
Isolated follow-through (2026-11-27)
The exact cached compute
2f03a2df10503cefnow reproduces offscreen, without title launch or GPU dispatch. DXIL47,072bytes, SHA256d08fe76e6fb088886a14fe6c69db694fd8b8df8030be1c37ac084a2f07603bd3; vkd3d shaderf81e0913a65db639, root0bdbe03c9f406cc7both match the title failure. Production root/PSO construction, same NVIDIA device and diagnostic DLL provenance above. Explicit2MiB and64MiB thread reservations both fail0/1 with the same NVVM failure/Vulkan-13. Test time0.73s each, GPUpeak166/163MiB, minimum availableRAM11620/12033MiB. This tests the stack-size variable only, not the fork branch as a whole; the second run reused native caches, and no successful PSO was obtained in either.Microsoft
dxv.exevalidates the unchanged input (Validation succeeded, exit0). A separately instrumented replay captured native SPIR-V;spirv-val --target-env vulkan1.3 --scalar-block-layout(SPIRV-Tools2025.1) fails: AtomicOr expected an integer scalar Result Type, but the module uses float and an Image float pointer. The DXIL atomic is integer, but its handle was annotated RWTexture2D<4xF32>. This matches the typed-handle-cache defect owned by #2723 (38f3697801be71060ed2dd1fa65f37c56386e779) / #177, rather than proving your native-Windows stack-overflow mechanism. The correction is the next verification target; no fix/world-rendering success claimed yet.Evidence directories:
verify-rendering-library-native-2m-20261127T031417Z,verify-native-compute-64m-20261127T031518Z,verify-native-compute-dxil-validation-20261127T031609Z,verify-native-compute-spirv-capture-20261127T031741Z. Shader/root/DXIL/SPIR-V artifacts remain local. Title-load memory pressure is not required to reproduce this one pipeline failure; other failed pipelines and the final black frame still need separate attribution.