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.
52 remaining items
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).
xcl run: the memory line and a device removal give the system's commit
xcl run: `xcl nvprofile` puts xcl.exe in an NVIDIA profile with a big…
brainhay5 commentedon Nov 29, 2026
RTX 5070 Ti 16 GB, 610.88: a 2048 MB reserve does not stop it, and no removal is ever logged
Data alongside @Kalmarv's 5070 Ti result above (1 GiB, not removed in 300 s). Same card model and title,
driver 610.88, Windows, retail 1.0.2.1.
0x887a0005nvprofile status→shader heap 2048 MB, binary runs asxcl.exe)XCL_TEXTURE_LEVEL_PAGES=1After the stop, presenting never resumes: GPU 0%, VRAM held, XCL keeps compiling at ~77 % of four cores
for minutes. No TDR is raised on the machine either (Windows Event 4101: none on the day).
That is the part I would like to understand: on this card the 2 GiB reserve does not remove the stop,
while 1 GiB did for @Kalmarv, and no removal ever surfaces in our logs. Two readings I cannot tell
apart:
different failure that happens earlier than the 86–130 s removal, or
logged-in session,
XCL_NETWORK=0 XCL_PREPARE=0).Related observation, which may be downstream and not the cause: every run that gets far enough logs
bridged
Wait64BitValueX ... wait-before-signal(prod=qNone, orprod=qSome(1)/tySome(0)with#851) — but always 9–20 s after presenting has already stopped.
If anyone has the 2048 MB profile confirmed against a 5070 Ti, or sees this early stop without any
removal in the log, that would settle which reading is right. Full logs for every row above are
available.
AI use: an agent ran the builds and runs, read the logs, and wrote this comment.
xcl run: `xcl nvprofile` puts xcl.exe in an NVIDIA profile with a big…
gefydev commentedon Nov 30, 2026
On our GTX 1650 (driver 621.24, 4 GB VRAM, 16 GB RAM), a previous Lockhart run with a 512 MiB shader heap reached device removal (
0x887A0005). With the 1,024 MiBxcl.exeNVIDIA profile, a warmed cache, and a local capture diagnostic, we recorded one 3D world frame. XCL then stopped on a GPU queue wait, with no device removal or OOM logged. Cache state and diagnostic capture differed between runs, so this does not isolate the heap size. Full build, flags, and telemetry in the run report.brainhay5 commentedon Nov 30, 2026
Cross-check from an RTX 5070 Ti (16 GB, driver 610.88) — same signature, so this may be one bug, not two:
XCL_DRED=1with page faults and last operations recorded: no0x887a0005, no device-suspended, no page fault, no breadcrumb — nothing was removed.pending title ID3D12Fences: none,XCL's own queue waits unmet: none,0 GPU waits armed.The one thing that does look like a queue wait: two bridged
Wait64cells recorded at the frame where presenting stopped, both reportingexecuted no, and in one runprod=qNone/ wait-before-signal (the #2443 shape). They are logged 9–20 s after the last present, so I had been reading them as downstream of the stop rather than its cause — your "stopped on a GPU queue wait" is the reason I am asking instead of assuming.Questions that would tie the two cases together:
Wait64on GPU memory?Wait64: was the producer recorded (prod=qSome(…)) or absent (prod=qNone)?0 GPU waits armed?xcl.pdb+ a PDB resolver), which is how I found the presenting thread parked inside the title-texture refresh rather than in the driver.If your queue wait is the same
Wait64with no producer, that is a much better lead than the heap, and it would explain why raising the reserve to 2048 MB changed nothing here.AI use: an agent ran the measurements and wrote this comment.
brainhay5 commentedon Nov 30, 2026
Correction to my comment above, because I got this wrong and the retraction matters for anyone reading it:
I reported that with
XCL_DRED=1(page faults and last operations) there was no device removal, no fault and no breadcrumb. On a pristine install — fresh clone of9dfbe3ea, empty caches, empty build directory, saves restored — the same title on the same card does this:So the device is removed at or near the presenting stop. It becomes visible only when the title next creates a placed resource, ~88 s later. My "no removal" reading was an artefact of inspecting the log at the wrong moment — the removal had happened, nothing had queried it yet — and I withdraw that part of the report.
What stands from the original comment: the presenting thread is inside the title-texture refresh, GPU idle, no pending fences, and raising the shader-code reserve to 2048 MB changed nothing. What changes: the removal is real, so the #2403 / #3277 family is consistent with our case again — but if it is the same removal, it is not the 512 MB reserve alone that decides it, since 2 GB did not help.
Practical note for anyone measuring this: read the log at the end of the run, not when presenting stops. Otherwise the removal is invisible and the case looks like a hang with a healthy device.
AI use: an agent ran the install and measurements and wrote this correction.
xcl run: `xcl nvprofile` puts xcl.exe in an NVIDIA profile with a big…
xcl run: `xcl nvprofile` puts xcl.exe in an NVIDIA profile with a big…
LeonardoS11 commentedon Dec 2, 2026
Data from an RTX 3080 Ti 12 GB (32-lane waves) that fits this issue, including two ETW traces of the removal. The raised-heap run is not done yet; I will edit this comment with it.
Setup. RTX 3080 Ti 12 GB, driver 32.0.16.2140, Ryzen 9 5900X, 64 GB, Windows 11 Pro 26200.
mainf07e426dand the nvidia-dev batch65e17cc4, release builds, plus local commits that only add diagnostics and scripted input. The newer retail title, Series S profile (lockhart),XCL_RAYTRACING=off XCL_TEXTURE_LEVEL_PAGES=1 XCL_NETWORK=0, default 4-window layout onmain. No NVIDIA profile forxcl.exe(default shader heap). Same save in every run: it loads into the city, then scripted walking.What happens.
main: the device is removed in every run that reaches the world (more than 20 runs):0x887a0005, 11-55 s after the world starts, frames 1786-2226. About 3-5 fps in the world until then.65e17cc4: removed in 2 of 2 runs, frames 1997 and 2190 (121 s and 190 s after the world starts).XCL_DRED=pagefault: device state 0, no page fault. Nothing in the Windows System log (no 4101, no nvlddmkm, no LiveKernelEvent). D3D12 debug layer on: no message at the removal.ETW (wpr, Microsoft-Windows-Direct3D12 and DXGI providers), two removals.
ID3D12CommandQueue::ExecuteCommandListsthe D3D12 journal logsUMD reported device removed.with HRESULT0x88760870, thenRemoving device.with0x887A0005. That Execute returns 3 ms after it began; the ten before it on the same queue took under 0.1 ms each.GetDeviceRemovedReason) found the device alive 34 ms before the removal, with noUpdateTileMappingsin between.nvwgf2umx.dll, so noE_INVALIDARGreading.Ruled out on
main, one run each (the removal came the same way): VRAM over budget (8.5-9.0 of 10.4 GB), NVIDIA's DXCache (4.25 GB moved away),XCL_TWO_PASS_MB=2048,XCL_TEXTURE_LEVEL_PAGESoff,XCL_PAGE_MAPPINGS=0,XCL_VIEW_KEEP=1,XCL_SKIP_CSof the six compute programs recorded last in every removal (it only came earlier), deferring the parked tile unmaps, the GPU virtual address space (the title uses about 40 GB of 1 TiB), the number of reserved resources (200 thousand with 3.2 million mapped tiles in an isolated test: fine), handles and GDI objects, and making the sparse queue wait for the title's queues before mapping (waiting on the GPU hangs the title; waiting on the CPU changes nothing).Not tested yet: the shader heap raised with
xcl nvprofile(#2590), and the sum of the driver blobs of the pipelines in use at the removal. Both are next.AI use: Claude Code (Claude Fable 5.2) ran the tests, read the traces and wrote this comment.