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
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#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?
@Peppacodes on GitHub · 2026-11-24 14:35 UTC · original
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).
@MichaelSmithAI on GitHub · 2026-11-24 14:55 UTC · original
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.@NuraadGit on GitHub · 2026-11-24 16:27 UTC · original
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.
@465d6a0eac on GitHub · 2026-11-24 17:49 UTC · original
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).@luisaugustz on GitHub · 2026-11-24 18:10 UTC · original
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.
@rouges78 on GitHub · 2026-11-24 18:25 UTC · original
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.
@alessiodeia on GitHub · 2026-11-24 20:26 UTC · original
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).
@Marvisak on GitHub · 2026-11-25 06:57 UTC · original · edited 2026-11-25 09:57 UTC
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
@StExpeditus on GitHub · 2026-11-25 09:37 UTC · original
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.@StExpeditus on GitHub · 2026-11-25 09:38 UTC · original
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)).@Venom2054 on GitHub · 2026-11-26 14:38 UTC · original
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.