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

Merged
Nostyxx merged 1 commit from upstream-pr/21 into main 2026-11-23 23:34:24 +00:00
Nostyxx commented 2026-11-23 23:17:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Nostyxx on 2026-11-23T23:17:00Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6570842118 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/21). Originally posted by [Nostyxx](https://github.com/Nostyxx) on 2026-11-23T23:17:00Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:50:56 +00:00
jeremygold02 commented 2026-11-24 06:54:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-23T23:39:54Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117217980 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/21#issuecomment-7117217980). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-23T23:39:54Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!21
No description provided.