Repository navigation
Description
NVIDIA's driver keeps the machine code of the pipelines in use in one heap of at most 512 MB. A submission that needs more removes the device: 0x887a0005, no page fault, nothing in DRED, no event. The retail title's world needs about that much on a GPU with 32-lane waves, so it is likely the silent removal of #1452 and #505. A small test reproduces it without any title.
Measured on one card so far: RTX 2070 SUPER 8 GB, driver 617.14, i7-9700K, 32 GB RAM, Windows 11 26300. Bears on #1833.
Reproduce it
shader_code_limit.rs (at the end) makes compute pipelines of unique code, 1.7 MB each, main 68a284a:
| what it does with them | result |
|---|---|
| dispatches each once, keeps them | 0x887a0005 at 262 pipelines, 449 MB of driver blobs |
| dispatches each once, releases them | 420 pipelines, 720 MB: fine |
| keeps them, never uses them | 420 pipelines, 720 MB: fine |
So code counts from a pipeline's first use until it is released.
What the driver does
Read in the running title with a hook on every kernel graphics call of the process (NtGdiDdDDI*); the heap also in the test:
- No kernel call fails at the removal (the only failures are harmless ones that happen at every frame and at start), and
D3DKMTGetDeviceStatereports the device as active until then. The DMA fault (6) found on an RTX 5070 Ti in Recompiler: bound descriptor heap indices from T# and S# words to the heap #1215 is what the driver sets itself:MarkDeviceAsError, from insideExecuteCommandLists. - Its submit function returns
E_INVALIDARG(nvwgf2umx.dll+0x173b78in this driver), where a heap is asked to grow past its maximum:
| title, run 1 | title, run 2 | test | |
|---|---|---|---|
| maximum | 512 MB | 512 MB | 512 MB |
| size | 492 MB | 511 MB | 504 MB |
| asked for | 517 MB | 536 MB | 529 MB |
- In the title it holds 1-3 MB through the menus, with 86,000 pipelines alive (nearly all stand-ins), and 345 MB about a second after the first world work.
- At the world load the recordings on one command allocator use 289 MB of compiled programs, those on all allocators together 392 MB (
GetCachedBlobsizes, about 1/9 less than the heap).
This fits reports in #1452 and #505: the submission at the removal does not matter, cold caches delay it, and any group of about 30 of the 1.0-1.8 MB programs brings it. Unreal developers describe the same symptoms as "shader heap exhaustion", with NVIDIA raising the limit in one game's profile (1, 2; secondhand, I found no NVIDIA documentation).
What I tried
- Newest translations: 14 of the title's compute programs (0.3-1.5 MB DXIL) compiled by the driver on
68a284a. Default path: 21.81 MB, against 21.76 MB for the translations the runs above used.XCL_DIRECT_DXIL=1: 18.28 MB (-16 %; 11-35 % a program, none for the one the default path already sends there). - Releasing pipelines that are not in use (longest unused first; one in a recorded list is kept until its allocator is reset): not enough by itself. Nearly all of the code is in recordings at the same time. Removed at 132 s and 200 s, against 134-141 s without. A version that released more, and built again at each bind, was not removed in one run of 217 s, at the cost of 3,000 releases. Earlier ones that ran longer skipped 60 % of the dispatches (a blue picture).
What would fix it
- Less compiled code in use at once on 32-lane GPUs: the sum over what one list binds, next to the compile time of the biggest program ([OFFICIAL] Looking for PRs with shaders optimization #1269).
- Then releasing unused pipelines, for the rest of a session. I have a first version of that and can make it a PR.
Helpful now: the test on other cards and drivers (AMD and Intel too): at how many MB, if at all? And whether nvwgf2umx.dll returns E_INVALIDARG in your removal.
Not tested
Other cards, drivers and titles; that the removals others report are this one; the title with XCL_DIRECT_DXIL=1.
The test
10-20 minutes the first time; it ends with a removed device. MODE=drop and MODE=unused are the other two rows.
cargo test --release -p xcl --test shader_code_limit -- --ignored --nocapture
crates/xcl/tests/shader_code_limit.rs
//! How much shader code of pipelines in use the driver takes before it removes the device.
//!
//! cargo test --release -p xcl --test shader_code_limit -- --ignored --nocapture
//!
//! `MODE`: `keep` (default; each pipeline dispatched once and kept), `drop` (dispatched once and
//! released), `unused` (made and kept, never used). `COUNT` pipelines (600), `STMTS` statements a
//! program (3000: about 1.7 MB of compiled code on an RTX 2070 SUPER), `THREADS` (5).
//! Every program is compiled by the driver: 10 - 20 minutes the first time.
use windows::core::Interface;
use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0;
use windows::Win32::Graphics::Direct3D12::*;
use windows::Win32::Graphics::Dxgi::Common::DXGI_SAMPLE_DESC;
struct Shared<T>(T);
unsafe impl<T> Send for Shared<T> {}
unsafe impl<T> Sync for Shared<T> {}
fn var(k: &str, d: usize) -> usize {
std::env::var(k).ok().and_then(|v| v.parse().ok()).unwrap_or(d)
}
/// A program no other one shares code with.
fn program(k: usize, stmts: usize) -> String {
let mut h = String::from("RWByteAddressBuffer u : register(u0);\n[numthreads(1, 1, 1)] void main() { uint x = u.Load(0);\n");
for i in 0..stmts {
let c = ((k * stmts + i) as u32).wrapping_mul(0x9E37_79B1) | 1;
h += &format!("{{ uint y = u.Load((x & 1023u) * 4u); x = (x * {c}u) / (y | 1u) + (y >> {}) % (x | 1u); }}\n", 1 + i % 13);
}
h + "u.Store(4, x); }"
}
#[test]
#[ignore = "takes minutes and ends with a removed device on some drivers"]
fn how_much_shader_code_the_driver_takes() {
let (stmts, count, threads) = (var("STMTS", 3000), var("COUNT", 600), var("THREADS", 5));
let mode = std::env::var("MODE").unwrap_or("keep".into());
unsafe {
let mut dev: Option<ID3D12Device> = None;
D3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, &mut dev).unwrap();
let dev = dev.unwrap();
let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC::default()).unwrap();
let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
let alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &alloc, None).unwrap();
list.Close().unwrap();
let desc = D3D12_RESOURCE_DESC {
Dimension: D3D12_RESOURCE_DIMENSION_BUFFER,
Width: 65536,
Height: 1,
DepthOrArraySize: 1,
MipLevels: 1,
SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
Layout: D3D12_TEXTURE_LAYOUT_ROW_MAJOR,
Flags: D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS,
..Default::default()
};
let heap = D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() };
let buffer = || {
let mut r: Option<ID3D12Resource> = None;
dev.CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_COMMON, None, &mut r).unwrap();
r.unwrap()
};
let (a, b) = (buffer(), buffer());
let param = [D3D12_ROOT_PARAMETER {
ParameterType: D3D12_ROOT_PARAMETER_TYPE_UAV,
ShaderVisibility: D3D12_SHADER_VISIBILITY_ALL,
Anonymous: D3D12_ROOT_PARAMETER_0 { Descriptor: D3D12_ROOT_DESCRIPTOR { ShaderRegister: 0, RegisterSpace: 0 } },
}];
let mut sig = None;
D3D12SerializeRootSignature(&D3D12_ROOT_SIGNATURE_DESC { NumParameters: 1, pParameters: param.as_ptr(), ..Default::default() }, D3D_ROOT_SIGNATURE_VERSION_1, &mut sig, None).unwrap();
let sig = sig.unwrap();
let rs: ID3D12RootSignature = dev.CreateRootSignature(0, std::slice::from_raw_parts(sig.GetBufferPointer() as *const u8, sig.GetBufferSize())).unwrap();
let shared = Shared((dev.clone(), rs.clone()));
let next = std::sync::atomic::AtomicUsize::new(0);
let (tx, rx) = std::sync::mpsc::sync_channel::<Shared<(ID3D12PipelineState, usize)>>(8);
std::thread::scope(|scope| {
for _ in 0..threads {
let (tx, next, shared) = (tx.clone(), &next, &shared);
scope.spawn(move || loop {
let k = next.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
if k >= count {
return;
}
let code = xcl::gpu::recomp::dxc::compile(&program(k, stmts), "main", "cs_6_0", &[]).expect("DXC");
let shared = &shared.0;
let desc = D3D12_COMPUTE_PIPELINE_STATE_DESC {
pRootSignature: std::mem::transmute_copy(&shared.1),
CS: D3D12_SHADER_BYTECODE { pShaderBytecode: code.as_ptr() as _, BytecodeLength: code.len() },
..Default::default()
};
let Ok(p) = shared.0.CreateComputePipelineState::<ID3D12PipelineState>(&desc) else { return };
let size = p.GetCachedBlob().map_or(0, |b| b.GetBufferSize());
if tx.send(Shared((p, size))).is_err() {
return;
}
});
}
drop(tx);
let (mut kept, mut total, mut n) = (Vec::new(), 0usize, 0u64);
for Shared((p, size)) in rx.iter() {
n += 1;
total += size;
alloc.Reset().unwrap();
list.Reset(&alloc, None).unwrap();
if mode == "unused" {
list.CopyBufferRegion(&b, 0, &a, 0, 64);
} else {
list.SetComputeRootSignature(&rs);
list.SetPipelineState(&p);
list.SetComputeRootUnorderedAccessView(0, a.GetGPUVirtualAddress());
list.Dispatch(1, 1, 1);
}
list.Close().unwrap();
queue.ExecuteCommandLists(&[Some(list.cast().unwrap())]);
let _ = queue.Signal(&fence, n);
let start = std::time::Instant::now();
while fence.GetCompletedValue() < n && start.elapsed().as_secs() < 10 {
std::thread::yield_now();
}
if mode != "drop" {
kept.push(p);
}
let state = dev.GetDeviceRemovedReason();
if n % 32 == 0 || state.is_err() {
println!("{mode}: {n} pipelines, {} MB of driver blobs, device {}", total >> 20, state.as_ref().err().map_or("ok".into(), |e| format!("removed ({:#x})", e.code().0)));
}
if state.is_err() {
std::process::exit(3);
}
}
println!("{mode}: all {n} pipelines, {} MB of driver blobs, device ok", total >> 20);
std::mem::forget(kept);
});
}
}AI use: Claude Code (Claude Opus 5.5) did the diagnostics, wrote the test, ran everything on my PC and wrote this.
Activity
VolenNakov commentedon Nov 25, 2026
The test on a second card and driver: the same limit.
MODE=keep(defaultCOUNT,STMTS,THREADS), one run: device removed (0x887a0005) at 261 pipelines, 446 MB of driver blobs, the line before at 256 pipelines / 438 MB with the device fine.main68a284awith onlycrates/xcl/tests/shader_code_limit.rsfrom this issue added. About 8 minutes for the test itself.Fits what I saw in the title on this card: the #2057-based trees (giant compute programs whole) lost the device at the world load in every run, and plain
mainwith the compute splitting (06c9f55, #2329 on top for one) has not, in 3 runs of up to 600 s after the first#101(the title then waits on cold whole-form compute builds, the #2372 case). Not run:MODE=drop/MODE=unused; whethernvwgf2umx.dllreturnsE_INVALIDARGhere.AI use: Claude Code (Claude Opus 5.5) ran the test on my PC and wrote this comment.
STmihan commentedon Nov 25, 2026
RTX 3070 Ti 8 GB (Ampere), driver 621.14: removed at 262 pipelines, 448 MB, the same limit as on the 2070 SUPER and the 4060 Ti 16 GB.
Ryzen 7 5800X, 64 GB RAM, Windows 11 26100.
shader_code_limit.rsfrom this issue, unchanged, on a local tree based onmainplus open PRs (the test only usesd3d12and DXC, nothing of the tree's translator), release,MODE=keep, defaultSTMTS=3000,THREADS=14:Ran
keeponly, once; notdroporunused, and no hook onnvwgf2umx.dll.AI use: Claude Code ran the test and wrote this.
Ariorh1337 commentedon Nov 25, 2026
@veyn-sudo the test and the title on an RTX 5090 (driver 32.0.16.1692): the same limit, and the title's removal after the first
#101meets it.Setup: RTX 5090 32 GB, Ryzen 7 9800X3D, 64 GB RAM, Windows 11 26300, release, DXC 1.9.2609.
Your test (
shader_code_limit.rsas posted, onmain06c9f55, defaults:MODE=keep, 3000 statements, 5 threads):That's about 1.75 MB per pipeline, close to your 2070 SUPER (262 pipelines, 449 MB).
The title (retail 1.0.2.1, warm caches, through the menus): I added a local count of the
GetCachedBlobbytes of every translated pipeline when it is first bound. Releases aren't subtracted, so it is an upper bound for the translated part only. Per 2 s:#101)0x887a0005So the title is removed at 436 MB of translated code, and your test at 439 MB on the same card. DRED here reports the removal as a "page fault at GPU VA 0x0" with no allocation. That fits a removal the driver sets itself rather than a real fault.
This also explains what I listed in #505 as not being the cause. Refusing the BVH builder, ActivateRays / ActivateProbes or ScreenProbes_Inject left the rest above the limit. Serialized submissions only delayed it. Cold caches got further because pipelines still building don't count.
AI use: Claude Code (Claude Opus 5.5) added the local count, ran the test and the title on the machine above (I pressed through the menus) and drafted this.
Berserker64 commentedon Nov 25, 2026
RTX 3080 10 GB (Ampere), driver 621.24: removed at 262 pipelines, 448 MB (
0x887a0005), the same limit as the other cards.Ryzen 9 5950X, 32 GB RAM, Windows 10 Pro 19045.
shader_code_limit.rsfrom this issue, unchanged, on a local tree based onmainc4d37beplus open PRs (the test only usesd3d12and DXC), release,MODE=keep, defaults:No Display 4101 or nvlddmkm event in the System log at the removal. Ran
keeponce; notdroporunused, and no hook onnvwgf2umx.dll.The retail title's removals on this card (
0x887a0007, 56–94 s into about half its runs) are not this limit: in a run removed at 66 s, the title's pipelines in use came to under 1 MB ofGetCachedBlobcode (20 pipelines); runs that went on to 100 s reached 62–81 MB.AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this.
humsterbumster commentedon Nov 25, 2026
A second platform for the same wall, with the title rather than the test: Linux, RTX 5090 32 GB, driver 620.73.04, Wine 11 / Proton 11, vkd3d-proton 3.2.0 (
ec20719). Every tree and cache state I have ends the same way, at 268 – 349 s of world load, and the compile history is what moves the time.main3f4495a0x887a0005at 328 smain3f4495amsvcrt.dllat 267 s3ceb550+ #541 + #1803 + mimallocmsvcrt.dll+0xa4fbat 268 s3ceb550+ #541 + #1803 + mimalloc0x887a0005at 309–337 s4df1e6e+XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=10x887a0005at 309 s, then0x80000003game+0x2474606Two things match the issue:
2,420,640 B DXILcompute PSO starting at 323.7 s, the title's activity falling to 0 draws, and the device gone at 328.5 s. The fence the title waited on never advanced in 10 s (1 writes after the GPU ... after 10000 ms), the DMA-fault picture jessenic showed in Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505.msvcrtfault on a host-side copy, or the title idle in its own gated waits). The heap fills with the code the world needs whether it was compiled in this run or loaded from a blob.On this box the two ways past it that do not need new code also fail:
XCL_PSO_WAIT_MS=1 XCL_PSO_IMAGE_SKIP=1keeps the device alive to 365 s but skips 57,415 of 66,125 dispatches (87 %), so the loading cards and the intro's credit overlays draw and no geometry does;XCL_DIRECT_DXIL=1(the −16 % you measured) is already in every leg above.So a Linux/NVIDIA data point for "releasing pipelines is the rest of the session": I would take your first version of it. If it helps testing, my legs are reproducible in ~6 minutes each from a saved profile; the failures are 100 % — 8 of 8 runs since the tree moved past
aa9ab8a.AI-assisted (omp / DeepSeek V4.1 Flash 1017), nv-linux class. No game data attached.
razormontana commentedon Nov 25, 2026
I'm taking the split scratch allocation fallback. When a list's existing scratch can hold one workgroup, failed growth can use that buffer in smaller slabs. This avoids requesting a whole compute PSO on that path, which bears on the driver's live shader-code pressure. I'll add a regression for failed allocation.
Assisted by Codex (GPT-6.2 and GPT-6.2 Astra).
NWProgramming00 commentedon Nov 25, 2026
The test on a Blackwell card and on an AMD iGPU. The RTX 5070 Ti has the same total limit, and in front of it a limit on one program: a compute pipeline whose code is over about 1 MB is refused with
E_OUTOFMEMORYat creation, so the test's default 1.7 MB programs never get made there. The AMD iGPU kept all 600 default programs.Setup
main68a284awith onlycrates/xcl/tests/shader_code_limit.rsfrom this issue added, plus three local changes:CreateComputePipelineStateis printed (the test returns silently there);XCL_ADAPTER=radeonpicks the first AMD adapter.RTX 5070 Ti
STMTSCOUNT/THREADS0x8007000E(E_OUTOFMEMORY) atCreateComputePipelineState, soall 0 pipelinesand no removal0xc0000005, afterthread '<unknown>' has overflowed its stackfrom threads the test does not name (the driver's);RUST_MIN_STACK=64 MiBdid not change it0x887a0005at 768 pipelines / 448 MB of driver blobs; the line before: 736 / 429 MB, device fineE_OUTOFMEMORYwith no device removal. A title program that compiles to more than that would get no pipeline on this card at all.AMD Radeon RDNA2 iGPU
MODE=keepwith the defaults (600 programs, 3000 statements): all 600 pipelines made, dispatched and kept, device fine (1,454 s).GetCachedBlobreturns an empty blob on this driver, so the test prints 0 MB. How much code that is, I could not read.Not tested
MODE=dropandMODE=unusedon the RTX 5070 Ti with 1000-statement programs.AI use
Diskuss commentedon Nov 25, 2026
RX 9070 XT (RDNA4): no device removal. AMD has a cap of about 4 GB of shader code, not 512 MB. At the cap,
CreateComputePipelineStatereturnsE_OUTOFMEMORYand the device stays fine. Releasing pipelines lets new ones be created again.AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.7029; Ryzen 7 5700X3D, 32 GB RAM; Windows 11 26300; DXC 1.9.2602.17; release build.
main06055a7with only the test files added.The test as given:
cargo test --release -p xcl --test shader_code_limit -- --ignored --nocapture,MODE=keep,THREADS=14, other settings at their defaults. All 600 pipelines were made, dispatched and kept, and the device stayed fine (1286 s).GetCachedBlobis empty on this driver, so the test prints 0 MB throughout.Measured instead: I used a copy of the test with
IDXGIAdapter3::QueryVideoMemoryInfo(local and non-localCurrentUsage) printed against the start, plus a refill step (shader_code_mem.rs, otherwise the same programs and loop). Non-local usage stayed at +0 MB in every run.keep, 600 × 3000 statementskeep, 1800keep,COUNT=24000x8007000E, device finedrop, 200 (each released after its dispatch)STMTS=12000/24000, 14 eachQueryVideoMemoryInfodoes not go down after a release (the blocks stay allocated). Bigger programs (5–10 MB) get their own allocation, which is freed at release.CreateComputePipelineState, not at the first dispatch.MODE=unusedwas not run. On NVIDIA the code counts from first use.For XCL: on AMD the limit shows up as
E_OUTOFMEMORYat creation, so a fallback that releases unused pipelines and retries the creation would work there. I did not test whether the retail title's code comes near 4 GB.Not run:
MODE=unused; the retail title; RDNA3.Time: about 2 h 27 min of measurement runs on the GPU (8835 s over 9 runs); about 2 h 35 min from the claim to this edit.
AI use: Claude Code (Claude Opus 5.5), report from a real run on this machine.
milesah3ad commentedon Nov 25, 2026
Which changes shrink the compiled code that fills the 512 MB heap: #1901 cuts it 3.5–6× on synthetic programs, heap windows halve it, and the direct DXIL backend doesn't shrink it here (larger for cross-lane code). The same programs in eight forms, measured by
GetCachedBlobsize, the proxy this issue uses. No title.Setup: RTX 5080 16 GB (Blackwell, 32-lane waves → split wave64), driver 621.24; Ryzen 7 9800X3D; Windows 11 Pro 26300; DXC 1.9.2609.5; release. Trees:
main2898511, #1901 head5064119, #2368 headc685e12. 20 synthetic compute programs per form, from thenv680generator (base,atomic,loop,wave= av_readlaneper round,loopx= a loop with a lane read and a ballot every trip). Each at 250 and 1000 rounds (about 3k–15k console instructions), 2 seeds, 4 memory windows. OneCreateComputePipelineStateeach with the ABI root signature, thenGetCachedBlob.maindefaultmain, HLSL, switch windows (default)main, HLSL,XCL_HEAP_WINDOWS=1main,XCL_DIRECT_DXIL=1, switchmain, direct, heap windowsCompiled blob per shape (MB, the 4 programs of each shape summed):
mainHLSL switchmainHLSL heapmaindirect switchmaindirect heapReading
waveshape (lane reads). That differs from the −16 % in the description on 14 retail programs, so it may depend on how much cross-lane code a program has. Worth checking on the title's world-load set before counting on the direct route for this limit.main). Its heap form gives byte-identical blob sizes to directmaindespite slightly different DXIL.Not tested: retail programs (the shares here say nothing about the title's mix), whether blob size before the first dispatch equals what the heap charges after it, AMD / Intel, #1901's run-time cost on Ada / Ampere (see @brandostrong on #1901).
AI use: Claude Code (Claude Opus 5.5) wrote the probe, ran it on the machine above and wrote this report. I checked the numbers against the logs.
wayback94 commentedon Nov 25, 2026
The test on Linux under Wine + vkd3d-proton, and on Windows on the same card. Linux: all 600 default pipelines with the device fine, in 5 runs (
keepcold and warm,drop,unused, andkeepon Proton's own vkd3d-proton). Windows, same RTX 3080: removed at 262 pipelines / 448 MB (0x887a0005), the same as @Berserker64's 3080 and @STmihan's 3070 Ti.So the test does not reach this limit through vkd3d-proton on this card, although @humsterbumster's title runs on Linux + NVIDIA end with
0x887a0005. vkd3d-proton'sGetCachedBlobreturns nothing here (0 MB throughout, like the AMD iGPU above), so only the pipeline count compares: 600 against 262. This doesn't tell apart a Vulkan driver without that heap, a higher limit, or smaller code made from these programs through DXIL → SPIR-V. It also doesn't say the title's removal on Linux is something else: its programs, and how many it keeps in recordings at once, differ from the test's.Linux
main3ceb550+ onlycrates/xcl/tests/shader_code_limit.rsfrom this issue, cross-builtx86_64-pc-windows-gnu, release; defaultsMODE=keep COUNT=600 STMTS=3000 THREADS=5.keepkeepdropunused2576c0b4)keepEvery run printed
0 MB of driver blobs, so the MB column of the other reports has nothing to compare with here.The title on Linux (2 runs): it stops before the world's code could reach the limit, on something else, at the same place both times. Tree
3ceb550+ #684 (a local merge, socopy_fromdoesn't end it first), defaults (noXCL_DIRECT_DXIL),XCL_ACTIVITY=1, 480 s each, A pressed on a controller through the menus into story loading. vkd3d-proton v3.1 with #257's patch and its own dxil-spirv (none of the #1805 patches).xcl-pso-pre-2); the title goes onID3D12GraphicsCommandList10::#101stub call (#505's marker)xcl-pso-pre-3)GPU fences still pending after 10 s, exit 0XCL_RUN_SECONDSends it.0x887a0005, no crash in either run. Local video memory about 9.0 GB of 10 GB at the end.So on this setup the stack overflows of #1805 come first; whether the heap limit follows on Linux needs a dxil-spirv with those patches, as @humsterbumster's vkd3d-proton 3.2.0 runs had.
Windows (same commit and test file, Windows 11 Home build 26300.9974, driver 621.14, DXC 1.9.2602.17)
keep, coldkeep, warm (right after)dropunusedHardware: NVIDIA GeForce RTX 3080 10 GB (Ampere, 32-lane waves), Intel i7-13700K, 32 GB RAM; dual boot, the same machine for both.
Not tested
dropandunusedon Proton's own vkd3d-proton.COUNTorSTMTSon Linux, to see whether a limit shows up further out.nvwgf2umx.dllreturnsE_INVALIDARGat the Windows removal.XCL_DIRECT_DXIL=1.AI use: Claude Code (Claude Opus 5.5) set up and ran the Linux test and the title run (I pressed the buttons) and read the logs, a second Claude Code session (Claude Opus 5.5) ran the Windows one; Claude Code (Claude Opus 5.5) wrote this comment from the logs.
S1m0ne1997 commentedon Nov 25, 2026
@veyn-sudo Data from an RTX 4090 24 GB (driver 621.40), and a change that cuts the compiled code of the biggest programs, your point 1.
The removal on this card: in the title (direct DXIL, heap windows),
GetCachedBlobbytes of the pipelines bound so far, counted at first bind:All removals:
0x887a0005, DRED page fault at VA 0 with no allocation, as you describe.The change: the window of a memory access is its base's.
lower_window.rs,window_at). So every access gets its own window index, compare and heap handle, and accesses off the same base share none of them.gpu::umaalready guarantees that allocations never straddle a 4 GiB window. So an access inside its allocation never carries or borrows, and its window is its base's window, with the low dword taken mod 2³².GetCachedBlob), 12 programs per family:CS_RaytracingResolveCS_IrradianceCache_ShadeCS_ShadowRenderTiledgpu_window_at_32bit_carry_edge_cases, and the carry/borrow cases ofgpu_{memory,heap}_windows_reject_out_of_uma_aliasing. They would need to be changed along with it; the other 29 window tests pass on the direct path.XCL_WINDOW_NO_CARRY=1, off by default. It stacks with Recompiler: direct DXIL reads heap memory windows without a branch #2427: removing both the window branch and the carry measured −21 % on twoRaytracingResolveprograms.Coordination: this attacks "less compiled code in use", your release of unused pipelines attacks the rest of the session, and the two seem to add up. Is anyone working on code size on your side, so we don't overlap? I can run your
shader_code_limittest on the 4090 if a second NVIDIA generation helps.AI use: Claude Code (Claude Opus 5.5) wrote the change, the measurement tool and the counter, ran the title on the machine above (I pressed through the menus) and drafted this.
gefydev commentedon Nov 25, 2026
A measurement that bears on the size of the code in use, from a 32-lane card. It does not run the title.
Setup: GTX 1650 (driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, Windows 11 26300, DXC 1.9.2602.17, release build of a branch based on
main3f4495a(not the newestmain). The same 143 compute programs of a retail shader pack each time (xcl shaders <pack> --precompile --only cs --limit 22300 --pipelines, split wave64, 4 memory windows), a new emptyXCL_DXIL_CACHEfor every run. The size is the sum of the 143.psofiles the pass saves, which are theGetCachedBlobbytes of each pipeline made by the driver.XCL_DIRECT_DXIL=1XCL_HEAP_WINDOWS=1All 143 compile in every run, 0 errors, 0 refused by the driver.
Next I will look at what the split wave64 form adds on 32-lane cards, since it is the other part of what these programs are made of.
AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev.
humsterbumster commentedon Nov 25, 2026
A second Linux box agrees with @wayback94's run: the 512 MB heap does not show through vkd3d-proton here either, and our own accounting of the code the title asks for is far below it.
RTX 5090, NVIDIA 620.73.04, Proton 11's Wine, vkd3d-proton 3.2.0 (
ec20719, dxil-spirv7c04863,-Db_ndebug=true), DXC 1.9.2609.5,XCL_DIRECT_DXIL=1, warmvkd3d-proton.cache, A pressed on the loading cards.Sum of the DXIL of every translated console compute program a run builds (
compute PSO with the translated console CS (N B DXIL)), per run:main3f4495a0x887a0005at 349 smain3f4495a+ #541 + #1803 + mimalloc0x887a0005at 344 s3ceb550+ #541 + #1803 + #684 + mimalloc0x887a0005at 337 smsvcrt.dll, or a stallEven if the driver's machine code were an order of magnitude larger than the DXIL it comes from, that is nowhere near 512 MB, and
GetCachedBlobreturns nothing here (0 MB), as @wayback94 saw. So on this setup the removal is not the heap being full of code.What is in front of it every time is a fence the GPU never reaches:
Latest instance: 332.9 s on
3ceb550+ #541 + #1803 + #684 + mimalloc. It lands seconds after a large driver compile (up to 2.4 MB DXIL) on the trees that reach it, which is why it reads like a heap effect on Windows, but nothing on this side shows the code volume.Two more things from the same runs, for whoever picks the Linux side up:
main6d12f58the title dies earlier, in dxil-spirv's structurizer (CFGNode::find_common_post_dominatorreading a null post-dominator on anxcl-psoworker, 182–196 s, 3/3). Revertingc685e12(Recompiler: flatten direct DXIL root-UAV loads for compute #2368) makes it go away in 2/2 runs; reported with the details on Recompiler: flatten direct DXIL root-UAV loads for compute #2368.XCL-side eviction of unused pipelines is not possible as described: XCL keeps no reference to the title's pipeline objects (only address sets), soforget_psoruns only when the title releases, and the code is freed only when the last reference goes. The only lever XCL has is not creating a real pipeline at all (the stand-in path), which is already there.Logs stay local (they contain title data).
AI use: omp (DeepSeek V4.1 Flash 1017) ran the builds and the legs, summed the DXIL from the logs, and wrote this comment.
Eterst commentedon Nov 25, 2026
Same limit on another card and driver: RTX 4070 SUPER 12 GB, driver 616.92, Windows 10 19045 (i7, 32 GB, release build of a tree based on
main06055a7).shader_code_limit(defaultMODE=keep):The retail title's late removal here looks like the same one. It comes at the same point of the title in every run (the last frame before it is 2,300–2,480, at 261–303 s depending on the settings), with
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1:XCL_DRED=1: page fault VA0x0, no allocations; no list left unfinished in the breadcrumbs.GetDeviceStateevents (id 182, fieldDeviceState) for the title's device read1until 169 ms before the runtime's last event and6from 68 ms before it, so the DMA fault state as in Recompiler: bound descriptor heap indices from T# and S# words to the heap #1215, set without a TDR. The last GPU work of the process completed 170 ms before; the trace has no events at all in between, so the moment itself is not in it.Code size, as a data point for "less compiled code in use at once": the driver blobs of a full precompile on this card (
xcl shaders --precompile --only cs --pipelines, thenxcl pipelinesfrom the journal; split wave64,XCL_DIRECT_SPLIT_INSTRUCTIONS=0):308 compute programs are over 1 MB (343 MB together). A GPL-3 layer for the same title, fxceless/victory-fork, reports 3,385 pipelines in a 366 MB pipeline library on an RTX 4070 and no device loss through the part where it is removed here (from its README; not measured by me). If that holds, its code is about a third of ours a pipeline.
Not tested:
MODE=drop/MODE=unused; whethernvwgf2umx.dllreturnsE_INVALIDARGat the removal; the sum of code in use in the title.AI use: Claude Code (Claude Opus 5.5) ran the test, the title runs and the trace, and wrote this; posted with my OK.
42 remaining items
veyn-sudo commentedon Nov 26, 2026
@Kalmarv right,
XCL_HEAP_FLATwas not set, so #2427's form was off in those runs. Here is the split, the same way as before: the 926 used compute records,GetCachedBlobsummed per record, RTX 2070 SUPER, driver 617.14, the same merged tree.XCL_DXIL_OUTLINE=1XCL_DXIL_OUTLINE=1 XCL_HEAP_FLAT=1CS_RaytracingResolverecords (299), all three together give −24.8 % of driver code (247.9 → 186.3 MB); for the others (627), −16.3 %.AI use: Claude Code (Claude Opus 5.5) ran the builds and wrote this.
Kalmarv commentedon Nov 26, 2026
@veyn-sudo thank you for the split, that is exactly what was missing. Each of the three PR descriptions will cite its own step as cumulative and offline, in your order.
AI use: Claude Code, Claude Opus 5.5 wrote this reply.
afpruivo commentedon Nov 26, 2026
RTX 3090 24 GB (driver 621.40): a repeat of @Anon64's 1024 / 2048 MB result on
nvidia-devaf2cecc4(#2590 (comment)), with #2551 instead of the branch's preparation. With a 1 GiB heap the device was removed in 2 of 2 runs (341 s, 199.6 s); with 2 GiB, in 0 of 2 (480 s each). It fits @PetrSeifert's reading above (#2403 (comment)) that the title fills a 1 GiB heap on this tree. Two pairs on one card, so read it as a direction, not a rate.Setup
title: 3c290c16), 480 s,XCL_DIRECT_DXIL=1 XCL_DRED=1, scripted A presses.nvidia-devaf2cecc4+ Shaders: --precompile --pipelines also builds a split program's whole form #25513567b2ef, merged locally (clean). Compute precompiled with--precompile --only cs --pipelines --used-onlyfrom that build. Without Shaders: --precompile --pipelines also builds a split program's whole form #2551 the title stops about 1 s into the world, blocked inChain::whole(Shaders: record and prewarm chain-ABI whole PSOs demanded before world entry #2741 (comment)), and never gets near the heap limit.xcl nvprofile install --mb N(xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590) and read back withxcl nvprofilebefore each run.#101)0x887a0005at 341 s0x887a0005at 199.6 sNot tested: more than two runs per heap; 1.5 GiB; a count of the shader code in use; other cards;
main+ #2551.AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on my machine (the elevated profile writes were mine), read the logs and drafted this. Checked by me before posting.
joeypercia commentedon Nov 26, 2026
RTX 4070 Ti 12 GB (621.40): 1 GiB moves the wall, 2 GiB removes it for these runs. The newer retail title on
nvidia-devaf2cecc4, with split programs' whole forms built in preparation (#2794) and warm caches. The same tree and settings throughout; only the profile's size changed (xcl nvprofile install --mb N, #2590).c044dc6d)Two runs is little, but it fits the 1 GiB runs' compile timing. Not tested: 1.5 GiB, other cards, and whether #2576/#2567-style smaller code gets 1 GiB there too. (Claude Code, Claude Opus 5.5)
einfachama commentedon Nov 26, 2026
RTX 4060 8 GB (Ada), driver 621.24: the test is removed at 262 pipelines / 448 MB, like the other cards. In my retail title the device goes with 359–388 MB of translated code bound, about 90 MB of it graphics.
Ryzen 7 5800X, 32 GB RAM, Windows 11 Pro 26300.9974, DXC 1.9.2602.17, release.
The test (
main06c9f55plus this issue's test file, unchanged, defaults):keepremoved at 262 / 448 MB, the line before 256 / 438 MB;dropandunusedkept all 600 / 1027 MB. So 8 GB of video memory changes nothing here: the same 262 pipelines / 448 MB as the 10 GB 3080 on the same driver, and within one pipeline of the 16 GB 4060 Ti (261 / 446 MB).The title: 139 runs of 240 s, same scripted presses, two builds alternating:
main06c9f55;GetCachedBlobsizes of translated pipelines bound at least once and not released, compute and graphics apart, every second and at the removal.Cache: HLSL path,
XCL_HEAP_WINDOWS=1, compute precompiled on06c9f55, six warm-up runs, and that cache state restored before every run. 368 of each run's 370 large pipelines came with a cached driver blob.0x887a00050x887a0006Waitsplit, and every0x887a0005came 2.5–10.2 s after it (median 4.9).777348c43857fdd2(48 runs), is 40 watchdog runs, 7 removals and one0x887a0006.Not shown: the driver's own heap figure; the cause of any single run; current
main; the 1 GiB heap profile, which I have not tested.AI use: Claude Code (Claude Opus 5.5) ran the test and the title series, wrote the local counter and drafted this comment; Claude Fable 5.2 (in the Claude app) planned the series and checked the numbers. I read and checked this before posting.
b3IKK commentedon Nov 26, 2026
RTX 5080 16 GB (driver 32.0.16.1088): the 2 GiB profile moves the wall from ~100 s to 520 s. Retail 1.0.2.1,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, heap-window cache precompiled (--precompile --only cs --pipelines --used-only, 2,898 pipelines in 322.8 s), stack #24045b9d4ff+ #2519's scratch + #2590'sxcl nvprofile.The 2 GiB run's last split line at 519 s: 3,242 of 36,864 recordings held, under 75 PC allocators; 2,352 put aside with a list on it, 241 in use and free. Local video memory was 21,272 MB against 15,977 MiB (9,010 MB non-local), target pages 10,251 MB; the process committed 44.5 GB. The title presented at ~0.2 fps in the world, as in your 4070 Ti runs, then the device was removed while an
xcl-pso-chain-wholethread was innvgpucomp64.So 2 GiB confirms the code-heap lever here, but on this card the run now ends in the same memory overcommit your runs attribute to #2688 (the recording backlog is the new number to watch). I am testing the
free_asiderelease patch from #2404 on this stack next.One 2 GiB run also hit an early
0xc0000005inVCRUNTIME140.dll(16-byte read at0xc4903a000) at 50 s during texture upload; the next run did not repeat it.AI use: OpenCode, Claude Fable 5.2 ran the precompile and the profile runs, read the logs and wrote this.
b3IKK commentedon Nov 26, 2026
No device removal in 600 s on the RTX 5080. Stack: #2404
5b9d4ff+ #2519's scratch + #2590'sxcl nvprofile install --mb 2048+ KDenKC'sfree_asidepatch (#2404) + the precompiled heap-window compute cache.driver blob absent).used-onlyprecompiled 1,305 programs; the later areas need pipelines it passed over.free_asidepatch presented to 502 s and were removed at 520 s with 36,864 recordings; with the patch the same point passes. The patch'saside_sweep_keeps_recordings_made_after_backing_reusetest passes here.So the 512 MB code heap was the 100–520 s removal; at 2 GiB it is gone on this machine. The remaining world-load walls are the unprecompiled later pipelines and the VRAM overcommit.
AI use: OpenCode, Claude Fable 5.2 ran the precompile, the profile runs and the patched 600 s run, read the logs and wrote this.
b3IKK commentedon Nov 26, 2026
Full compute precompile on the 5080 (2 GiB profile, heap windows, free_aside patch): 2,689 programs, 8,684 pipelines, 0 refused, 0 errors, 9.7 min (3,238 blobs reused from the earlier used-only pass). The 600 s run then presented to 542.1 s with 0 device removals (2,034 frames), but ended in a host
0xc0000005inVCRUNTIME140.dll+0x1aad6, a 16-byte read at0x859810000, at 543.0 s. Local video memory 21,602 MB; target pages 10,640 MB.That is the same crash shape as the one-off 50 s crash in the first 2 GiB run (
0xc4903a000); the 600 s used-only run on the same 2 GiB profile had neither. It looks like a latent XCL window/texture-copy bug exposed by the larger driver reserve, not the code heap. I am switching to the 1 GiB profile to see whether the AV disappears and where the code wall lands with the full precompile.AI use: OpenCode, Claude Fable 5.2 ran the precompile and the 600 s run, read the logs and wrote this.
b3IKK commentedon Nov 26, 2026
1 GiB is the stable profile on the 5080: 600 s, 0 removals, 0 crashes. With the full compute precompile (2,689 programs / 8,684 pipelines), the
free_asidepatch and heap windows:0xc0000005(VCRUNTIME, high-VA 16-byte read) does not occur at 1 GiB.driver blob absent) and a few compute PSOs, so no presents there.So the 1 GiB heap + full compute precompile + the patch carries the title through 600 s without the device removal on this card; the next cold wall is the graphics pipelines that
--only cs --pipelinesdoes not build. I am running a second 1 GiB run on the now-warmer graphics blobs to see whether presentation continues past 420 s.AI use: OpenCode, Claude Fable 5.2 ran the profile comparison and the 600 s runs, read the logs and wrote this.
Recompiler: an access may take its base address's window (XCL_WINDOW_…
xcl run: `xcl nvprofile` puts xcl.exe in an NVIDIA profile with a big…
b3IKK commentedon Nov 26, 2026
Stable world for 600 s: 0 device removals, 0 crashes, frames to 599.2 s on the RTX 5080 (retail 1.0.2.1, Windows 11 26300). The run ended only at XCL's 600 s timer,
exit 0x0.Stack:
5b9d4ff(ExecuteIndirect pieces) + D3D12.X: run split pieces for dispatches with no title allocator or in a bundle #2519's list-keyed scratch,xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590xcl nvprofile install --mb 2048(UAC-approved),c334e77, CopyFromSubresource 7-argument ABI) and D3D12.X: texture workers copy title memory instead of borrowing it #2877's texture-worker copy (D3D12.X: a texture worker faults in detile_level on title memory that title_bytes borrowed #2841),free_asidepatch (D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404),XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1+ the full compute precompile (2,689 programs, 8,684 pipelines).At 600 s: 2,138 frames; 0 whole forms (328 programs split, 2,809 pieces, 32,993 dispatch-chain dispatches in 474,538 slabs; 85,635 ExecuteIndirect chains, 30 of them whole, 0 slabs lost); 118,628 chain recordings, 5,065 held (3,819 put aside with a list); 21,980 MB local video memory, target pages 11,365 MB.
The world presents at ~0.3 fps (32–34 frames per 2 min) — the #2688 VRAM overcommit — but it no longer crashes or stops presenting. This is the first full-window stable world on this machine. The individual pieces are all open PRs/patches; the 2 GiB profile is the only machine-level setting.
AI use: OpenCode, Claude Fable 5.2 installed the profile, ran the 600 s stack, read the log and wrote this.
b3IKK commentedon Nov 26, 2026
Reproduction: a second 600 s run of the same stack just finished
exit 0x0with 0 device removals, 0 crashes, 1,752 frames and the last present at 599.2 s (world at 33–46 frames per 2 min, ~0.3 fps). Same 2 GiB heap, #2404 + #2519 + #684 + #2877 (#2841) +free_aside+ heap windows/full precompile. So the stable world is 2 of 2 runs here, not a one-off.AI use: OpenCode, Claude Fable 5.2 ran the second window and wrote this.
D3D12.X: count the driver code of the pipelines in use (XCL_CODE_IN_USE)
throny commentedon Nov 27, 2026
Data for this issue from an RTX 4080 16 GB (driver 621.40): with the 1 GiB profile of #2590 the device was removed (0x887a0005; DRED: state 0, no page fault, no list in flight) in nine runs, each time when 278-360 MB of DXIL of large pipelines had been built, whether that took 145 s or 588 s. With the profile at 2 GiB the same build and switches ran 900 s twice without a removal. Table and details: #2688 (latest comments). AI use: Claude Code (Claude Fable 5.2).