NVIDIA (RTX 3080): device removed on null/unsupported views during world load — two fixes + one open hang #392

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

@⁠Lancito01 on GitHub · 2026-11-24 02:53 UTC · original

Summary

On an NVIDIA RTX 3080, GTA VI under VIctory loses the D3D12 device during the world load (before or at the first cinematic). DRED breadcrumbs (--profile diag --features diagnostics, VICTORY_D3D12_DRED=1) point each time at a dispatch whose UAV slot holds a null descriptor. AMD appears to tolerate these; NVIDIA removes the device.

Two of the three causes have a working fix (patch attached). The third needs a design-level change, so I'm reporting it rather than patching it.

Environment

  • GPU: NVIDIA GeForce RTX 3080 (minimum subgroup size 32)
  • OS: Windows 11 Pro (10.0.26300)
  • VIctory: d2a4bae (main, 2026-11-24) + attached patch
  • Build: cargo build --profile diag -p victory --features diagnostics
  • Run: victory run --execute <game exe> with VICTORY_D3D12_DRED=1, no skipped pipelines
  • Package: Xbox Series v1.0.2.1

Hang 1 — UAV on a depth-stencil texture (fixed)

  • DRED: indirect mesh dispatch (op 5, kind 10), mesh ae9ee9074f2e971f / pixel 54e55d28e6ee4f5c, command 2131 of 4974; u8 → heap 330192: null.
  • Cause: the title requests a UAV of a depth-stencil texture (R16_TYPELESS, flags 0x2). fits() refuses it (view the host does not allow), and the slot becomes a null view.
  • Fix: depth_scratch() in descriptor/host.rs gives such views a per-texture scratch texture (same size, typeless family, ALLOW_UNORDERED_ACCESS; view format mapped to R16_UINT / R32_UINT). Writes land in the scratch, so that effect is wrong, but the device survives. Logged once as depth UAV: scratch stand-in (seen: format 53, 768×768).

Hang 2 — packed 16-bit colour textures not creatable on NVIDIA (fixed)

  • DRED: indirect mesh dispatch, mesh 899bc578934bc5be, command 1129 of 3363; u8 → heap 329720: null.
  • Cause: no host texture (E_INVALIDARG) for two 2560×1440 textures: B5G5R5A1_UNORM (86) with RT|UAV (flags 5) and B4G4R4A4_UNORM (115) with RT (flags 1). NVIDIA doesn't support these as render targets / typed UAVs, so every view of them is null.
  • Fix: resource.rs stores formats 86/115 as R16_TYPELESS (same bytes per pixel, so copies line up; clear value → R16_UNORM), and fits() maps their views to R16_UNORM (SRV) / R16_UINT (UAV). Channels read as raw 16 bits, so the content is wrong, but the textures exist. After this, no no host texture errors before device removal.
  • Not handled: render-target views of these textures in format 86/115, if the title makes any.

Hang 3 — slots that were never written (open)

  • DRED: compute dispatch 33×1×1, e06a21f3cea46973; u4 → heap 339972: null, u6 → heap 726: null.
  • No failed-view warning for these slots, so they appear never written (or deliberately left empty) by the title. That works on the console and likely on AMD.
  • Suspected root cause: a null descriptor whose kind (texture vs. buffer, dimension) doesn't match what the shader declares. null_for() already notes the hardware "does not survive" that in general; NVIDIA consistently removes the device. A real fix likely needs the null view to match the translated shader's declared resource type per slot, which is beyond a local patch.
  • The title's hang watchdog (+0x23cf683, crash annotation GPU Loc Sig = 7333478d) killed a diag run ~2 min into loading. The same watchdog fires under XCL. The title's physical pool was at 2.12 / 2.31 GB.
  • About 97 distinct shaders that don't translate, and ~10 host pipelines refused with E_INVALIDARG (hashes available on request).
  • Release build: ~1 fps in the first cinematic, with many draws dropped (without a host pipeline, indirect).

Attached

nvidia-null-view-fixes.patch — the two fixes above, against d2a4bae.

No logs, dumps or game files are attached; I can rerun with specific VICTORY_* settings if that helps.

**@⁠Lancito01** on GitHub · 2026-11-24 02:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/392) ## Summary On an NVIDIA RTX 3080, GTA VI under VIctory loses the D3D12 device during the world load (before or at the first cinematic). DRED breadcrumbs (`--profile diag --features diagnostics`, `VICTORY_D3D12_DRED=1`) point each time at a dispatch whose UAV slot holds a **null descriptor**. AMD appears to tolerate these; NVIDIA removes the device. Two of the three causes have a working fix (patch attached). The third needs a design-level change, so I'm reporting it rather than patching it. ## Environment - GPU: NVIDIA GeForce RTX 3080 (minimum subgroup size 32) - OS: Windows 11 Pro (10.0.26300) - VIctory: `d2a4bae` (main, 2026-11-24) + attached patch - Build: `cargo build --profile diag -p victory --features diagnostics` - Run: `victory run --execute <game exe>` with `VICTORY_D3D12_DRED=1`, no skipped pipelines - Package: Xbox Series v1.0.2.1 ## Hang 1 — UAV on a depth-stencil texture (fixed) - DRED: indirect mesh dispatch (`op 5`, kind 10), mesh `ae9ee9074f2e971f` / pixel `54e55d28e6ee4f5c`, command 2131 of 4974; `u8` → heap 330192: null. - Cause: the title requests a UAV of a depth-stencil texture (`R16_TYPELESS`, flags `0x2`). `fits()` refuses it (`view the host does not allow`), and the slot becomes a null view. - Fix: `depth_scratch()` in `descriptor/host.rs` gives such views a per-texture scratch texture (same size, typeless family, `ALLOW_UNORDERED_ACCESS`; view format mapped to `R16_UINT` / `R32_UINT`). Writes land in the scratch, so that effect is wrong, but the device survives. Logged once as `depth UAV: scratch stand-in` (seen: format 53, 768×768). ## Hang 2 — packed 16-bit colour textures not creatable on NVIDIA (fixed) - DRED: indirect mesh dispatch, mesh `899bc578934bc5be`, command 1129 of 3363; `u8` → heap 329720: null. - Cause: `no host texture` (E_INVALIDARG) for two 2560×1440 textures: `B5G5R5A1_UNORM` (86) with RT|UAV (flags 5) and `B4G4R4A4_UNORM` (115) with RT (flags 1). NVIDIA doesn't support these as render targets / typed UAVs, so every view of them is null. - Fix: `resource.rs` stores formats 86/115 as `R16_TYPELESS` (same bytes per pixel, so copies line up; clear value → `R16_UNORM`), and `fits()` maps their views to `R16_UNORM` (SRV) / `R16_UINT` (UAV). Channels read as raw 16 bits, so the content is wrong, but the textures exist. After this, no `no host texture` errors before device removal. - Not handled: render-target views of these textures in format 86/115, if the title makes any. ## Hang 3 — slots that were never written (open) - DRED: compute dispatch 33×1×1, `e06a21f3cea46973`; `u4` → heap 339972: null, `u6` → heap 726: null. - No failed-view warning for these slots, so they appear never written (or deliberately left empty) by the title. That works on the console and likely on AMD. - Suspected root cause: a null descriptor whose kind (texture vs. buffer, dimension) doesn't match what the shader declares. `null_for()` already notes the hardware "does not survive" that in general; NVIDIA consistently removes the device. A real fix likely needs the null view to match the translated shader's declared resource type per slot, which is beyond a local patch. ## Also seen (may be related) - The title's hang watchdog (`+0x23cf683`, crash annotation `GPU Loc Sig = 7333478d`) killed a diag run ~2 min into loading. The same watchdog fires under XCL. The title's physical pool was at 2.12 / 2.31 GB. - About 97 distinct shaders that don't translate, and ~10 host pipelines refused with E_INVALIDARG (hashes available on request). - Release build: ~1 fps in the first cinematic, with many draws dropped (`without a host pipeline`, indirect). ## Attached `nvidia-null-view-fixes.patch` — the two fixes above, against `d2a4bae`. No logs, dumps or game files are attached; I can rerun with specific `VICTORY_*` settings if that helps.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:02:18 +00:00
Author
Owner

@⁠Lancito01 on GitHub · 2026-11-24 02:54 UTC · original

File attached.
nvidia-null-view-fixes.txt

**@⁠Lancito01** on GitHub · 2026-11-24 02:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7120583151) File attached. [nvidia-null-view-fixes.txt](https://github.com/user-attachments/files/35308851/nvidia-null-view-fixes.txt)
Author
Owner

@⁠ChruutvoLuzi on GitHub · 2026-11-24 03:07 UTC · original

Tried the first part of the patch (the depth-UAV scratch stand-in) on another NVIDIA card. RTX 4090, driver 621.01, Windows 11, diag build, VICTORY_D3D12_DRED=1, the first mission's opening. Base: d2a4bae with #189, #205, #206, #134, #123, #89, #136, #193, #282 and #388 merged locally. I left out the packed 16-bit part because #89 already makes those textures creatable here.

It does what it says: the stand-in is made once per run, depth UAV: scratch stand-in format=53 width=768 height=768, for the same R16_TYPELESS depth texture whose UAV fits() refuses (view the host does not allow unordered=true format=53 flags=2 shows up once in every run on this card).

On this card it doesn't stop the hang, though. The world ran about 55 s, then a 5.5 s submission and 0x887A0006, with DRED at mesh 1 [mesh 8c8f0165ddd5199d, pixel 4cde906781d9b043], the same pair a 5070 Ti run in #71 stopped at.

About the Hang 1 signature: of 13 runs on this card without the patch that ended in the hang, DRED stopped at ae9ee9074f2e971f / 54e55d28e6ee4f5c once. The other 12 stopped in 11 different mesh or compute programs, and in #71 skipping single programs just moves the stop. So a run that no longer stops at that dispatch may not mean the hang is gone. How long did the world run on the 3080 with the patch, compared with without it?

AI-assisted (Claude Code).

**@⁠ChruutvoLuzi** on GitHub · 2026-11-24 03:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7120786289) Tried the first part of the patch (the depth-UAV scratch stand-in) on another NVIDIA card. RTX 4090, driver 621.01, Windows 11, diag build, `VICTORY_D3D12_DRED=1`, the first mission's opening. Base: `d2a4bae` with #189, #205, #206, #134, #123, #89, #136, #193, #282 and #388 merged locally. I left out the packed 16-bit part because #89 already makes those textures creatable here. It does what it says: the stand-in is made once per run, `depth UAV: scratch stand-in format=53 width=768 height=768`, for the same `R16_TYPELESS` depth texture whose UAV `fits()` refuses (`view the host does not allow unordered=true format=53 flags=2` shows up once in every run on this card). On this card it doesn't stop the hang, though. The world ran about 55 s, then a 5.5 s submission and `0x887A0006`, with DRED at `mesh 1 [mesh 8c8f0165ddd5199d, pixel 4cde906781d9b043]`, the same pair a 5070 Ti run in #71 stopped at. About the Hang 1 signature: of 13 runs on this card without the patch that ended in the hang, DRED stopped at `ae9ee9074f2e971f` / `54e55d28e6ee4f5c` once. The other 12 stopped in 11 different mesh or compute programs, and in #71 skipping single programs just moves the stop. So a run that no longer stops at that dispatch may not mean the hang is gone. How long did the world run on the 3080 with the patch, compared with without it? AI-assisted (Claude Code).
Author
Owner

@⁠FrancescoGelosoEterea on GitHub · 2026-11-24 03:27 UTC · original

The packed 16-bit part also needs the render target view remapped. Without that, on an RTX 5070 Ti it ends in DXGI_ERROR_INVALID_CALL about 5 s into the world.

Setup

RTX 5070 Ti, driver 621.24, Ryzen 7 9800X3D, Windows 11 Pro 26300, Xbox Series 1.0.2.1 (own copy), Series X mode. d2a4bae + #336 + the attached nvidia-null-view-fixes.txt (both parts). Diag build, VICTORY_D3D12_DRED=1. Each run entered the world from the start screen.

What happens with the patch as attached

  • The depth part works here too: depth UAV: scratch stand-in format=53 width=768 height=768, once per run.
  • The no host texture warnings for formats 86 and 115 are gone.
  • About 5 s after the first mesh bind (frame 1190), the device is removed with 0x887A0001 (INVALID_CALL), not the usual 0x887A0006 hang. DRED has no breadcrumbs. Without the patch, #336 alone lasted 47 s in the world before the #71 hang.

With VICTORY_D3D12_DEBUG=1 the debug layer names the call:

D3D12: ID3D12Device::CreateRenderTargetView: The Format (0x56, B5G5R5A1_UNORM) is invalid, when creating a View; it is not a fully qualified Format castable from the Format of the Resource (0x35, R16_TYPELESS). id=38 severity=1

fits() remaps the SRV/UAV formats of these textures, but render target views are made in Host::rtv (crates/victory-gpu/src/host.rs), which doesn't go through fits(). So it still asks for B5G5R5A1/B4G4R4A4 on the R16_TYPELESS resource.

Fix

The same remap in Host::rtv:

@@ -752,6 +752,20 @@ impl Host {
         desc: Option<&D3D12_RENDER_TARGET_VIEW_DESC>,
     ) -> D3D12_CPU_DESCRIPTOR_HANDLE {
         let slot = self.next_rtv.fetch_add(1, Ordering::Relaxed) % RTV_RING;
+        // Experiment (#392): packed 16-bit colour textures are stored as
+        // R16_TYPELESS (see resource.rs); their render target views write
+        // the raw 16 bits as R16_UNORM.
+        let mut remapped;
+        let mut desc = desc;
+        if let Some(d) = desc
+            && (d.Format.0 == 86 || d.Format.0 == 115)
+            // SAFETY: a live resource.
+            && unsafe { resource.GetDesc() }.Format.0 == 53
+        {
+            remapped = *d;
+            remapped.Format = DXGI_FORMAT(56);
+            desc = Some(&remapped);
+        }
         // SAFETY: a slot of our heap and a live resource.
         unsafe {
             let mut handle = self.rtvs.GetCPUDescriptorHandleForHeapStart();

Result with the fix

Same build plus the diff above, with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1:

  • No CreateRenderTargetView error, and no INVALID_CALL.
  • The world ran about 68 s (frames up to ~1810, 2,000+ draws per frame, about 1 fps; title card and audio, scene still dark). It then ended in the usual #71 hang, 0x887A0006. The debug layer was on, so the time isn't directly comparable to the 47 s without it.
  • One more debug-layer error, on a title buffer rather than a texture the patch touches (not checked without the patch): a transition barrier on 'title buffer 0x1ce0000+0xae00000' with before state UNORDERED_ACCESS while the resource is still in VERTEX_AND_CONSTANT_BUFFER (assumed at first use), id 527, a few times per run.

So with the RTV remap, the packed 16-bit part no longer breaks anything on this card, but it doesn't fix the hang either.

**@⁠FrancescoGelosoEterea** on GitHub · 2026-11-24 03:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7121115602) **The packed 16-bit part also needs the render target view remapped. Without that, on an RTX 5070 Ti it ends in `DXGI_ERROR_INVALID_CALL` about 5 s into the world.** ## Setup RTX 5070 Ti, driver 621.24, Ryzen 7 9800X3D, Windows 11 Pro 26300, Xbox Series 1.0.2.1 (own copy), Series X mode. `d2a4bae` + #336 + the attached `nvidia-null-view-fixes.txt` (both parts). Diag build, `VICTORY_D3D12_DRED=1`. Each run entered the world from the start screen. ## What happens with the patch as attached - The depth part works here too: `depth UAV: scratch stand-in format=53 width=768 height=768`, once per run. - The `no host texture` warnings for formats 86 and 115 are gone. - About 5 s after the first mesh bind (frame 1190), the device is removed with `0x887A0001` (INVALID_CALL), not the usual `0x887A0006` hang. DRED has no breadcrumbs. Without the patch, #336 alone lasted 47 s in the world before the #71 hang. With `VICTORY_D3D12_DEBUG=1` the debug layer names the call: ``` D3D12: ID3D12Device::CreateRenderTargetView: The Format (0x56, B5G5R5A1_UNORM) is invalid, when creating a View; it is not a fully qualified Format castable from the Format of the Resource (0x35, R16_TYPELESS). id=38 severity=1 ``` `fits()` remaps the SRV/UAV formats of these textures, but render target views are made in `Host::rtv` (`crates/victory-gpu/src/host.rs`), which doesn't go through `fits()`. So it still asks for B5G5R5A1/B4G4R4A4 on the R16_TYPELESS resource. ## Fix The same remap in `Host::rtv`: ```diff @@ -752,6 +752,20 @@ impl Host { desc: Option<&D3D12_RENDER_TARGET_VIEW_DESC>, ) -> D3D12_CPU_DESCRIPTOR_HANDLE { let slot = self.next_rtv.fetch_add(1, Ordering::Relaxed) % RTV_RING; + // Experiment (#392): packed 16-bit colour textures are stored as + // R16_TYPELESS (see resource.rs); their render target views write + // the raw 16 bits as R16_UNORM. + let mut remapped; + let mut desc = desc; + if let Some(d) = desc + && (d.Format.0 == 86 || d.Format.0 == 115) + // SAFETY: a live resource. + && unsafe { resource.GetDesc() }.Format.0 == 53 + { + remapped = *d; + remapped.Format = DXGI_FORMAT(56); + desc = Some(&remapped); + } // SAFETY: a slot of our heap and a live resource. unsafe { let mut handle = self.rtvs.GetCPUDescriptorHandleForHeapStart(); ``` ## Result with the fix Same build plus the diff above, with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`: - No `CreateRenderTargetView` error, and no INVALID_CALL. - The world ran about 68 s (frames up to ~1810, 2,000+ draws per frame, about 1 fps; title card and audio, scene still dark). It then ended in the usual #71 hang, `0x887A0006`. The debug layer was on, so the time isn't directly comparable to the 47 s without it. - One more debug-layer error, on a title buffer rather than a texture the patch touches (not checked without the patch): a transition barrier on `'title buffer 0x1ce0000+0xae00000'` with before state `UNORDERED_ACCESS` while the resource is still in `VERTEX_AND_CONSTANT_BUFFER` (assumed at first use), id 527, a few times per run. So with the RTV remap, the packed 16-bit part no longer breaks anything on this card, but it doesn't fix the hang either.
Author
Owner

@⁠Lancito01 on GitHub · 2026-11-24 03:43 UTC · original

Release-build results on the RTX 3080 (d2a4bae + the attached patch + the Host::rtv remap from the comment above), with a comparison to earlier release runs on the same machine. No debug layer or DRED, so the times are comparable.

Run Code GPU lost after
1 stock d2a4bae 620 s
2 + attached patch (both parts) 580 s
3 + Host::rtv remap + queue-wait experiment (below) 527 s

With the RTV remap, the first cinematic is actually drawn. Near the end of run 3 there were about 4,254 draws per frame; runs 1 and 2 drew about 300 and dropped most of the rest. The last frames:

0.6 fps, 1739 ms/frame (537 preparing: copies 463 ms 144 MB; 272 on the GPU; 41 copying back)
0.3 fps, 2873 ms/frame (1290 preparing: copies 1022 ms 385 MB; 1297 on the GPU; 278 copying back), 4254 draws/frame

On screen: no picture and no captions any more (earlier runs showed captions stacking on a black frame), choppy audio, then 0x887A0004 with no breadcrumbs. Together with the 5.5 s submission ChruutvoLuzi saw, this looks like a timeout (TDR) from the cost of a fully drawn frame, about 1 s of copies plus 1.3 s of GPU time, rather than one bad command.

Queue-wait experiment, ruled out here. ID3D12CommandQueue::Wait is a no-op in queue.rs, and since submissions run synchronously, a wait the title issues before the signalling work is submitted would let dependent work run first. Another project reported that kind of ordering bug causing their black screen. I tried holding the submitting thread in Wait until the fence is reached (500 ms timeout, opt-in with VICTORY_QUEUE_WAIT). In run 3 the timeout never fired: zero waits timed out. I didn't log how many waits actually blocked, so I can't say whether it reordered anything, but it didn't stop the hang. The diff is small and I can post it if anyone wants to test it elsewhere.

Not tried: a longer TdrDelay, which would show whether the frame finishes or really hangs.

AI-assisted (Claude Code).

**@⁠Lancito01** on GitHub · 2026-11-24 03:43 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7121354407) Release-build results on the RTX 3080 (`d2a4bae` + the attached patch + the `Host::rtv` remap from the comment above), with a comparison to earlier release runs on the same machine. No debug layer or DRED, so the times are comparable. | Run | Code | GPU lost after | |---|---|---| | 1 | stock `d2a4bae` | 620 s | | 2 | + attached patch (both parts) | 580 s | | 3 | + `Host::rtv` remap + queue-wait experiment (below) | 527 s | **With the RTV remap, the first cinematic is actually drawn.** Near the end of run 3 there were about **4,254 draws per frame**; runs 1 and 2 drew about 300 and dropped most of the rest. The last frames: ``` 0.6 fps, 1739 ms/frame (537 preparing: copies 463 ms 144 MB; 272 on the GPU; 41 copying back) 0.3 fps, 2873 ms/frame (1290 preparing: copies 1022 ms 385 MB; 1297 on the GPU; 278 copying back), 4254 draws/frame ``` On screen: no picture and no captions any more (earlier runs showed captions stacking on a black frame), choppy audio, then `0x887A0004` with no breadcrumbs. Together with the 5.5 s submission ChruutvoLuzi saw, this looks like a timeout (TDR) from the cost of a fully drawn frame, about 1 s of copies plus 1.3 s of GPU time, rather than one bad command. **Queue-wait experiment, ruled out here.** `ID3D12CommandQueue::Wait` is a no-op in `queue.rs`, and since submissions run synchronously, a wait the title issues before the signalling work is submitted would let dependent work run first. Another project reported that kind of ordering bug causing their black screen. I tried holding the submitting thread in `Wait` until the fence is reached (500 ms timeout, opt-in with `VICTORY_QUEUE_WAIT`). In run 3 the timeout never fired: **zero waits timed out**. I didn't log how many waits actually blocked, so I can't say whether it reordered anything, but it didn't stop the hang. The diff is small and I can post it if anyone wants to test it elsewhere. Not tried: a longer `TdrDelay`, which would show whether the frame finishes or really hangs. AI-assisted (Claude Code).
Author
Owner

@⁠marcogravbrot on GitHub · 2026-11-24 04:49 UTC · original

A finding from an RTX 3080 Ti that may explain part of this (world stalls of several seconds, then DEVICE_HUNG), measured with VICTORY_GPU_TIMING=1 and a D3D12 debug-layer run.

One dispatch took 6.3 s on the GPU every frame: depth_pyramid:CS_InitDepthPyramidWithCpuOcclusion3x3 (128x64 groups). Its loop bounds are quotients of dimensions it reads with scalar buffer loads from two small structured SRVs (16- and 20-byte structures, one element each). The title's memory held sane values; the shader got zeros for every dword after the first, so a divisor was 0, the bound became infinite and every loop ran to the 2^20 limit.

Why zeros. A scalar s_buffer_load of an SRV is lowered through a raw handle while the host view is the title's structured one. On NVIDIA that combination does not read bytes: with a view of 16-byte structures, byte offset 4 returned dword 4 (the offset is taken as an element index) and byte offset 24 returned 0 (past the element count). A hand-assembled test on the test host shows it: reading bytes 24 and 4 of [100, 101, ...] gives [0, 104] instead of [106, 101].

Things I tried on this GPU, in case they save someone time:

  • A structured handle of the view's own stride reads correctly, but pipelines with loads from large structures were refused with E_OUTOFMEMORY (seen from 336 bytes in one shader, 2044 in others).
  • A structured handle of a different stride than the view's reads 0 past element 0.
  • Making the host views raw fails the debug layer for views that do not start on 16 bytes of the resource (CreateShaderResourceView: ... FirstElement must be a multiple of 4), which title views often do not.
  • What works here: the host makes raw and structured title views as views of 4-byte structures (any dword start is legal) and translated code addresses them by dword (byte >> 2, element offset 0), root views staying raw. With that the dispatch above takes well under a millisecond and GPU time per world frame fell from about 8 s to about 0.2 s.

Not a complete fix for this issue: after it I still see page faults from unbounded reads and frames dominated by CPU-side copies.

**@⁠marcogravbrot** on GitHub · 2026-11-24 04:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7122366355) A finding from an RTX 3080 Ti that may explain part of this (world stalls of several seconds, then `DEVICE_HUNG`), measured with `VICTORY_GPU_TIMING=1` and a D3D12 debug-layer run. **One dispatch took 6.3 s on the GPU every frame**: `depth_pyramid:CS_InitDepthPyramidWithCpuOcclusion3x3` (128x64 groups). Its loop bounds are quotients of dimensions it reads with scalar buffer loads from two small structured SRVs (16- and 20-byte structures, one element each). The title's memory held sane values; the shader got zeros for every dword after the first, so a divisor was 0, the bound became infinite and every loop ran to the 2^20 limit. **Why zeros.** A scalar `s_buffer_load` of an SRV is lowered through a raw handle while the host view is the title's structured one. On NVIDIA that combination does not read bytes: with a view of 16-byte structures, byte offset 4 returned dword 4 (the offset is taken as an element index) and byte offset 24 returned 0 (past the element count). A hand-assembled test on the test host shows it: reading bytes 24 and 4 of `[100, 101, ...]` gives `[0, 104]` instead of `[106, 101]`. Things I tried on this GPU, in case they save someone time: - A structured handle of the view's own stride reads correctly, but pipelines with loads from large structures were refused with `E_OUTOFMEMORY` (seen from 336 bytes in one shader, 2044 in others). - A structured handle of a different stride than the view's reads 0 past element 0. - Making the host views raw fails the debug layer for views that do not start on 16 bytes of the resource (`CreateShaderResourceView: ... FirstElement must be a multiple of 4`), which title views often do not. - What works here: the host makes raw and structured title views as views of 4-byte structures (any dword start is legal) and translated code addresses them by dword (`byte >> 2`, element offset 0), root views staying raw. With that the dispatch above takes well under a millisecond and GPU time per world frame fell from about 8 s to about 0.2 s. Not a complete fix for this issue: after it I still see page faults from unbounded reads and frames dominated by CPU-side copies.
Author
Owner

@⁠walterwallaceson on GitHub · 2026-11-24 08:07 UTC · original

RTX 3070 / Windows 10 data point for the runaway-loop explanation above (marcogravbrot's zero reads): with VICTORY_SHADER_LOOP_LIMIT=4096 the world hang goes away here, and the title reaches player control for the first time on this machine.

Setup

  • Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, 32 GB; Agility SDK 1.620.2 via #175
  • d2a4bae + #233/#320/#439 (f653ea4), #55, #89, #336, #334, #493 + #483 (conflict resolved as described on #493), #688 (0a146af), #581 (0a936b6)
    • #688 needed one local change: #493's root-SRV slots now go through #688's take_dynamic, since #688 removes State::dynamic.
    • #581 conflicts with #89 in resource.rs. I kept #89's target_format and left out #581's packed 16-bit R16_TYPELESS fallback (it would never fire after #89), like the RTX 4090 test above.
  • cargo build --profile diag -p victory --features diagnostics (the loop limit is diagnostics-only)

Before: run 16, default limit (2^20), VICTORY_D3D12_DEBUG=1 + VICTORY_D3D12_DRED=1

  • #581's stand-in fires once (depth UAV: scratch stand-in, format 53, 768×768); 0 debug-layer errors.
  • About 25 s after the dynamic descriptor slots run out, the device is removed with DXGI_ERROR_DEVICE_HUNG. DRED: one list stopped at command 150 of 172 on DispatchMesh (op 42); every later list in the submission never started. It still reached only the loading screens.
  • Without the debug layer (release builds, the same stack minus #581), the device was removed in three of three runs: 17 s after the slots ran out, ~1.3 min and ~11 min into the world. (Two earlier runs without #688 instead ended on the title breakpoint in #698 after ~5 min.)

After: run 17, VICTORY_SHADER_LOOP_LIMIT=4096, no debug layer, no DRED

Compared with the longest default-limit run (release, same stack minus #581, ~11 min), over the world part of each run:

default limit (release, ~11 min) limit 4096 (run 17)
device removed yes, 0x887A0006 after a 15.5 s submission no, none in ~9 min in the world (I stopped it)
how far opening credits over a black scene past the opening cutscene to player control (the movement prompt shows; the 3D scene is still black)
slow host submission 169, median 2.3 s 34, median 0.54 s, max 0.63 s, none after the first ~5 min
on the GPU per frame median 1,444 ms, max 4,200 median 201 ms, max 1,055
frame rate median 0.5 fps median 1.0 fps
draws per frame median ~1,700 median ~2,070

With the limit, a late world frame is ~980 ms: ~560 ms preparing (copies ~365 ms, ~230 MB), ~190 ms on the GPU, ~210 ms copying back. So the frame is now bound by CPU-side copies, not GPU time. The dynamic slots still run out (dropped draws reach 131072), and the late frame lines still report ~1,050 draws dropped without a host pipeline and ~1,600 indirect.

So on this GPU the world hang looks like loops running to 2^20 rather than a bad descriptor: the typed nulls from #581 don't stop it (run 16), and capping the loops does. Caveat: the default-limit release runs above didn't include #581, so the comparison isn't a single-variable one, though run 16 shows #581 alone doesn't remove the hang. That fits the zero reads through structured views described above; I haven't tested #704 / #709 / #437, which target those reads. One run with the limit so far.

No game data in this report.

AI-assisted (Claude Code); everything above was run on my machine.

**@⁠walterwallaceson** on GitHub · 2026-11-24 08:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7125747717) RTX 3070 / Windows 10 data point for the runaway-loop explanation above (marcogravbrot's zero reads): with `VICTORY_SHADER_LOOP_LIMIT=4096` the world hang goes away here, and the title reaches player control for the first time on this machine. **Setup** - Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, 32 GB; Agility SDK 1.620.2 via #175 - `d2a4bae` + #233/#320/#439 (f653ea4), #55, #89, #336, #334, #493 + #483 (conflict resolved as described on #493), #688 (0a146af), #581 (0a936b6) - #688 needed one local change: #493's root-SRV slots now go through #688's `take_dynamic`, since #688 removes `State::dynamic`. - #581 conflicts with #89 in `resource.rs`. I kept #89's `target_format` and left out #581's packed 16-bit R16_TYPELESS fallback (it would never fire after #89), like the RTX 4090 test above. - `cargo build --profile diag -p victory --features diagnostics` (the loop limit is diagnostics-only) **Before: run 16, default limit (2^20), `VICTORY_D3D12_DEBUG=1` + `VICTORY_D3D12_DRED=1`** - #581's stand-in fires once (`depth UAV: scratch stand-in`, format 53, 768×768); 0 debug-layer errors. - About 25 s after the dynamic descriptor slots run out, the device is removed with `DXGI_ERROR_DEVICE_HUNG`. DRED: one list stopped at command 150 of 172 on `DispatchMesh` (op 42); every later list in the submission never started. It still reached only the loading screens. - Without the debug layer (release builds, the same stack minus #581), the device was removed in three of three runs: 17 s after the slots ran out, ~1.3 min and ~11 min into the world. (Two earlier runs without #688 instead ended on the title breakpoint in #698 after ~5 min.) **After: run 17, `VICTORY_SHADER_LOOP_LIMIT=4096`, no debug layer, no DRED** Compared with the longest default-limit run (release, same stack minus #581, ~11 min), over the world part of each run: | | default limit (release, ~11 min) | limit 4096 (run 17) | |---|---|---| | device removed | yes, `0x887A0006` after a 15.5 s submission | **no**, none in ~9 min in the world (I stopped it) | | how far | opening credits over a black scene | **past the opening cutscene to player control** (the movement prompt shows; the 3D scene is still black) | | `slow host submission` | 169, median 2.3 s | 34, median 0.54 s, max 0.63 s, none after the first ~5 min | | on the GPU per frame | median 1,444 ms, max 4,200 | median 201 ms, max 1,055 | | frame rate | median 0.5 fps | median 1.0 fps | | draws per frame | median ~1,700 | median ~2,070 | With the limit, a late world frame is ~980 ms: ~560 ms preparing (copies ~365 ms, ~230 MB), ~190 ms on the GPU, ~210 ms copying back. So the frame is now bound by CPU-side copies, not GPU time. The dynamic slots still run out (dropped draws reach 131072), and the late frame lines still report ~1,050 draws dropped without a host pipeline and ~1,600 indirect. So on this GPU the world hang looks like loops running to 2^20 rather than a bad descriptor: the typed nulls from #581 don't stop it (run 16), and capping the loops does. Caveat: the default-limit release runs above didn't include #581, so the comparison isn't a single-variable one, though run 16 shows #581 alone doesn't remove the hang. That fits the zero reads through structured views described above; I haven't tested #704 / #709 / #437, which target those reads. One run with the limit so far. No game data in this report. AI-assisted (Claude Code); everything above was run on my machine.
Author
Owner

@⁠walterwallaceson on GitHub · 2026-11-24 10:11 UTC · original

Follow-up from the RTX 3070 / Windows 10 machine above, on current main with the stack rebuilt from today's PR heads. Short version: no crash and no device errors in 15 minutes, player control reached at about 1 fps, but the world draws nothing (black).

Setup

  • Windows 10 22H2, RTX 3070, NVIDIA 621.14, Agility SDK 1.620.2 via #175
  • main 8e79c80 + #175, #55, #89, #439 (1ca87f7), #334, #493, #483, #688 (bf4e37e), #581, #704 (42538cd). #336 is in main now.
  • cargo build --profile diag -p victory --features diagnostics, VICTORY_SHADER_LOOP_LIMIT=4096, no debug layer, one 15-minute run ended by a script

Merging notes, for anyone building the same stack

  • #89 and main: #680 changed the footprint upload in copy_texture_region to list.defer_fill (the Wine fix), while #89 moved that code into prepare_footprint_upload. I kept #89's helper and used defer_fill in it. The two other hunks in list.rs keep both checks, #89's skip_mixed_packed_copy first, then main's title_written upload.
  • #581 and #89 in resource.rs: same as before. I kept #89's target_format and left out #581's packed 16-bit fallback.
  • #483 and #704: both place their extra slots right after the dynamic ones. I put #704's raw-view pool after #483's guard slot (details on #704).
  • #688 still needs #493's root-SRV slots to go through take_dynamic (one line).
  • #175 and main both add a line to victory config. I kept both.

Run, compared with the older stack plus #704

older stack + #704 d5b23e1 this stack
ran 20 min, no crash 15 min, no crash
frame rate in the world about 1.0 fps about 1.0 fps (1,034 ms/frame)
copies per frame 331 ms, 202 MB 321 ms, 179 MB
on the GPU per frame 176 ms 200 ms
longest submission 681 ms 614 ms
draws per frame about 2,090 about 2,050
"shader does not translate" warnings 430 483
world on screen near-white black

The title gets through the account screen, the loading screens and the first cutscene (subtitles over black) to the movement hint, so the game side runs. Nothing of the world is visible. The flat colour has changed with each stack (grey, then near-white, now black), so I can't call it progress or a regression yet.

Two once-warnings also appeared on the older stack: no free dynamic descriptor slots: a table is not made (n=130, about 3 minutes in), and #704's 65,536 raw-view slots filling up once, about 9 minutes in. The view heap is still capped at 1,000,000 here (the title asks for 1,245,184).

Next I'm looking at why nothing is drawn, with the debug layer on this stack. Suggestions for what to log are welcome.

I'm testing with Claude's help, and Claude drafted this comment.

**@⁠walterwallaceson** on GitHub · 2026-11-24 10:11 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7128432907) Follow-up from the RTX 3070 / Windows 10 machine above, on current `main` with the stack rebuilt from today's PR heads. Short version: no crash and no device errors in 15 minutes, player control reached at about 1 fps, but the world draws nothing (black). **Setup** - Windows 10 22H2, RTX 3070, NVIDIA 621.14, Agility SDK 1.620.2 via #175 - `main` `8e79c80` + #175, #55, #89, #439 (`1ca87f7`), #334, #493, #483, #688 (`bf4e37e`), #581, #704 (`42538cd`). #336 is in `main` now. - `cargo build --profile diag -p victory --features diagnostics`, `VICTORY_SHADER_LOOP_LIMIT=4096`, no debug layer, one 15-minute run ended by a script **Merging notes, for anyone building the same stack** - #89 and `main`: #680 changed the footprint upload in `copy_texture_region` to `list.defer_fill` (the Wine fix), while #89 moved that code into `prepare_footprint_upload`. I kept #89's helper and used `defer_fill` in it. The two other hunks in `list.rs` keep both checks, #89's `skip_mixed_packed_copy` first, then `main`'s `title_written` upload. - #581 and #89 in `resource.rs`: same as before. I kept #89's `target_format` and left out #581's packed 16-bit fallback. - #483 and #704: both place their extra slots right after the dynamic ones. I put #704's raw-view pool after #483's guard slot (details on #704). - #688 still needs #493's root-SRV slots to go through `take_dynamic` (one line). - #175 and `main` both add a line to `victory config`. I kept both. **Run, compared with the older stack plus #704** | | older stack + #704 `d5b23e1` | this stack | |---|---|---| | ran | 20 min, no crash | 15 min, no crash | | frame rate in the world | about 1.0 fps | about 1.0 fps (1,034 ms/frame) | | copies per frame | 331 ms, 202 MB | 321 ms, 179 MB | | on the GPU per frame | 176 ms | 200 ms | | longest submission | 681 ms | 614 ms | | draws per frame | about 2,090 | about 2,050 | | "shader does not translate" warnings | 430 | 483 | | world on screen | near-white | black | The title gets through the account screen, the loading screens and the first cutscene (subtitles over black) to the movement hint, so the game side runs. Nothing of the world is visible. The flat colour has changed with each stack (grey, then near-white, now black), so I can't call it progress or a regression yet. Two once-warnings also appeared on the older stack: `no free dynamic descriptor slots: a table is not made` (n=130, about 3 minutes in), and #704's 65,536 raw-view slots filling up once, about 9 minutes in. The view heap is still capped at 1,000,000 here (the title asks for 1,245,184). Next I'm looking at why nothing is drawn, with the debug layer on this stack. Suggestions for what to log are welcome. I'm testing with Claude's help, and Claude drafted this comment.
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 11:24 UTC · original

For the measured 6.3-second CS_InitDepthPyramidWithCpuOcclusion3x3 dispatch, can you tell from your existing shader metadata whether the original PSV0 declares structured SRVs at the exact two table bindings used by the scalar loads? The register, space and binding kind for each would be enough. The GPU capture already identifies the runtime views as single 16- and 20-byte records.

That distinction would tell us whether the declaration-based scalar-load change covers this shader. In a synthetic comparison it preserved the raw-buffer case and read the expected word from a structured view; its effect on this depth-pyramid pass is unmeasured. Comparison branch and numeric test

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 11:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7130056003) For the measured 6.3-second `CS_InitDepthPyramidWithCpuOcclusion3x3` dispatch, can you tell from your existing shader metadata whether the original PSV0 declares structured SRVs at the exact two table bindings used by the scalar loads? The register, space and binding kind for each would be enough. The GPU capture already identifies the runtime views as single 16- and 20-byte records. That distinction would tell us whether the declaration-based scalar-load change covers this shader. In a synthetic comparison it preserved the raw-buffer case and read the expected word from a structured view; its effect on this depth-pyramid pass is unmeasured. [Comparison branch and numeric test](https://github.com/MichaelSmithAI/VIctory/commit/0301a9f)
Author
Owner

@⁠ByMateos on GitHub · 2026-11-24 13:19 UTC · original

Another NVIDIA data point, on newer main: same null-descriptor signature, and skipping the faulting program only moves the stop (as in #71).

Setup: RTX 3070 Ti, driver 621.35, Windows 11 Pro 26300, 32 GB. VIctory ffe310e (main, 2026-11-24), no extra patches. Diag build, VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, entering the world from the start screen.

Run 1 (no skips): world ran ~75 s at 0.4–1.5 fps (scene dark, audio fine), then 0x887A0006.

a list stopped at command 184 of 392 (op 42)
command 184 (op 42): mesh 3 [mesh a26422c01dcf5612, pixel 6a3a8d3fe52b4eab]
  u8=0xa31d00 [heap 334056: null] u9=0x1e1e940 u10=0x1e1e8a0

Run 2 (VICTORY_SKIP_PIPELINES=a26422c01dcf5612): ~45 s in the world, then 0x887A0006 at a different mesh program:

a list stopped at command 3 of 70 (op 42)
command 3 (op 42): mesh 159 [mesh 4adfa13bea1c556a]
  u8=0xa0ef00 [heap 329592: Placed(...)] u9=0x1408320 [heap 656409: null]

The same DRED report shows many other null slots in bound tables (heap 338080: null ×22, heap 330472 ×6, and others).

Also seen: 426 shader does not translate warnings per run; several compute pipelines refused with E_INVALIDARG (0709e8356abd9082, e4576c6eca0f8ce3, 13dfdd3b1136e407); refreshes of 6–11 GB per 5 s report while in the world.

So on ffe310e this still reproduces on Ampere 3070 Ti, consistent with the "not one program" reading. Logs available if useful.

AI-assisted (Claude Code).

**@⁠ByMateos** on GitHub · 2026-11-24 13:19 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7132664463) Another NVIDIA data point, on newer main: same null-descriptor signature, and skipping the faulting program only moves the stop (as in #71). **Setup:** RTX 3070 Ti, driver 621.35, Windows 11 Pro 26300, 32 GB. VIctory `ffe310e` (main, 2026-11-24), no extra patches. Diag build, `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`, entering the world from the start screen. **Run 1 (no skips):** world ran ~75 s at 0.4–1.5 fps (scene dark, audio fine), then 0x887A0006. ``` a list stopped at command 184 of 392 (op 42) command 184 (op 42): mesh 3 [mesh a26422c01dcf5612, pixel 6a3a8d3fe52b4eab] u8=0xa31d00 [heap 334056: null] u9=0x1e1e940 u10=0x1e1e8a0 ``` **Run 2 (`VICTORY_SKIP_PIPELINES=a26422c01dcf5612`):** ~45 s in the world, then 0x887A0006 at a different mesh program: ``` a list stopped at command 3 of 70 (op 42) command 3 (op 42): mesh 159 [mesh 4adfa13bea1c556a] u8=0xa0ef00 [heap 329592: Placed(...)] u9=0x1408320 [heap 656409: null] ``` The same DRED report shows many other null slots in bound tables (`heap 338080: null` ×22, `heap 330472` ×6, and others). **Also seen:** 426 `shader does not translate` warnings per run; several compute pipelines refused with E_INVALIDARG (`0709e8356abd9082`, `e4576c6eca0f8ce3`, `13dfdd3b1136e407`); `refreshes` of 6–11 GB per 5 s report while in the world. So on `ffe310e` this still reproduces on Ampere 3070 Ti, consistent with the "not one program" reading. Logs available if useful. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:47 UTC · original

Automated triage for the maintainers.

Thanks for the report and the patch. Pull requests are open to everyone, so please open the fixes as a PR rather than an attached file, so they can be reviewed and tested in CI. What already exists for each part:

  • Packed 16-bit textures (86/115): open PR #89 makes these render-target/UAV textures R8G8B8A8_UNORM where the GPU lacks support, including render-target views and pipeline formats. That avoids the CreateRenderTargetView INVALID_CALL that the attached R16_TYPELESS approach hit without the Host::rtv remap.
  • Depth-stencil UAV scratch stand-in: this was carried by PR #581, which was closed without being merged. It is not in main.
  • Never-written slots (hang 3): since this report, #205 (merged) gives null texture UAVs the title's view dimension in null_for (crates/victory-gpu/src/descriptor/host.rs). A run on ffe310e in the comments still shows null slots in bound tables before the hang.

The device removal that remains in every run here (0x887A0006, with the DRED stop moving between programs) is the NVIDIA world hang tracked in #71. This issue holds the null and unsupported-view part of it. If you post again, please include the NVIDIA driver version for the RTX 3080 runs.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/392#issuecomment-7149964460) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T13:19:24Z at=2026-11-25T01:51:20Z --> Automated triage for the maintainers. Thanks for the report and the patch. Pull requests are open to everyone, so please open the fixes as a PR rather than an attached file, so they can be reviewed and tested in CI. What already exists for each part: - **Packed 16-bit textures (86/115):** open PR #89 makes these render-target/UAV textures R8G8B8A8_UNORM where the GPU lacks support, including render-target views and pipeline formats. That avoids the `CreateRenderTargetView` INVALID_CALL that the attached R16_TYPELESS approach hit without the `Host::rtv` remap. - **Depth-stencil UAV scratch stand-in:** this was carried by PR #581, which was closed without being merged. It is not in `main`. - **Never-written slots (hang 3):** since this report, #205 (merged) gives null texture UAVs the title's view dimension in `null_for` (`crates/victory-gpu/src/descriptor/host.rs`). A run on `ffe310e` in the comments still shows null slots in bound tables before the hang. The device removal that remains in every run here (`0x887A0006`, with the DRED stop moving between programs) is the NVIDIA world hang tracked in #71. This issue holds the null and unsupported-view part of it. If you post again, please include the NVIDIA driver version for the RTX 3080 runs. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#392
No description provided.