Device lost after ~60k live PSOs: "Kernel memory failure" from D3D12 debug layer (RTX 4060 Laptop, 8 GB) #1333

Open
opened 2026-11-26 04:51:02 +00:00 by github-bot · 8 comments
Owner

@⁠packwka22 on GitHub · 2026-11-24 14:54 UTC · original

Third run, this time with d3d12_debug = true (everything else unchanged, shader cache warm, uma_mb = 0 → 4095 MB coherent window again). The debug layer caught something right before the device loss. report.json and xcl.log attached (user name and XUID redacted).
The interesting part: kernel memory failure 2 s before the device is lost

[ 140.264][11456][WARN ] D3D12 debug layer (error, id 834): Kernel memory failure. There might be a memory leak.
[ 140.265][11456][WARN ] D3D12 debug layer (warning, id 274): Live ID3D12Device at 0x0000000003801DE0, Refcount: 128417
[ 140.271][11456][WARN ] D3D12.X: QueryInterface(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a) – interface unknown on the PC (console-only?)
[ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live            ID3D12PipelineState :  60029
[ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live                 ID3D12Resource :  67107
[ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live                     ID3D12Heap :   3974
[ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live            ID3D12RootSignature :    109
[ 142.215][ 5816][ERROR] D3D12 device removed: 0x887a0007 …

60 029 live pipeline states is about the size of the whole background pipeline queue (background_pipelines: [1266, 0, 57495] in the report). My guess: with a warm DXIL cache, XCL creates most of the ~58k PSOs in the background within a couple of minutes, and on this 8 GB laptop GPU the driver runs out of kernel memory, which then shows up as DEVICE_RESET / DEVICE_HUNG.
This would also explain the odd ordering of the three runs — the faster PSOs can be created, the sooner the device dies:
Run Shader cache Debug layer Device lost at Error
1 cold (DXC compiling, up to 3 s per PSO) off 197.3 s 0x887a0006
2 warm off 102.9 s 0x887a0007
3 warm on (slower) 142.2 s 0x887a0007
In all three runs the frame rate collapses for 20–50 s before the loss (run 3: 21.7 fps at 91 s, then ~3 fps until 142 s), while audio keeps decoding normally — consistent with the driver paging or running short of memory. I only have the live-object counts for run 3, so this is a hypothesis, not proven.
If there is a way to cap or turn off background pipeline creation, I can rerun with it to test this.
Other debug-layer errors (all early in the run; the title kept going for another ~130 s)
Message counts are as logged; the debug layer may only log the first few of each.
id 1047, race on the sparse queue (×8, from UpdateTileMappings and ExecuteCommandLists): "Simultaneous-access or Buffer Resource … is still referenced by write GPU operations in-flight on another Command Queue … It is not safe to start write GPU operations now on this Command Queue (…'xcl sparse queue')."
id 538, wrong resource state (×8): e.g. ClearRenderTargetView on a resource in UNORDERED_ACCESS instead of RENDER_TARGET; also CopyResource and Draw.
id 1422, uninitialized placed resource (×4): an RT/DS placed resource with CREATE_NOT_ZEROED used by DrawInstanced before any Discard/Clear/Copy.
id 824, Map on a reserved resource (×8): "Map and Unmap can not be called on a resource created with the CreateReservedResource API."
Same as before
Failed DirectStorage read 0x89240009, this time the same file as in run 1: G:\.\data\ttdb\vfx\ttdb_vfx.ttpf (24576 bytes, at 107.8 s).
A new console-only QueryInterface right before the loss in run 2 (3febd6dd-…, 0.06 s before) and run 3 (310d36a0-…, 2 s before). Probably the game reacting to the failing device rather than a cause, but noting it.
Best FPS so far: 30.0 over the first 600 frames, 1966 presents in total.

report.json
xcl.log

**@⁠packwka22** on GitHub · 2026-11-24 14:54 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333) Third run, this time with `d3d12_debug = true` (everything else unchanged, shader cache warm, `uma_mb = 0` → 4095 MB coherent window again). The debug layer caught something right before the device loss. `report.json` and `xcl.log` attached (user name and XUID redacted). The interesting part: kernel memory failure 2 s before the device is lost ``` [ 140.264][11456][WARN ] D3D12 debug layer (error, id 834): Kernel memory failure. There might be a memory leak. [ 140.265][11456][WARN ] D3D12 debug layer (warning, id 274): Live ID3D12Device at 0x0000000003801DE0, Refcount: 128417 [ 140.271][11456][WARN ] D3D12.X: QueryInterface(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a) – interface unknown on the PC (console-only?) [ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live ID3D12PipelineState : 60029 [ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live ID3D12Resource : 67107 [ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live ID3D12Heap : 3974 [ 142.206][11456][WARN ] D3D12 debug layer (warning, id 255): Live ID3D12RootSignature : 109 [ 142.215][ 5816][ERROR] D3D12 device removed: 0x887a0007 … ``` 60 029 live pipeline states is about the size of the whole background pipeline queue (`background_pipelines: [1266, 0, 57495]` in the report). My guess: with a warm DXIL cache, XCL creates most of the ~58k PSOs in the background within a couple of minutes, and on this 8 GB laptop GPU the driver runs out of kernel memory, which then shows up as DEVICE_RESET / DEVICE_HUNG. This would also explain the odd ordering of the three runs — the faster PSOs can be created, the sooner the device dies: Run Shader cache Debug layer Device lost at Error 1 cold (DXC compiling, up to 3 s per PSO) off 197.3 s `0x887a0006` 2 warm off 102.9 s `0x887a0007` 3 warm on (slower) 142.2 s `0x887a0007` In all three runs the frame rate collapses for 20–50 s before the loss (run 3: 21.7 fps at 91 s, then ~3 fps until 142 s), while audio keeps decoding normally — consistent with the driver paging or running short of memory. I only have the live-object counts for run 3, so this is a hypothesis, not proven. If there is a way to cap or turn off background pipeline creation, I can rerun with it to test this. Other debug-layer errors (all early in the run; the title kept going for another ~130 s) Message counts are as logged; the debug layer may only log the first few of each. id 1047, race on the sparse queue (×8, from `UpdateTileMappings` and `ExecuteCommandLists`): "Simultaneous-access or Buffer Resource … is still referenced by write GPU operations in-flight on another Command Queue … It is not safe to start write GPU operations now on this Command Queue (…'xcl sparse queue')." id 538, wrong resource state (×8): e.g. `ClearRenderTargetView` on a resource in `UNORDERED_ACCESS` instead of `RENDER_TARGET`; also `CopyResource` and `Draw`. id 1422, uninitialized placed resource (×4): an RT/DS placed resource with `CREATE_NOT_ZEROED` used by `DrawInstanced` before any Discard/Clear/Copy. id 824, Map on a reserved resource (×8): "Map and Unmap can not be called on a resource created with the CreateReservedResource API." Same as before Failed DirectStorage read `0x89240009`, this time the same file as in run 1: `G:\.\data\ttdb\vfx\ttdb_vfx.ttpf` (24576 bytes, at 107.8 s). A new console-only `QueryInterface` right before the loss in run 2 (`3febd6dd-…`, 0.06 s before) and run 3 (`310d36a0-…`, 2 s before). Probably the game reacting to the failing device rather than a cause, but noting it. Best FPS so far: 30.0 over the first 600 frames, 1966 presents in total. [report.json](https://github.com/user-attachments/files/35339139/report.json) [xcl.log](https://github.com/user-attachments/files/35339138/xcl.log)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:51:02 +00:00
Author
Owner

@⁠lemosss on GitHub · 2026-11-24 15:41 UTC · original · edited 2026-11-24 16:09 UTC

Two things that may help here: what the 60 029 live pipelines most likely are, and a measurement of what that many pipelines cost an 8 GB NVIDIA GPU without a game.

What the live pipelines are. In your report background_pipelines: [1266, 0, 57495] is (built, failed, still pending) (pso_async::counts()). A pipeline whose shaders are not compiled yet gets a stand-in at once (real.rs, standin_graphics / standin_compute: the same dummy VS / PS / CS for all of them), and the title keeps that stand-in for as long as it holds the pipeline. So the 60 029 live ID3D12PipelineState are about 57 495 stand-ins plus the 1 266 real pipelines built so far, not 58k pipelines built in the background.

To your question: XCL_PSO_PRELOAD=0 turns off the workers that build an earlier run's pipelines ahead of use (pso_async.rs). It would not lower the live count much, though, since the stand-ins are made whenever the title creates a pipeline.

Measurement (a throwaway test, plain D3D12, no XCL hooks, every pipeline kept alive; process private bytes, system commit, kernel paged / nonpaged pool and QueryVideoMemoryInfo sampled every step)

  • NVIDIA GeForce RTX 4060 8 GB desktop, driver 610.88 (32.0.16.1088); i7-10700K, 16 GB; Windows 11 Pro 26H2, build 26300.9974; no debug layer
  • Stand-in-like pipelines, the stand-in shaders from real.rs dummy() (FXC 5.0), 3 of 4 graphics with varied RT / DS formats, blend and cull, 1 of 4 compute, 4 root signatures: 100 000 created and alive, no failure. ~6 KB of process commit each (71 → 696 MB), kernel paged / nonpaged and local / non-local video memory flat, ~7 µs per pipeline, and the device still ran a queue signal afterwards.
  • Pipelines with their own pixel shader each (a unique small PS per pipeline, so the driver compiles every one, closer to real pipelines): 90 000 created and alive, no failure; the run stopped there only at the test's own safety limit (10 GB of process private bytes on this 16 GB machine). ~115 KB of process commit each (71 → 10 433 MB), ~12.5 ms of driver compile each (the first 20 000 were driver shader-cache hits from an earlier run), kernel paged 538 → 505 MB and nonpaged 760 → 736 MB (flat or down), video memory flat, and the device still ran a queue signal with all 90 000 alive.
live pipelines (own PS) 10 000 30 000 60 000 90 000
process private, MB 1 268 3 574 7 012 10 433
kernel paged / nonpaged, MB 532 / 746 531 / 745 520 / 744 505 / 736
local video memory, MB 6 6 6 6

So on this GPU neither the stand-ins nor the built pipelines grow kernel memory or video memory, even at 90k–100k, and the pipeline count alone does not look like what ran the driver out of kernel memory. Built pipelines do cost ~115 KB of process commit each here, so a run that builds tens of thousands of them would need several GB of commit, but yours had only 1 266 built. The other large counts in the same debug-layer dump, 67 107 live ID3D12Resource and 3 974 ID3D12Heap, may be the better lead (I have not measured those).

Not tested: a laptop / hybrid-graphics RTX 4060 like yours (the driver and memory setup differ), the debug layer's own per-object cost, a retail title, AMD.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠lemosss** on GitHub · 2026-11-24 15:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7136459102) · edited 2026-11-24 16:09 UTC Two things that may help here: what the 60 029 live pipelines most likely are, and a measurement of what that many pipelines cost an 8 GB NVIDIA GPU without a game. **What the live pipelines are.** In your report `background_pipelines: [1266, 0, 57495]` is (built, failed, still pending) (`pso_async::counts()`). A pipeline whose shaders are not compiled yet gets a stand-in at once (`real.rs`, `standin_graphics` / `standin_compute`: the same dummy VS / PS / CS for all of them), and the title keeps that stand-in for as long as it holds the pipeline. So the 60 029 live `ID3D12PipelineState` are about 57 495 stand-ins plus the 1 266 real pipelines built so far, not 58k pipelines built in the background. To your question: `XCL_PSO_PRELOAD=0` turns off the workers that build an earlier run's pipelines ahead of use (`pso_async.rs`). It would not lower the live count much, though, since the stand-ins are made whenever the title creates a pipeline. **Measurement** (a throwaway test, plain D3D12, no XCL hooks, every pipeline kept alive; process private bytes, system commit, kernel paged / nonpaged pool and `QueryVideoMemoryInfo` sampled every step) - NVIDIA GeForce RTX 4060 8 GB **desktop**, driver 610.88 (32.0.16.1088); i7-10700K, 16 GB; Windows 11 Pro 26H2, build 26300.9974; no debug layer - **Stand-in-like pipelines**, the stand-in shaders from `real.rs` `dummy()` (FXC 5.0), 3 of 4 graphics with varied RT / DS formats, blend and cull, 1 of 4 compute, 4 root signatures: **100 000 created and alive, no failure**. ~6 KB of process commit each (71 → 696 MB), kernel paged / nonpaged and local / non-local video memory flat, ~7 µs per pipeline, and the device still ran a queue signal afterwards. - **Pipelines with their own pixel shader each** (a unique small PS per pipeline, so the driver compiles every one, closer to real pipelines): **90 000 created and alive, no failure**; the run stopped there only at the test's own safety limit (10 GB of process private bytes on this 16 GB machine). ~115 KB of process commit each (71 → 10 433 MB), ~12.5 ms of driver compile each (the first 20 000 were driver shader-cache hits from an earlier run), kernel paged 538 → 505 MB and nonpaged 760 → 736 MB (flat or down), video memory flat, and the device still ran a queue signal with all 90 000 alive. | live pipelines (own PS) | 10 000 | 30 000 | 60 000 | 90 000 | |---|---:|---:|---:|---:| | process private, MB | 1 268 | 3 574 | 7 012 | 10 433 | | kernel paged / nonpaged, MB | 532 / 746 | 531 / 745 | 520 / 744 | 505 / 736 | | local video memory, MB | 6 | 6 | 6 | 6 | So on this GPU neither the stand-ins nor the built pipelines grow kernel memory or video memory, even at 90k–100k, and the pipeline count alone does not look like what ran the driver out of kernel memory. Built pipelines do cost ~115 KB of process commit each here, so a run that builds tens of thousands of them would need several GB of commit, but yours had only 1 266 built. The other large counts in the same debug-layer dump, **67 107 live `ID3D12Resource` and 3 974 `ID3D12Heap`**, may be the better lead (I have not measured those). **Not tested:** a laptop / hybrid-graphics RTX 4060 like yours (the driver and memory setup differ), the debug layer's own per-object cost, a retail title, AMD. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠packwka22 on GitHub · 2026-11-24 16:35 UTC · original

Follow-up: same settings (XCL_PSO_PRELOAD=0, no debug layer, uma_mb = 0), but after a reboot, so the system started with far less in use. report.json, xcl.log
This rules out commit exhaustion as the cause of the crash. Peak commit was only 43.8 / 67.5 GB this time (66.2 last run), and the title's own crash reporter logged 24.6 GB of swap free (9.4 GB last run). The crash is still identical, at the same point in the game:

[131.241] unhandled exception 0xc0000005 in game_scarlett_master.exe+0x23cf683 (write at address 0x0) rax=0x0 rbx=0x0 …
          on the stack: +0x4e4ba89, +0x2215c35, +0x71b9a20, +0x2215eca      (run 4: 136.324 s, same address and stack)

Task Manager early in the world mid late end after the crash
RAM in use / available 20.4 GB / 3.1 GB 20.7 / 2.8 22.5 / 0.9 23.2 GB / 308 MB 8.1 / 15.4
Commit 29.8 / 67.5 GB 31.8 40.2 43.8 15.6
Paged / nonpaged pool 748 / 496 MB 801 / 495 947 / 576 1004 / 624 620 / 528
Dedicated / shared GPU climbing / ~2 GB 8 GB full / flat full / growing full / growing —
Physical RAM still ends up full (~15 GB for the run on this 24 GB machine), and dedicated VRAM is full while shared GPU memory keeps growing. But commit and the kernel pools have plenty of headroom, so I'd now drop my earlier "failed allocation under commit pressure" guess.
What lines up with the crash in both runs is a very long compute PSO build right before it, with the title making almost no progress:
Run 4: compute PSO with a 384 860 B DXIL finished at 132.210 s after 10 582 ms; crash 4 s later.
Run 5: that same 384 860 B PSO came from the driver blob in 27 ms, but a new 494 324 B one finished at 131.216 s after 11 645 ms; crash 25 ms later.
In both runs, presents go from 1500 (at ~84–92 s) to only ~50 more before the crash. In run 5 the render-side threads log nothing between 101 s and 131 s apart from that build finishing.
A null write with rax = rbx = 0 right after a 10+ s stall makes me wonder whether this is the title deliberately killing itself, e.g. a watchdog on a stalled frame or render thread, rather than a real bug. That is only a guess, I can't confirm it from the log. If XCL builds these huge compute pipelines on a path that blocks the title's frame, that might be the thing to look at. The 494 KB one is now in the driver blob cache, so I'll rerun to see whether the crash moves later or goes away.

report.json
xcl.log

Two things that may help here: what the 60 029 live pipelines most likely are, and a measurement of what that many pipelines cost an 8 GB NVIDIA GPU without a game.

What the live pipelines are. In your report background_pipelines: [1266, 0, 57495] is (built, failed, still pending) (pso_async::counts()). A pipeline whose shaders are not compiled yet gets a stand-in at once (real.rs, standin_graphics / standin_compute: the same dummy VS / PS / CS for all of them), and the title keeps that stand-in for as long as it holds the pipeline. So the 60 029 live ID3D12PipelineState are about 57 495 stand-ins plus the 1 266 real pipelines built so far, not 58k pipelines built in the background.

To your question: XCL_PSO_PRELOAD=0 turns off the workers that build an earlier run's pipelines ahead of use (pso_async.rs). It would not lower the live count much, though, since the stand-ins are made whenever the title creates a pipeline.

Measurement (a throwaway test, plain D3D12, no XCL hooks, every pipeline kept alive; process private bytes, system commit, kernel paged / nonpaged pool and QueryVideoMemoryInfo sampled every step)

  • NVIDIA GeForce RTX 4060 8 GB desktop, driver 610.88 (32.0.16.1088); i7-10700K, 16 GB; Windows 11 Pro 26H2, build 26300.9974; no debug layer
  • Stand-in-like pipelines, the stand-in shaders from real.rs dummy() (FXC 5.0), 3 of 4 graphics with varied RT / DS formats, blend and cull, 1 of 4 compute, 4 root signatures: 100 000 created and alive, no failure. ~6 KB of process commit each (71 → 696 MB), kernel paged / nonpaged and local / non-local video memory flat, ~7 µs per pipeline, and the device still ran a queue signal afterwards.
  • Pipelines with their own pixel shader each (a unique small PS per pipeline, so the driver compiles every one, closer to real pipelines): 90 000 created and alive, no failure; the run stopped there only at the test's own safety limit (10 GB of process private bytes on this 16 GB machine). ~115 KB of process commit each (71 → 10 433 MB), ~12.5 ms of driver compile each (the first 20 000 were driver shader-cache hits from an earlier run), kernel paged 538 → 505 MB and nonpaged 760 → 736 MB (flat or down), video memory flat, and the device still ran a queue signal with all 90 000 alive.

live pipelines (own PS) 10 000 30 000 60 000 90 000
process private, MB 1 268 3 574 7 012 10 433
kernel paged / nonpaged, MB 532 / 746 531 / 745 520 / 744 505 / 736
local video memory, MB 6 6 6 6
So on this GPU neither the stand-ins nor the built pipelines grow kernel memory or video memory, even at 90k–100k, and the pipeline count alone does not look like what ran the driver out of kernel memory. Built pipelines do cost ~115 KB of process commit each here, so a run that builds tens of thousands of them would need several GB of commit, but yours had only 1 266 built. The other large counts in the same debug-layer dump, 67 107 live ID3D12Resource and 3 974 ID3D12Heap, may be the better lead (I have not measured those).

Not tested: a laptop / hybrid-graphics RTX 4060 like yours (the driver and memory setup differ), the debug layer's own per-object cost, a retail title, AMD.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠packwka22** on GitHub · 2026-11-24 16:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7137892809) Follow-up: same settings (`XCL_PSO_PRELOAD=0`, no debug layer, `uma_mb = 0`), but after a reboot, so the system started with far less in use. `report.json`, `xcl.log` This rules out commit exhaustion as the cause of the crash. Peak commit was only 43.8 / 67.5 GB this time (66.2 last run), and the title's own crash reporter logged 24.6 GB of swap free (9.4 GB last run). The crash is still identical, at the same point in the game: ``` [131.241] unhandled exception 0xc0000005 in game_scarlett_master.exe+0x23cf683 (write at address 0x0) rax=0x0 rbx=0x0 … on the stack: +0x4e4ba89, +0x2215c35, +0x71b9a20, +0x2215eca (run 4: 136.324 s, same address and stack) ``` Task Manager early in the world mid late end after the crash RAM in use / available 20.4 GB / 3.1 GB 20.7 / 2.8 22.5 / 0.9 23.2 GB / 308 MB 8.1 / 15.4 Commit 29.8 / 67.5 GB 31.8 40.2 43.8 15.6 Paged / nonpaged pool 748 / 496 MB 801 / 495 947 / 576 1004 / 624 620 / 528 Dedicated / shared GPU climbing / ~2 GB 8 GB full / flat full / growing full / growing — Physical RAM still ends up full (~15 GB for the run on this 24 GB machine), and dedicated VRAM is full while shared GPU memory keeps growing. But commit and the kernel pools have plenty of headroom, so I'd now drop my earlier "failed allocation under commit pressure" guess. What lines up with the crash in both runs is a very long compute PSO build right before it, with the title making almost no progress: Run 4: compute PSO with a 384 860 B DXIL finished at 132.210 s after 10 582 ms; crash 4 s later. Run 5: that same 384 860 B PSO came from the driver blob in 27 ms, but a new 494 324 B one finished at 131.216 s after 11 645 ms; crash 25 ms later. In both runs, presents go from 1500 (at ~84–92 s) to only ~50 more before the crash. In run 5 the render-side threads log nothing between 101 s and 131 s apart from that build finishing. A null write with rax = rbx = 0 right after a 10+ s stall makes me wonder whether this is the title deliberately killing itself, e.g. a watchdog on a stalled frame or render thread, rather than a real bug. That is only a guess, I can't confirm it from the log. If XCL builds these huge compute pipelines on a path that blocks the title's frame, that might be the thing to look at. The 494 KB one is now in the driver blob cache, so I'll rerun to see whether the crash moves later or goes away. [report.json](https://github.com/user-attachments/files/35357384/report.json) [xcl.log](https://github.com/user-attachments/files/35357383/xcl.log) > Two things that may help here: what the 60 029 live pipelines most likely are, and a measurement of what that many pipelines cost an 8 GB NVIDIA GPU without a game. > > **What the live pipelines are.** In your report `background_pipelines: [1266, 0, 57495]` is (built, failed, still pending) (`pso_async::counts()`). A pipeline whose shaders are not compiled yet gets a stand-in at once (`real.rs`, `standin_graphics` / `standin_compute`: the same dummy VS / PS / CS for all of them), and the title keeps that stand-in for as long as it holds the pipeline. So the 60 029 live `ID3D12PipelineState` are about 57 495 stand-ins plus the 1 266 real pipelines built so far, not 58k pipelines built in the background. > > To your question: `XCL_PSO_PRELOAD=0` turns off the workers that build an earlier run's pipelines ahead of use (`pso_async.rs`). It would not lower the live count much, though, since the stand-ins are made whenever the title creates a pipeline. > > **Measurement** (a throwaway test, plain D3D12, no XCL hooks, every pipeline kept alive; process private bytes, system commit, kernel paged / nonpaged pool and `QueryVideoMemoryInfo` sampled every step) > > * NVIDIA GeForce RTX 4060 8 GB **desktop**, driver 610.88 (32.0.16.1088); i7-10700K, 16 GB; Windows 11 Pro 26H2, build 26300.9974; no debug layer > * **Stand-in-like pipelines**, the stand-in shaders from `real.rs` `dummy()` (FXC 5.0), 3 of 4 graphics with varied RT / DS formats, blend and cull, 1 of 4 compute, 4 root signatures: **100 000 created and alive, no failure**. ~6 KB of process commit each (71 → 696 MB), kernel paged / nonpaged and local / non-local video memory flat, ~7 µs per pipeline, and the device still ran a queue signal afterwards. > * **Pipelines with their own pixel shader each** (a unique small PS per pipeline, so the driver compiles every one, closer to real pipelines): **90 000 created and alive, no failure**; the run stopped there only at the test's own safety limit (10 GB of process private bytes on this 16 GB machine). ~115 KB of process commit each (71 → 10 433 MB), ~12.5 ms of driver compile each (the first 20 000 were driver shader-cache hits from an earlier run), kernel paged 538 → 505 MB and nonpaged 760 → 736 MB (flat or down), video memory flat, and the device still ran a queue signal with all 90 000 alive. > > live pipelines (own PS) 10 000 30 000 60 000 90 000 > process private, MB 1 268 3 574 7 012 10 433 > kernel paged / nonpaged, MB 532 / 746 531 / 745 520 / 744 505 / 736 > local video memory, MB 6 6 6 6 > So on this GPU neither the stand-ins nor the built pipelines grow kernel memory or video memory, even at 90k–100k, and the pipeline count alone does not look like what ran the driver out of kernel memory. Built pipelines do cost ~115 KB of process commit each here, so a run that builds tens of thousands of them would need several GB of commit, but yours had only 1 266 built. The other large counts in the same debug-layer dump, **67 107 live `ID3D12Resource` and 3 974 `ID3D12Heap`**, may be the better lead (I have not measured those). > > **Not tested:** a laptop / hybrid-graphics RTX 4060 like yours (the driver and memory setup differ), the debug layer's own per-object cost, a retail title, AMD. > > _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠packwka22 on GitHub · 2026-11-24 16:46 UTC · original

Third run with the same settings, and I need to correct my last comment: the long-shader-build idea doesn't hold. In this run both earlier slow PSOs came from the driver blob cache (384 860 B in 9 ms, 494 324 B in 15 ms), and the title still crashed at the same address and stack, at almost the same time:
Run Crash at Address Last big PSO before the crash
4 136.3 s +0x23cf683 (write to 0x0) 384 860 B, 10.6 s, finished 4 s before
5 131.2 s +0x23cf683 494 324 B, 11.6 s, finished 25 ms before
6 135.3 s +0x23cf683 240 420 B, 5.8 s, finished 186 ms before (both earlier ones cached)
Run 6 built 92 compute PSOs around that time, so "a build just finished" is true almost all the time. That makes it coincidence, not a cause. Logs and report attached.
The more useful find is the title's own crash-context files. Its Breakpad writes one to T: (XCL's temp folder) on every crash, and I've attached all four. The three null-write crashes are at the same point in the game:

Current Mission Name: 0x98c85f2a
Current SRL Name: fbk_stry000_FBK_STRY000_INTRO     Current SRL State: Prestream
Current AnimScene: 0xe9f5cf99
Camera Position: <1846.999878, 147.269882, 5.390000>
Game Running Time: 1m36s–1m43s

That is, the crash happens as the story intro sequence starts prestreaming. The title's memory section at that moment is the same in all three:

Game Physical: 2207945280/2305818624   (2207976704 / 2207958464 in the other two, ~95.8 %)
Unused:        0/590348272
Pool:          591978272/624951280
TileHeap: used (3518–3647Mb) - total (6236Mb)

So the title's physical pool is about 96 % full, with "Unused" at 0, right when it starts streaming the intro. My guess is that the prestream allocation fails and the title writes through the null result, but I can't confirm that. I don't know how XCL sizes what the title sees as physical memory (title_memory = "auto", title_memory_mb = 0 in xcl.toml). Is 2.3 GB "Game Physical" the expected size there, and is title_memory_mb the knob to raise it? If so, I can test a larger value.
The fourth crash log is from the earlier device-lost run (game int3 after 0x887a0005). It shows a different state: no mission, Game Physical 2173 / 2305 MB.

game_scarlett_master-20261124-173429-15472.crash.log
game_scarlett_master-20261124-191957-31112.crash.log
game_scarlett_master-20261124-193033-25580.crash.log
game_scarlett_master-20261124-193855-5856.crash.log
report.json
xcl.log

**@⁠packwka22** on GitHub · 2026-11-24 16:46 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7138177586) Third run with the same settings, and I need to correct my last comment: the long-shader-build idea doesn't hold. In this run both earlier slow PSOs came from the driver blob cache (384 860 B in 9 ms, 494 324 B in 15 ms), and the title still crashed at the same address and stack, at almost the same time: Run Crash at Address Last big PSO before the crash 4 136.3 s `+0x23cf683` (write to 0x0) 384 860 B, 10.6 s, finished 4 s before 5 131.2 s `+0x23cf683` 494 324 B, 11.6 s, finished 25 ms before 6 135.3 s `+0x23cf683` 240 420 B, 5.8 s, finished 186 ms before (both earlier ones cached) Run 6 built 92 compute PSOs around that time, so "a build just finished" is true almost all the time. That makes it coincidence, not a cause. Logs and report attached. The more useful find is the title's own crash-context files. Its Breakpad writes one to `T:` (XCL's `temp` folder) on every crash, and I've attached all four. The three null-write crashes are at the same point in the game: ``` Current Mission Name: 0x98c85f2a Current SRL Name: fbk_stry000_FBK_STRY000_INTRO Current SRL State: Prestream Current AnimScene: 0xe9f5cf99 Camera Position: <1846.999878, 147.269882, 5.390000> Game Running Time: 1m36s–1m43s ``` That is, the crash happens as the story intro sequence starts prestreaming. The title's memory section at that moment is the same in all three: ``` Game Physical: 2207945280/2305818624 (2207976704 / 2207958464 in the other two, ~95.8 %) Unused: 0/590348272 Pool: 591978272/624951280 TileHeap: used (3518–3647Mb) - total (6236Mb) ``` So the title's physical pool is about 96 % full, with "Unused" at 0, right when it starts streaming the intro. My guess is that the prestream allocation fails and the title writes through the null result, but I can't confirm that. I don't know how XCL sizes what the title sees as physical memory (`title_memory = "auto"`, `title_memory_mb = 0` in `xcl.toml`). Is 2.3 GB "Game Physical" the expected size there, and is `title_memory_mb` the knob to raise it? If so, I can test a larger value. The fourth crash log is from the earlier device-lost run (game `int3` after `0x887a0005`). It shows a different state: no mission, Game Physical 2173 / 2305 MB. [game_scarlett_master-20261124-173429-15472.crash.log](https://github.com/user-attachments/files/35357963/game_scarlett_master-20261124-173429-15472.crash.log) [game_scarlett_master-20261124-191957-31112.crash.log](https://github.com/user-attachments/files/35357962/game_scarlett_master-20261124-191957-31112.crash.log) [game_scarlett_master-20261124-193033-25580.crash.log](https://github.com/user-attachments/files/35357966/game_scarlett_master-20261124-193033-25580.crash.log) [game_scarlett_master-20261124-193855-5856.crash.log](https://github.com/user-attachments/files/35357961/game_scarlett_master-20261124-193855-5856.crash.log) [report.json](https://github.com/user-attachments/files/35357964/report.json) [xcl.log](https://github.com/user-attachments/files/35357965/xcl.log)
Author
Owner

@⁠gabrielsteglich on GitHub · 2026-11-24 17:43 UTC · original

I'd like to take the diagnostics part of this issue. I'll add opt-in counts of the D3D12 resources and heaps XCL tracks, including resources it holds until the GPU finishes, alongside the existing activity and memory samples. I'll validate the counts with synthetic create and release cases on an RTX 3090. The goal is to show how those counts change before a loss so we can compare them with commit and VRAM usage.

**@⁠gabrielsteglich** on GitHub · 2026-11-24 17:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7139623263) I'd like to take the diagnostics part of this issue. I'll add opt-in counts of the D3D12 resources and heaps XCL tracks, including resources it holds until the GPU finishes, alongside the existing activity and memory samples. I'll validate the counts with synthetic create and release cases on an RTX 3090. The goal is to show how those counts change before a loss so we can compare them with commit and VRAM usage.
Author
Owner

@⁠lemosss on GitHub · 2026-11-24 17:44 UTC · original

On your question about how XCL sizes the title's memory (main at 9e3831e, crates/xcl/src/config.rs and hle/kernelx.rs; read from the code and your run-6 xcl.log, not run):

  • title_memory = "auto" takes the mode from MicrosoftGame.config. Your log says 4095 MB coherent window, and XCL picks 4095 only for "advanced" (uma_mb = 0 → 4095 for advanced, otherwise 2048). So this title runs as advanced.
  • title_memory_mb = 0 gives the Series X standard figure, 13 824 MiB, for advanced as well. That is the total that TitleMemoryStatus / JobTitleMemoryStatus and the limit that XMemGetWorkingSetStatistics report. "Used" is the process's private bytes. These are the only places that use title_memory_mb.
  • So XCL tells the title it has ~13.5 GB, not 2.3 GB. Game Physical: …/2 305 818 624 (2 199 MiB, 0x89700000) is not a number XCL hands out: it matches none of 13 824, 4 095 or 2 048 MiB. It looks like the size of the game's own allocator pool, and the title installs its own XMem allocation hooks (XMem: the title has allocation hooks … at 0.381 s), so that pool is managed inside the game.
  • title_memory_mb is the setting that changes what those functions report. Whether this game sizes its pool from it, I can't tell from the code or the log. A quick check: title_memory_mb = 16384. Then see whether the Game Physical total in the next .crash.log changes. If it stays at 2 305 818 624, the game fixes that pool size itself and raising the setting won't help with this crash.

Written with Claude Code (Claude Opus 5.5).

**@⁠lemosss** on GitHub · 2026-11-24 17:44 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7139640254) On your question about how XCL sizes the title's memory (`main` at `9e3831e`, `crates/xcl/src/config.rs` and `hle/kernelx.rs`; read from the code and your run-6 `xcl.log`, not run): - `title_memory = "auto"` takes the mode from `MicrosoftGame.config`. Your log says `4095 MB coherent window`, and XCL picks 4095 only for "advanced" (`uma_mb = 0` → 4095 for advanced, otherwise 2048). So this title runs as **advanced**. - `title_memory_mb = 0` gives the Series X standard figure, **13 824 MiB**, for advanced as well. That is the `total` that `TitleMemoryStatus` / `JobTitleMemoryStatus` and the limit that `XMemGetWorkingSetStatistics` report. "Used" is the process's private bytes. These are the only places that use `title_memory_mb`. - So XCL tells the title it has ~13.5 GB, not 2.3 GB. **`Game Physical: …/2 305 818 624`** (2 199 MiB, `0x89700000`) is not a number XCL hands out: it matches none of 13 824, 4 095 or 2 048 MiB. It looks like the size of the game's own allocator pool, and the title installs its own XMem allocation hooks (`XMem: the title has allocation hooks …` at 0.381 s), so that pool is managed inside the game. - `title_memory_mb` is the setting that changes what those functions report. Whether this game sizes its pool from it, I can't tell from the code or the log. A quick check: `title_memory_mb = 16384`. Then see whether the `Game Physical` total in the next `.crash.log` changes. If it stays at 2 305 818 624, the game fixes that pool size itself and raising the setting won't help with this crash. _Written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠milesah3ad on GitHub · 2026-11-24 17:52 UTC · original

One more measurement on the stand-ins, about speed rather than memory (details and table in #156):

  • On an RTX 5080 (driver 621.24), 60,000 live pipelines of one program, like the stand-ins, cost 10.8 µs and about 6.5 KB each. Distinct pipelines built after them took the same time as with nothing alive (438–441 ms on 15 threads). So the ~57k stand-ins here don't slow later builds either.
  • Distinct live pipelines do: past about 3,000, each new CreateComputePipelineState and DXC itself get slower, about 5× and 3× at 8,000. Releasing them brings both back right away. With about 1.3k real pipelines alive in these runs, that is below where it starts on this machine, so I don't think it explains this crash.

AI use: Claude Code (Claude Opus 5.5) ran the probe and wrote this. I checked it against the logs.

**@⁠milesah3ad** on GitHub · 2026-11-24 17:52 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7139829244) One more measurement on the stand-ins, about speed rather than memory (details and table in https://git.gtahub.st/github/xcl-dev--xcl/issues/156): - On an RTX 5080 (driver 621.24), 60,000 live pipelines of **one** program, like the stand-ins, cost 10.8 µs and about 6.5 KB each. Distinct pipelines built after them took the same time as with nothing alive (438–441 ms on 15 threads). So the ~57k stand-ins here don't slow later builds either. - **Distinct** live pipelines do: past about 3,000, each new `CreateComputePipelineState` and DXC itself get slower, about 5× and 3× at 8,000. Releasing them brings both back right away. With about 1.3k real pipelines alive in these runs, that is below where it starts on this machine, so I don't think it explains this crash. AI use: Claude Code (Claude Opus 5.5) ran the probe and wrote this. I checked it against the logs.
Author
Owner

@⁠packwka22 on GitHub · 2026-11-24 17:54 UTC · original

@⁠lemosss thanks, that settles it. I ran your check with title_memory_mb = 16384 (XCL_PSO_PRELOAD=0, uma_mb = 0, no debug layer), on a build of current main that already includes today's changes ("a big pipeline build the title waits for does not wait for its turn", the DRED and DirectStorage fixes, etc.).
The pool size is fixed by the game. The new crash log shows the exact same total:

Game Physical: 2207959456/2305818624
Unused:        0/590348272
TileHeap: used (3616Mb) - total (6236Mb)
Current Mission Name: 0x98c85f2a
Camera Position: <1846.999878, 147.269882, 5.390000>

So title_memory_mb doesn't reach this pool, and raising it doesn't help. The crash is otherwise identical: game_scarlett_master.exe+0x23cf683, write to 0x0, same stack, same mission state, this time at 118.9 s (game running time 1m25s).
So neither today's main nor the setting moves it. That's four runs in a row (with and without a reboot, cached and uncached shaders, older build and current main, 13.5 vs 16 GB reported title memory) where the title dies at the same point, as the story intro starts prestreaming, with its own 2.2 GB physical pool at ~96 %. If anyone can tell from +0x23cf683 / +0x4e4ba89 what the title is allocating there, or whether something XCL reports, e.g. through the XMem hooks, influences how much of that pool the title thinks it can use, I'm happy to test it.
Attached: the new .crash.log, report.json and xcl.log.

game_scarlett_master-20261124-205033-25584.crash.log
report.json
xcl.log

**@⁠packwka22** on GitHub · 2026-11-24 17:54 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7139872574) @⁠lemosss thanks, that settles it. I ran your check with `title_memory_mb = 16384` (`XCL_PSO_PRELOAD=0`, `uma_mb = 0`, no debug layer), on a build of current `main` that already includes today's changes ("a big pipeline build the title waits for does not wait for its turn", the DRED and DirectStorage fixes, etc.). The pool size is fixed by the game. The new crash log shows the exact same total: ``` Game Physical: 2207959456/2305818624 Unused: 0/590348272 TileHeap: used (3616Mb) - total (6236Mb) Current Mission Name: 0x98c85f2a Camera Position: <1846.999878, 147.269882, 5.390000> ``` So `title_memory_mb` doesn't reach this pool, and raising it doesn't help. The crash is otherwise identical: `game_scarlett_master.exe+0x23cf683`, write to 0x0, same stack, same mission state, this time at 118.9 s (game running time 1m25s). So neither today's `main` nor the setting moves it. That's four runs in a row (with and without a reboot, cached and uncached shaders, older build and current `main`, 13.5 vs 16 GB reported title memory) where the title dies at the same point, as the story intro starts prestreaming, with its own 2.2 GB physical pool at ~96 %. If anyone can tell from `+0x23cf683` / `+0x4e4ba89` what the title is allocating there, or whether something XCL reports, e.g. through the XMem hooks, influences how much of that pool the title thinks it can use, I'm happy to test it. Attached: the new `.crash.log`, `report.json` and `xcl.log`. [game_scarlett_master-20261124-205033-25584.crash.log](https://github.com/user-attachments/files/35360918/game_scarlett_master-20261124-205033-25584.crash.log) [report.json](https://github.com/user-attachments/files/35360919/report.json) [xcl.log](https://github.com/user-attachments/files/35360920/xcl.log)
Author
Owner

@⁠lemosss on GitHub · 2026-11-24 18:02 UTC · original

Thanks for running it. On your other question, whether something XCL reports changes how much of that pool the title uses: I went through what XCL hands the title that a size inside the pool could depend on (main at 9e3831e, your run-7 xcl.log and report.json; read only, nothing run). I found nothing that points to XCL:

  • XMem hooks: these are the title's own allocator functions (game_scarlett_master.exe+0x4deb420 / +0x4e38ec0). XMemAlloc calls them as they are (hle/kernelx.rs). XCL passes them no size or limit of its own.
  • Texture sizes: the title imports two functions from xg_xs.dll (XCL exports only XGCreateTextureComputer and XGSuggestSwizzleMode). XCL answers them from its own GFX10 layout model, which tests/xg_oracle.rs compares with the console's library. Your log has no XGCreateTextureComputer warning, so every call got an answer. I can't check the sizes for this title without its data.
  • GetResourceAllocationInfo (device #25 / #108, d3d12x/device_x.rs): textures get the same XG size. Buffers, and what the model does not cover (MSAA, for one), get the PC driver's size and alignment. But this title places its buffers at addresses that are not 64 KiB-aligned (e.g. 0x769d58f50 in run 7), so it packs them itself rather than using the PC's 64 KiB alignment.
  • Unified memory is full but flat. coherent 3998/4095 MB from ~7 s until the crash, in run 6 and run 7. It does not grow towards the crash.

So I don't see anything XCL reports that would make that 2.2 GB pool fill faster than on the console. What the title allocates at +0x23cf683 can't be told from the log alone.

Read and written with Claude Code (Claude Opus 5.5).

**@⁠lemosss** on GitHub · 2026-11-24 18:02 UTC · [original](https://github.com/xcl-dev/xcl/issues/1333#issuecomment-7140074750) Thanks for running it. On your other question, whether something XCL reports changes how much of that pool the title uses: I went through what XCL hands the title that a size inside the pool could depend on (`main` at `9e3831e`, your run-7 `xcl.log` and `report.json`; read only, nothing run). I found nothing that points to XCL: - **XMem hooks:** these are the title's own allocator functions (`game_scarlett_master.exe+0x4deb420` / `+0x4e38ec0`). `XMemAlloc` calls them as they are (`hle/kernelx.rs`). XCL passes them no size or limit of its own. - **Texture sizes:** the title imports two functions from `xg_xs.dll` (XCL exports only `XGCreateTextureComputer` and `XGSuggestSwizzleMode`). XCL answers them from its own GFX10 layout model, which `tests/xg_oracle.rs` compares with the console's library. Your log has no `XGCreateTextureComputer` warning, so every call got an answer. I can't check the sizes for this title without its data. - **`GetResourceAllocationInfo`** (device #25 / #108, `d3d12x/device_x.rs`): textures get the same XG size. Buffers, and what the model does not cover (MSAA, for one), get the PC driver's size and alignment. But this title places its buffers at addresses that are not 64 KiB-aligned (e.g. `0x769d58f50` in run 7), so it packs them itself rather than using the PC's 64 KiB alignment. - **Unified memory** is full but flat. `coherent 3998/4095 MB` from ~7 s until the crash, in run 6 and run 7. It does not grow towards the crash. So I don't see anything XCL reports that would make that 2.2 GB pool fill faster than on the console. What the title allocates at `+0x23cf683` can't be told from the log alone. _Read and written with Claude Code (Claude Opus 5.5)._
This discussion has been locked. Commenting is limited to contributors.
No description provided.