Compute pipeline build takes >120 GB of memory on NVIDIA #1598
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#1598
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?
@PrMeiliv on GitHub · 2026-11-24 18:07 UTC · original
Game and package version
Retail 1.0.2.1
What happens
Setup:
9800x3d
4080
32go
Precompile (
xcl shaders shaders.rpf --precompile --pipelines)9e3831e. Each crashes withLLVM ERROR: out of memory / Allocation failedafter22600/26503 shaders, at "pipelines: 450–525 made, 0 refused".
uses ~123 GB of commit.
In game (same build, same cache)
title watchdog crash (
+0x23cf683, null write) at 95 s. One compute PSO took 44.6 s (921 KB DXIL).memory allocation of 11206656 bytes failed(exit 0xc0000409) at 43 GB of commit.XCL's own counters (target pages, pools, arenas, sparse) are about the same as in the 28.7 GB run,
so ~95 GB is outside them.
Guess: one large compute program (maybe bigger because of the split wave64 form) needs unbounded
memory in DXC or the NVIDIA compiler. It sits on the world-load path, so this is likely the
"slow build" holding up the first world frame on NVIDIA.
XCL version
9e3831eGPU and driver version
4080 32.0.16.2124
Windows version
26h2 36300.9974
report.json and xcl.log
xcl.log
report.json
Console output
Written by Claude (Opus 5.5)
@ofc0urse on GitHub · 2026-11-24 18:29 UTC · original
Same picture here on an RTX 4060 Ti 8 GB (driver 621.24, 32 GB RAM,
main9e3831e+ local test-only patches,XCL_HEAP_WINDOWS=1), and it goes away when the few translated sources over 8 MB of HLSL are not compiled.I added a log line for every DXC compile of 4 MB or more and a test-only switch that refuses sources over a size. With sources over 8 MB refused,
xcl shaders <pack> --precompile --only cs --pipelinesrefused six: 12.0, 12.3, 12.7, 29.5, 29.6 and 147.4 MB of HLSL. Free commit has stayed flat at 43–52 GB since, now past 1,475 pipelines, 0 refused; sources of 4–4.6 MB build in 21–126 s each. Without the cap the same command took free commit from ~48 GB to 4.9 GB in about 2 minutes, and a title run went from 33 to 82 GB of process commit in ~40 s withxcl-dxc-0insidedxcompiler.dllat the time. Numbers per DXC flag are in #1526 (#1526), the title-run side in #1566 (#1566).So the ~95 GB outside XCL's counters is most likely DXC compiling these sources inside the XCL process (its heap is not in XCL's counting allocator). The 147.4 MB one is probably the 154.6 MB program measured in #1269, in the heap-window form. I can't separate it fully from the driver: in the precompile run without the cap I had no per-compile log yet, and I did not try which of the six alone takes the memory.
A workaround that worked here, test-only and not a PR: refuse those sources in
dxc::compile_herebefore DXC sees them, so their pipelines are refused like any failed compile.AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and wrote this; I checked it before posting.
@joeypercia on GitHub · 2026-11-24 20:07 UTC · original
Two open PRs target exactly the sources @ofc0urse names, and with both merged the blow-up is gone here: #1321 (structured code over 128 bytes per code byte falls back to
pcblocks, so the 147 MB program) and #1316 on #1315 (compute programs through a compact form:CS_ScreenProbes_ActivateProbes29.7 MB → 1.05 MB of DXIL).Tested: RTX 4070 Ti (driver 616.56), Ryzen 7 7800X3D, 32 GB RAM, automatic page file (limit ~68–75 GB during these runs), Windows 11 Pro 26200, release builds, retail 1.0.2.1, no
XCL_PSO_WAIT_MS. #1321 conflicts withmainsince #680 (both add a line at the top oftranslate); I merged it locally keeping both, and moved itsprogrambinding intotranslate()where #1316 splits offprepare().main9e3831e9e3831e+ #1321 + #1316ActivateProbes(1,053,264 B) built in 20.5 s; ~1 MB compute PSOs after it at 48–63 s each; no frames after 118 s--precompile --only cs --pipelines, 6 DXC threads) on the same treeSo for this issue's memory, #1321 + #1316 look like the fix; the remaining world-load stop on NVIDIA here is the build time of the ~1 MB compute pipelines, not memory.
Not tested: #1321 or #1316 alone (only together);
XCL_HEAP_WINDOWS=1; the direct DXIL path (XCL_DIRECT_DXIL=1) with this title.AI use: Claude Code (Claude Opus 5.5) ran the builds and the title on my machine, read the logs and wrote this report.
@CowboyBingus on GitHub · 2026-11-24 22:01 UTC · original
Peak commit of two of the very large compute programs, per program, on the same base:
main266b845against #1316 at964f5edwithXCL_COMPACT_CSunset (auto). RTX 5070 Ti,xcl shaders <record folder> --measure-pso <hash>(driver caches off), one cold run each (new exe copy, emptyXCL_DXIL_CACHE), peak private commit sampled every 0.5 s,main's runs stopped at 600 s:main266b845964f5ed56c0cd3b82a00c6e958400d2caf07244--measure-pso, not a--pipelinesrun.95cc13288a27a96e(ActivateRays) is not affected by #1316: its compact form is refused (9975-word table (at most 8192)), so both builds translate it the same way.AI use: Claude Code (Claude Opus 5.5) ran the measurements and wrote this comment.
@O5-7 on GitHub · 2026-11-25 07:21 UTC · original
Claiming the offline
xcl shaders --precompile --pipelinesmemory-gating slice for #1598 (disjoint from #1638's DXC subprocess cap and #1315/#1316's compact backend).Currently
Pipelines::make_with_cache_pathincrates/xcl/src/shaders.rsbounds only total thread count (XCL_PIPELINE_THREADS, default 4) and the 8 MiB single-shader cap (XCL_PIPELINE_MAX_KB), so up to 4 large (1–8 MiB) uncached compute DXILs can enter the NVIDIA driver simultaneously without commit-headroom checks — unlike runtimexcl-pso*workers inhle/d3d12x/real.rs(big_compile_turn/big_compile_headroom).Plan (one small PR):
shaders.rs(--pipelines) with huge-DXIL concurrency serialization andGlobalMemoryStatusExcommit-headroom checks matching the runtime policy inreal.rs(cached-blob hits stay ungated).@b3IKK on GitHub · 2026-11-25 11:50 UTC · original
Cross-link from a world-load run today: the program that made this issue's numbers so large no longer exists in that form on current
main.56c0cd3b82a00c6ewas 29,215,780 B of DXIL (the ~150 MB of HLSL in the report above, in the heap-window form) at689f2dband never finished compiling in a 1494 s run. Onmain426a5a7the same record is 484,744 B of DXIL and the driver finishes it in 10.4 s.That is #2120's routing ("enormous compute programs take the direct DXIL translator") — the log line for its sibling says
15008 KB of HLSL would compile unoptimised - direct DXIL instead (2345 KB). The remaining big program is95cc13288a27a96eat 2,401,896 B and ~149 s of driver time, which #2120 leaves on the HLSL path.Measured on an RTX 5080 (32-lane waves, driver 32.0.16.1088), retail 1.0.2.1, 600 s runs with
XCL_PSO_DISK_CACHE=0so the driver compiles are cold: 39 compute records that bothmain426a5a7andmain+ #1380 reached, 994.5 s of driver time onmain, of which the ten of 700 KB or more are 661.0 s. #1380 (7d43a46) takes those ten to 301.2 s. Details and the per-record table are in my comment on #1380.Not tested: AMD, Linux / Wine,
XCL_HEAP_WINDOWS=1, and what any of these programs compute; the title's picture stops before they finish in both runs.AI use: OpenCode, Claude Fable 5.2 built the trees, ran the runs and wrote this.
@Chrysana on GitHub · 2026-11-25 19:06 UTC · original
AMD numbers for
95cc13288a27a96e(ActivateRays), for "Not tested: AMD" above. On RDNA4 the title's driver compile of this record never finished in 5 runs. While it compiles, process commit grows by ~16 GB in ~70 s. In the one run where it ended, the driver refused it with0x8007000eafter 69 s, and 12.7 GB of commit went within 2 s. XCL's own counters stay flat throughout, so this is the driver compiler's memory.Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, page files growing on demand (commit ceiling 79 GB), Windows 11 26200.9974, release builds. Retail title 1.0.2.1,
XCL_NETWORK=0 XCL_ACTIVITY=1, A pressed every 4 s from 12 to 120 s, default path (noXCL_DIRECT_DXIL), driver caches on but holding no blob for this record (driver blob absentevery time).The record on
main06c9f55:[SHADER] 95cc13288a27a96e: 15008 KB of HLSL would compile unoptimised – direct DXIL instead (2363 KB), thendriver compile start …: compute PSO, 2420640 B DXIL, record 95cc13288a27a96e. On this base it goes through the direct DXIL translator, not the HLSL path described above for426a5a7.main06c9f550x8007000eat 177.5 s, after 69.1 s in the driver;its dispatches are skipped06c9f55+ #19933260d400xc0000409) at ~183 s; at 181.0 s the driver refused another compute PSO (354,252 B) with0x8007000e06c9f55+ #19933260d4006c9f55+ #199369903fc06c9f55+ #19933260d40mainand with #1993, commit follows the same curve while this compile runs (more on that in my #1993 comment).mainrun, the compile is logged ashuge, ungated here (a title thread's, cached, or gated by its caller), so the runtime's huge-compile gate didn't hold it. For this size, the gate's headroom rule (big_compile_headroom: the larger of 3 GB and 512 × the DXIL size) asks for 3 GB of free commit. On RDNA4 this compile took several times that. This may matter for @O5-7's gating slice: the 512× figure would need to be ~5,000× to cover it.mainskipped the program's dispatches for the remaining 122 s and didn't try the compile again.xcl shaders --measure-psofor this record: it compiles the record's HLSL through DXC, while the title sends this record through the direct DXIL translator, so it wouldn't time the same compile.Not tested
XCL_DIRECT_DXIL=1.main(these runs are on06c9f55).AI use
xcl shaders --precompile --only cs --pipelines: access violation in dxcompiler.dll with parallel DXC compiles, not with XCL_DXC_THREADS=1 #2751@KOLESNiii on GitHub · 2026-11-26 10:09 UTC · original
A whole-pack
xcl shaders --precompile --only cs --pipelineson an RTX 2070 SUPER (DXC 1.9.2609.5, 11 DXC threads) got past this issue's point at 22,600 and then ended twice at ~23,200–23,400 with a different fault:0xc0000005indxcompiler.dllat the same offset, not the out-of-memory abort here. Commit was not sampled during those two runs. WithXCL_DXC_THREADS=1the same records compiled, and commit stayed at half the limit. Details in #2751.Claude Code (Claude Opus 5.5) wrote this note from those runs.