GPU: make tables past a capped host view heap afresh (NVIDIA menu hang) #21

Manually merged
github merged 1 commit from gh-pr/21/head into gh-pr/21/base 2026-11-26 03:46:53 +00:00
Owner

@⁠Nostyxx on GitHub · 2026-11-23 23:17 UTC · original
Nostyxx:fix/nvidia-view-heap-cap → main · +38 −0 · 2 files · 1 commits · merged 2026-11-23 23:34 UTC

What

The title's shader-visible view heap has 1,245,184 slots. NVIDIA caps shader-visible view heaps at 1,000,000 (host view heap capped at 1000000 in the log; the debug layer: NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000). HostHeap::new then falls back to a heap whose title part ends at 934,464, with the dynamic slots after it.

The title binds a per-frame table ring in its top slots: from about 934,000 up to 1,245,184, moving 4,096 slots a frame. A diagnostic in HostHeap::mirror logged 78 distinct title slots past the host heap in one menu run, all for_draw=true. Those tables' host offsets either alias the dynamic slots (constant buffers made per draw) or run past the end of the heap. On NVIDIA the GPU then hangs within the first-boot screens (DXGI_ERROR_DEVICE_HUNG), after black and glitched frames.

Change

  • draw.rs, State::tables: a table whose used entries reach past the host heap's title slots is made afresh in dynamic slots, as tables holding constant buffers already are, and the shader gets the new offset. Hosts that take the whole heap (AMD) are unchanged.
  • descriptor/host.rs: HostHeap::count(), and mirror logs the highest title slot it meets past the host heap, once per new maximum.

Testing

RTX 3080, driver 32.0.16.2114, Windows 11, title 1.0.2.1:

Before After
First-boot screens and menus device removed 45-60 s in (3 of 3 runs) no device loss; no glitches
Title slots past the host heap (diagnostic) 78 0
Black frames in the menus 16 6
How far privacy/legal screen loads into the intro (sound plays; the picture is black, the known world-rendering state)

cargo test --workspace passes.

  • Refs #16 (RTX 5070 Ti: menus, then TDR; reports the same heap cap) and #11 (RTX 4060 / 4080 SUPER, same hang). The other NVIDIA findings there (refused B5G5R5A1/B4G4R4A4 uses, the early-freed texture) are separate and not addressed here; this fix alone was enough to get through the menus on this machine.
  • Overlaps #20, which makes SRV tables fresh too. That likely helps for the same reason: the ring tables past the cap mostly hold SRVs. This change covers every table past the cap (UAV and sampler-free tables too) and leaves the rest of the mirrored path as it is. The two touch the same lines in State::tables; whichever lands second needs a small rebase.

AI-assisted (Claude Code). Own copy of the title; no game data in this PR.

**@⁠Nostyxx** on GitHub · 2026-11-23 23:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/21) `Nostyxx:fix/nvidia-view-heap-cap` → `main` · +38 −0 · 2 files · 1 commits · merged 2026-11-23 23:34 UTC ## What The title's shader-visible view heap has 1,245,184 slots. NVIDIA caps shader-visible view heaps at 1,000,000 (`host view heap capped at 1000000` in the log; the debug layer: `NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000`). `HostHeap::new` then falls back to a heap whose title part ends at 934,464, with the dynamic slots after it. The title binds a per-frame table ring in its top slots: from about 934,000 up to 1,245,184, moving 4,096 slots a frame. A diagnostic in `HostHeap::mirror` logged 78 distinct title slots past the host heap in one menu run, all `for_draw=true`. Those tables' host offsets either alias the dynamic slots (constant buffers made per draw) or run past the end of the heap. On NVIDIA the GPU then hangs within the first-boot screens (`DXGI_ERROR_DEVICE_HUNG`), after black and glitched frames. ## Change - `draw.rs`, `State::tables`: a table whose used entries reach past the host heap's title slots is made afresh in dynamic slots, as tables holding constant buffers already are, and the shader gets the new offset. Hosts that take the whole heap (AMD) are unchanged. - `descriptor/host.rs`: `HostHeap::count()`, and `mirror` logs the highest title slot it meets past the host heap, once per new maximum. ## Testing RTX 3080, driver 32.0.16.2114, Windows 11, title 1.0.2.1: | | Before | After | |---|---|---| | First-boot screens and menus | device removed 45-60 s in (3 of 3 runs) | no device loss; no glitches | | Title slots past the host heap (diagnostic) | 78 | 0 | | Black frames in the menus | 16 | 6 | | How far | privacy/legal screen | loads into the intro (sound plays; the picture is black, the known world-rendering state) | `cargo test --workspace` passes. ## Related - Refs #16 (RTX 5070 Ti: menus, then TDR; reports the same heap cap) and #11 (RTX 4060 / 4080 SUPER, same hang). The other NVIDIA findings there (refused `B5G5R5A1`/`B4G4R4A4` uses, the early-freed texture) are separate and not addressed here; this fix alone was enough to get through the menus on this machine. - Overlaps #20, which makes SRV tables fresh too. That likely helps for the same reason: the ring tables past the cap mostly hold SRVs. This change covers every table past the cap (UAV and sampler-free tables too) and leaves the rest of the mirrored path as it is. The two touch the same lines in `State::tables`; whichever lands second needs a small rebase. AI-assisted (Claude Code). Own copy of the title; no game data in this PR.
The title's shader-visible view heap has 1,245,184 slots. NVIDIA caps
shader-visible view heaps at 1,000,000, so HostHeap::new falls back to a
heap of 1,000,000 whose title part ends at 934,464, with the dynamic
slots after it. The title binds a per-frame table ring in its top slots
(934,464 to 1,245,184, moving 4,096 slots a frame), so those tables'
host offsets either aliased the dynamic slots or ran past the heap's
end. On NVIDIA the GPU then hangs within the first-boot screens
(DXGI_ERROR_DEVICE_HUNG), after black and glitched frames.

A table that reaches past the host heap's title slots is now made
afresh in dynamic slots, as tables holding constant buffers already
are, and the shader is given the new offset. Hosts that take the whole
heap (AMD) are unchanged. mirror() logs the highest title slot it
meets past the host heap, once per new maximum.

Tested on an RTX 3080 (driver 32.0.16.2114): the first-boot screens and
menus run without glitches, and the title loads into the intro with no
device loss (before: device removed about 45-60 s in, 3 of 3 runs). The
slot warning went from 78 lines to none. cargo test --workspace passes.

Refs #16, #11

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:51 +00:00
github manually merged commit 38277675fa into gh-pr/21/base 2026-11-26 03:46:53 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-23 23:39 UTC · original

Verified the first-boot rendering improvement on Windows 11, Core Ultra 7 265K, RTX 5070 12 GB, driver 621.01. Both runs used the hardware adapter and the diagnostics profile.

Revision 1920×1080 present-source readbacks on the first-boot menu
Upstream 8c26061 Frame 356 contained the menu. Frames 357 and 358 were entirely black.
1dd7afd + this PR at 3827767 Frames 356, 357 and 358 each matched the healthy upstream frame 356 at every RGB pixel. After manual Continue, frames 512 and 600 showed two different full-color loading-intro images.

The two upstream bases differ only in the XMA parser. The test stack contained this PR's descriptor change alone among the proposed descriptor fixes.

A longer run of the same patched binary with the retained profile reached a loading spinner. The operator heard audio during mission loading and the desktop briefly froze. Frame pacing fell to about 0.4–1.2 fps. Windows reported LiveKernelEvent 141 with a watchdog dump timestamp matching that run. System commit headroom fell to 846 MiB. The observation timer fired at 120 s and the process had exited by 172 s. We could verify the menu correction and subsequent loading transition. The later trace does not identify a faulting draw or establish that descriptor remapping caused the timeout.

**@⁠jeremygold02** on GitHub · 2026-11-23 23:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/21#issuecomment-7117217980) Verified the first-boot rendering improvement on Windows 11, Core Ultra 7 265K, RTX 5070 12 GB, driver 621.01. Both runs used the hardware adapter and the diagnostics profile. | Revision | 1920×1080 present-source readbacks on the first-boot menu | | --- | --- | | Upstream 8c26061 | Frame 356 contained the menu. Frames 357 and 358 were entirely black. | | 1dd7afd + this PR at 3827767 | Frames 356, 357 and 358 each matched the healthy upstream frame 356 at every RGB pixel. After manual Continue, frames 512 and 600 showed two different full-color loading-intro images. | The two upstream bases differ only in the XMA parser. The test stack contained this PR's descriptor change alone among the proposed descriptor fixes. A longer run of the same patched binary with the retained profile reached a loading spinner. The operator heard audio during mission loading and the desktop briefly froze. Frame pacing fell to about 0.4–1.2 fps. Windows reported LiveKernelEvent 141 with a watchdog dump timestamp matching that run. System commit headroom fell to 846 MiB. The observation timer fired at 120 s and the process had exited by 172 s. We could verify the menu correction and subsequent loading transition. The later trace does not identify a faulting draw or establish that descriptor remapping caused the timeout.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!21
No description provided.