Compute pipeline build takes >120 GB of memory on NVIDIA #1588
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 ivall/xcl. Originally posted by PrMeiliv on 2026-11-24T18:07:18Z.
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)
Imported from ivall/xcl. Originally posted by ofc0urse on 2026-11-24T18:29:31Z.
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 (https://github.com/xcl-dev/xcl/pull/1526#issuecomment-7139633778), the title-run side in #1566 (https://github.com/xcl-dev/xcl/issues/1566#issuecomment-7140177866).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.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-24T20:07:31Z.
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.
Imported from ivall/xcl. Originally posted by CowboyBingus on 2026-11-24T22:01:44Z.
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.
Imported from ivall/xcl. Originally posted by O5-7 on 2026-11-25T07:21:20Z.
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).Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-25T11:50:40Z.
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.
Imported from ivall/xcl. Originally posted by Chrysana on 2026-11-25T19:06:22Z.
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
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T10:09:39Z.
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.
Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-26T21:46:09Z.
RDNA3 numbers on current
main, next to Chrysana's RDNA4 ones: on a 15 GB PC, the offline pass still needs far more memory than the machine has between records 22,600 and 24,600 of the retail pack, even with one DXC thread.Retail 1.0.2.1,
xcl shaders shaders.rpf --precompile --only cs --pipelines,mainb49be18(contains426a5a7), release, RX 7600 XT (RDNA3, 32.0.31041.1004), Ryzen 5 9600X, 15.1 GB RAM, Windows 11 26200, DXC 1.8.2502.11 from the Windows SDK,XCL_ADAPTER=7600,XCL_PSO_DISK_CACHE=0. Threads were set withXCL_DXC_THREADSand confirmed by each log's(N compile threads)header. Each run resumes from the previous run's DXIL cache. "Peak private" isxcl.exe's private bytes, sampled every 5 s.22800/26503 (687 s)0x8007000Eon a link (compiled whole, and no more programs are linked), thenLLVM ERROR: out of memory, exit0xC0000409at 1,548 s22800/26503 (5 s)23200/26503 (23450 s); 23,000 → 23,200 took 22,518 s0x8007000Elink fallback once; stopped by hand at 27,433 s23600/26503 (1152 s)23200/26503 (6 s), no progress after24800/26503 (14005 s)22600/and22800/:56c0cd3b82a00c6e(30,266 KB of HLSL → 434 KB direct DXIL),958400d2caf07244(30,185 → 396 KB) and95cc13288a27a96e(15,020 → 2,399 KB). The last is the record whose RDNA4 driver compile Chrysana found to take ~16 GB.[SHADER]lines, after23200/:c963276f38285bf4(12,377 → 2,285 KB),f839072880d49fb4(12,691 → 2,339 KB) and219287eb2f6021fe(13,117 → 2,408 KB).amdxc64, in the same process), holds the memory.In game, before any precompile: same build,
XCL_ADAPTER=7600, offline, page file system-managed. The title runs the menus and first-run setup at 30 fps and reaches the story loading screen.amdxc64.dll+0xd7d474(read at 0x0, exit0xC0000005), with no device removal.peak_commit_mbwas 28,248. The title's crash reporter loggedmemory.load_percent86 andsystem.memory.swap.free2,394,624 ofsystem.memory.swap.total52,658,228.+0xd2a411.Not tested
XCL_DIRECT_SPLIT_INSTRUCTIONS.AI use
Imported from ivall/xcl. Originally posted by cindertheblue on 2026-11-26T22:50:15Z.
Follow-up to my run table above: one record at a time, the memory is in AMD's compiler, and nearly all of it in one record,
95cc13288a27a96e(ActivateRays). In its native 64-lane form, AMD's compiler grew until Windows' commit ran out, then the pipeline was refused. In the split wave64 form (XCL_SPLIT_WAVE64=1) it compiled in 82 s and 13.9 GB, and the pipeline was made. XCL's translation and DXC take 3 s or less for each of these records.How
The same
mainb49be18release build, RX 7600 XT (RDNA3, 32.0.31041.1004), 15.1 GB RAM, page file 64 GB + 4 GB (commit limit 83 GB).xcl rpf shaders.rpf --extract <name>. The[SHADER]line of the runs on the extracted file names the record's hash.xcl shaders <that folder> --precompile --only cs, with anXCL_DXIL_CACHEof its own for each record (not the shared one), and withXCL_ADAPTER=7600,XCL_PSO_DISK_CACHE=0,XCL_DXC_THREADS=1andXCL_PIPELINE_THREADS=1.xcl.exeprivate bytes were sampled every 1 s.--pipelines, which is translation and DXC only; the driver is not called.--pipelines. That is A plus AMD's compile, so B minus A is the driver.xcl.exe, B forc963276f38285bf4took 0.2 s, because AMD's driver cache already held it from the full-pack runs. So the cold B runs use a copy of the same binary renamedxclprobe.exe. There, the same record took 89.5 s, so the copy does not see the first one's driver cache.Native form (default on this GPU)
95cc13288a27a96eScreenProbes_ActivateRays219287eb2f6021feRTShadowTrace32TemporalHQ_OneOver2RPP_Tiledf839072880d49fb4RTShadowTrace32TemporalHQ_Tiledc963276f38285bf4RTShadowTrace32HQ_Tiled958400d2caf07244ScreenProbes_ActivateProbesTarget95cc13288a27a96e: private bytes grew at about 110 MB/s (4.8 GB at 32 s, 51.0 GB at 441 s) to the 68.0 GB peak. Commit left reached 4 MB, and the record was refused at 606 s. So this does not show whether AMD's compiler would finish with more memory, only that it needs more than about 68 GB here. That fits Chrysana's RDNA4 numbers above for the same record.Split wave64 form (
XCL_SPLIT_WAVE64=1)95cc13288a27a96e13890 blocks of 2643 kinds)958400d2caf07244c963276f38285bf4,f839072880d49fb4,219287eb2f6021fe95cc13288a27a96ewas not split into a dispatch chain. There is nosplit compute programsline, and one pipeline was made. WithXCL_DIRECT_SPLIT_INSTRUCTIONS=4000the run took 2.7 s, an AMD cache hit, so the DXIL was the same as at 12,500. The gain comes from the other form of the program, not from splitting.Not tested
95cc13288a27a96egives the right results, or how fast it runs in game.XCL_SPLIT_WAVE64=1for a whole pack or a title run on AMD.amdxc64holds the memory.AI use