RTX 4060 Laptop: world-load device removal is not resolution/RT-bound; debug layer names invalid B5G5R5A1/B4G4R4A4 resources and a 1.31M descriptor heap #735

Open
opened 2026-11-26 04:13:54 +00:00 by github-bot · 6 comments
Owner

@⁠sbtwf8k7wz-arch on GitHub · 2026-11-24 08:47 UTC · original

Summary

On an RTX 4060 Laptop the title reaches the first mission's title card, then the host D3D12 device is removed during world load, as in #653 and #468.

Two new pieces of evidence:

  1. Control: 1920×1080 with rtDynamicShadows=false does not change the failure; it still dies on the same 30-list submission. Not resolution/VRAM/RT load.
  2. Debug layer: B5G5R5A1_UNORM + ALLOW_UNORDERED_ACCESS, B4G4R4A4_UNORM + ALLOW_RENDER_TARGET, and a 1,310,720-entry shader-visible heap against a 1,000,000 limit.

Details, environment and logs are in the local draft; this is a placeholder body.

**@⁠sbtwf8k7wz-arch** on GitHub · 2026-11-24 08:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/735) ## Summary On an RTX 4060 Laptop the title reaches the first mission's title card, then the host D3D12 device is removed during world load, as in #653 and #468. Two new pieces of evidence: 1. **Control:** 1920×1080 with `rtDynamicShadows=false` does not change the failure; it still dies on the same 30-list submission. Not resolution/VRAM/RT load. 2. **Debug layer:** `B5G5R5A1_UNORM` + `ALLOW_UNORDERED_ACCESS`, `B4G4R4A4_UNORM` + `ALLOW_RENDER_TARGET`, and a 1,310,720-entry shader-visible heap against a 1,000,000 limit. Details, environment and logs are in the local draft; this is a placeholder body.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:54 +00:00
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 09:02 UTC · original

Verified the root cause of both issues identified by the D3D12 debug layer and implemented a fix on fork branch \ ix/gpu-resource-format-flags-and-heap-limit:

1. Descriptor Heap Size Exceeding 1,000,000 (1.31M Heap)

  • Root Cause: In \crates/victory-gpu/src/descriptor/host.rs, \HostHeap::new\ attempted \make(count + DYNAMIC)\ first. When the title requested 1,048,576 descriptors (\1 << 20), adding \DYNAMIC\ (\1 << 18\ = 262,144) requested 1,310,720 descriptors. On NVIDIA drivers, \CreateDescriptorHeap\ returns \Ok\ at creation time without failing, but the D3D12 runtime/debug layer caps shader-visible \CBV_SRV_UAV\ heaps at \1,000,000\ (\D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1\ and _TIER_2), reporting \STATE_CREATION ERROR #645: CREATE_DESCRIPTOR_HEAP_INVALID\ and triggering device removal on access.
  • Fix: Gate heap sizing so that if \count + DYNAMIC > PORTABLE_VIEWS\ (\1_000_000), it never requests >1,000,000 descriptors. When \count + MIN_DYNAMIC > PORTABLE_VIEWS, it caps at \make(PORTABLE_VIEWS)\ with available slots \PORTABLE_VIEWS - MIN_DYNAMIC\ and extra \MIN_DYNAMIC.

2. Invalid Resource Flag Combinations

  • B5G5R5A1_UNORM + ALLOW_UNORDERED_ACCESS: In D3D12, \DXGI_FORMAT_B5G5R5A1_UNORM\ (86) and \B5G6R5_UNORM\ (85) do not support typed unordered-access views (\D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS).
  • B4G4R4A4_UNORM + ALLOW_RENDER_TARGET: In D3D12, \DXGI_FORMAT_B4G4R4A4_UNORM\ (115) does not support render-target output (\D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET).
  • Block-compressed formats: BC1-BC7 formats cannot support \RENDER_TARGET, \DEPTH, or \UNORDERED.
  • Fix: In \crates/victory-gpu/src/resource.rs:host_texture, explicitly clear these unsupported flag combinations before calling \CreateCommittedResource.

Verified with 52 passed unit tests in \ ictory-gpu\ on Windows 11 MSVC (\incompatible_host_texture_flags_are_cleared\ and \large_view_heap_is_capped_at_portable_limit), \cargo clippy, and \cargo xtask policy.

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 09:02 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7126879017) Verified the root cause of both issues identified by the D3D12 debug layer and implemented a fix on fork branch \ ix/gpu-resource-format-flags-and-heap-limit\: ### 1. Descriptor Heap Size Exceeding 1,000,000 (1.31M Heap) - **Root Cause**: In \crates/victory-gpu/src/descriptor/host.rs\, \HostHeap::new\ attempted \make(count + DYNAMIC)\ first. When the title requested 1,048,576 descriptors (\1 << 20\), adding \DYNAMIC\ (\1 << 18\ = 262,144) requested **1,310,720** descriptors. On NVIDIA drivers, \CreateDescriptorHeap\ returns \Ok\ at creation time without failing, but the D3D12 runtime/debug layer caps shader-visible \CBV_SRV_UAV\ heaps at \1,000,000\ (\D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1\ and \_TIER_2\), reporting \STATE_CREATION ERROR #645: CREATE_DESCRIPTOR_HEAP_INVALID\ and triggering device removal on access. - **Fix**: Gate heap sizing so that if \count + DYNAMIC > PORTABLE_VIEWS\ (\1_000_000\), it never requests >1,000,000 descriptors. When \count + MIN_DYNAMIC > PORTABLE_VIEWS\, it caps at \make(PORTABLE_VIEWS)\ with available slots \PORTABLE_VIEWS - MIN_DYNAMIC\ and extra \MIN_DYNAMIC\. ### 2. Invalid Resource Flag Combinations - **B5G5R5A1_UNORM + ALLOW_UNORDERED_ACCESS**: In D3D12, \DXGI_FORMAT_B5G5R5A1_UNORM\ (86) and \B5G6R5_UNORM\ (85) do not support typed unordered-access views (\D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS\). - **B4G4R4A4_UNORM + ALLOW_RENDER_TARGET**: In D3D12, \DXGI_FORMAT_B4G4R4A4_UNORM\ (115) does not support render-target output (\D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET\). - **Block-compressed formats**: BC1-BC7 formats cannot support \RENDER_TARGET\, \DEPTH\, or \UNORDERED\. - **Fix**: In \crates/victory-gpu/src/resource.rs:host_texture\, explicitly clear these unsupported flag combinations before calling \CreateCommittedResource\. Verified with 52 passed unit tests in \ ictory-gpu\ on Windows 11 MSVC (\incompatible_host_texture_flags_are_cleared\ and \large_view_heap_is_capped_at_portable_limit\), \cargo clippy\, and \cargo xtask policy\.
Author
Owner

@⁠Qedycik on GitHub · 2026-11-24 12:52 UTC · original

Same two host limits on an RTX 5080 (Blackwell, desktop), driver 32.0.16.1656, Windows 11 26200, main at ffe310e.

What differs on this card and driver:

  • Heap: CreateDescriptorHeap refuses the larger sizes outright (E_INVALIDARG) rather than accepting them, so HostHeap::new takes the existing cap branch: host view heap capped at 1000000 count=1245184. The title asks for 1,245,184 views, so title slots from 934,464 (1,000,000 − MIN_DYNAMIC) up have no host descriptor.
  • Textures: both are refused at creation (E_INVALIDARG) at boot, around the first screen, so they get no host copy at all:
    • 2560×1440 B5G5R5A1_UNORM (86), flags RT | UAV
    • 2560×1440 B4G4R4A4_UNORM (115), flags RT
  • Neither removes the device. Boot, the first-run and legal screens, the intro video, the start screen and loading all run at 30 fps. The first mission's title card is reached; after it the scene stays dark at 0.3–0.9 fps (1.1–3.0 s per frame, up to 2.0 s of it on the GPU). I stopped it after about a minute to stay clear of TDR; no display driver reset in the System log.
  • By then: ~120 host pipeline refused (E_INVALIDARG) compute pipelines and ~430 untranslated shaders (most often: select on an untracked mask, lane mask read as data, descriptor read only as data).
  • WARP (VICTORY_D3D12_WARP=1): menus at 15 fps and the intro video are fine; during world load, an access violation reading 0x0 inside WARP's JIT code, then device removed with DXGI_ERROR_UNSUPPORTED (0x887A0004), much like #338.
**@⁠Qedycik** on GitHub · 2026-11-24 12:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7132042504) Same two host limits on an **RTX 5080 (Blackwell, desktop)**, driver 32.0.16.1656, Windows 11 26200, main at ffe310e. What differs on this card and driver: - **Heap:** `CreateDescriptorHeap` refuses the larger sizes outright (`E_INVALIDARG`) rather than accepting them, so `HostHeap::new` takes the existing cap branch: `host view heap capped at 1000000 count=1245184`. The title asks for 1,245,184 views, so title slots from 934,464 (1,000,000 − `MIN_DYNAMIC`) up have no host descriptor. - **Textures:** both are refused at creation (`E_INVALIDARG`) at boot, around the first screen, so they get no host copy at all: - 2560×1440 `B5G5R5A1_UNORM` (86), flags `RT | UAV` - 2560×1440 `B4G4R4A4_UNORM` (115), flags `RT` - Neither removes the device. Boot, the first-run and legal screens, the intro video, the start screen and loading all run at 30 fps. The first mission's title card is reached; after it the scene stays dark at 0.3–0.9 fps (1.1–3.0 s per frame, up to 2.0 s of it on the GPU). I stopped it after about a minute to stay clear of TDR; no display driver reset in the System log. - By then: ~120 `host pipeline refused` (`E_INVALIDARG`) compute pipelines and ~430 untranslated shaders (most often: select on an untracked mask, lane mask read as data, descriptor read only as data). - WARP (`VICTORY_D3D12_WARP=1`): menus at 15 fps and the intro video are fine; during world load, an access violation reading 0x0 inside WARP's JIT code, then device removed with `DXGI_ERROR_UNSUPPORTED` (0x887A0004), much like #338.
Author
Owner

@⁠Sunkiller-qc on GitHub · 2026-11-24 13:08 UTC · original

The two formats the debug layer flags are the ones #89 (open) handles: B5G5R5A1_UNORM (86) with UAV and B4G4R4A4_UNORM (115) with render target. NVIDIA supports neither as a typed UAV or render target, so #89 creates those textures as R8G8B8A8_UNORM when CheckFeatureSupport says the format isn't supported. #797 shows the same two 2560x1440 textures refused.

The 1,310,720-entry heap against NVIDIA's 1,000,000 limit is expected on main. When the driver refuses a view heap that big, main caps it, and since #21 (97c78d1) the tables past the cap are rebuilt. So that debug-layer message alone isn't the cause.

Could you try #89 on its own? That would tell whether the device removal on the 30-list submission is related to those textures or not.

**@⁠Sunkiller-qc** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7132417708) The two formats the debug layer flags are the ones #89 (open) handles: B5G5R5A1_UNORM (86) with UAV and B4G4R4A4_UNORM (115) with render target. NVIDIA supports neither as a typed UAV or render target, so #89 creates those textures as R8G8B8A8_UNORM when `CheckFeatureSupport` says the format isn't supported. #797 shows the same two 2560x1440 textures refused. The 1,310,720-entry heap against NVIDIA's 1,000,000 limit is expected on main. When the driver refuses a view heap that big, main caps it, and since #21 (`97c78d1`) the tables past the cap are rebuilt. So that debug-layer message alone isn't the cause. Could you try #89 on its own? That would tell whether the device removal on the 30-list submission is related to those textures or not.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:49 UTC · original · edited 2026-11-26 00:49 UTC

Automated triage for the maintainers.

Thanks for the report. The body says it is a placeholder, so the essentials are still missing. Please add them:

  • the NVIDIA driver version and the Windows version/build;
  • the VIctory commit (git rev-parse --short HEAD), and whether it was a release or diag build;
  • the device-removed error text and the relevant crashes.log lines (DRED tail, if VICTORY_D3D12_DRED=1 was set);
  • the host adapter line from the log. On hybrid laptops the host device is created on DXGI adapter 0, which can be the iGPU rather than the RTX.

Please retry on current main (63bcca4) as well, since part of this has landed (see below).

What can be said from the code meanwhile:

  • The 1,310,720-entry heap. HostHeap::new in crates/victory-gpu/src/descriptor/host.rs first asks for the title's count plus the dynamic range. If that is refused, it caps at 1,000,000 (host view heap capped at 1000000), so the debug-layer message by itself is expected. The cap is tracked in #747; open PR #1349 touches it.
  • B5G5R5A1 with a typed UAV. Now on main: #1273 and ea488a9 (#2462) make fits in crates/victory-gpu/src/descriptor/host.rs refuse every typed unordered view in a format the host cannot store to, so that view no longer reaches CreateUnorderedAccessView (its slot stays null and writes are dropped). Tracked in #1753.
  • B4G4R4A4 as a render target. Not on main. artor410's synthetic probe on an RTX 3070 Ti (driver 610.88, main 13f91ca) shows an RTV in B4G4R4A4_UNORM removes the device (0x887A0001), and compares the open PRs: #2767 (RGBA8 stand-in for both formats, keeps writes) covers both uses; #2773 drops the flags instead (safe, but draws and writes are lost); #2442, #1946 and the merged #2462 cover only the UAV half; #2305 and #89 no longer merge. #2626 takes the same stand-in approach as #2767. Also reported in #2563.

The world-load device removal on NVIDIA is discussed in #468 (same GPU, the oldest complete report), with #653 and #314 as further reports. Please add your data there once the details above are in.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7149996139) · edited 2026-11-26 00:49 UTC <!-- victory-issue-triage v1 verdict=needs-info seen=2026-11-25T21:53:36Z at=2026-11-26T00:56:00Z --> Automated triage for the maintainers. Thanks for the report. The body says it is a placeholder, so the essentials are still missing. Please add them: - the NVIDIA driver version and the Windows version/build; - the VIctory commit (`git rev-parse --short HEAD`), and whether it was a release or `diag` build; - the device-removed error text and the relevant `crashes.log` lines (DRED tail, if `VICTORY_D3D12_DRED=1` was set); - the `host adapter` line from the log. On hybrid laptops the host device is created on DXGI adapter 0, which can be the iGPU rather than the RTX. Please retry on current `main` (`63bcca4`) as well, since part of this has landed (see below). What can be said from the code meanwhile: - **The 1,310,720-entry heap.** `HostHeap::new` in `crates/victory-gpu/src/descriptor/host.rs` first asks for the title's count plus the dynamic range. If that is refused, it caps at 1,000,000 (`host view heap capped at 1000000`), so the debug-layer message by itself is expected. The cap is tracked in #747; open PR #1349 touches it. - **B5G5R5A1 with a typed UAV.** Now on `main`: #1273 and ea488a9 (#2462) make `fits` in `crates/victory-gpu/src/descriptor/host.rs` refuse every typed unordered view in a format the host cannot store to, so that view no longer reaches `CreateUnorderedAccessView` (its slot stays null and writes are dropped). Tracked in #1753. - **B4G4R4A4 as a render target.** Not on `main`. artor410's synthetic probe on an RTX 3070 Ti (driver 610.88, `main` `13f91ca`) shows an RTV in `B4G4R4A4_UNORM` removes the device (`0x887A0001`), and compares the open PRs: #2767 (RGBA8 stand-in for both formats, keeps writes) covers both uses; #2773 drops the flags instead (safe, but draws and writes are lost); #2442, #1946 and the merged #2462 cover only the UAV half; #2305 and #89 no longer merge. #2626 takes the same stand-in approach as #2767. Also reported in #2563. The world-load device removal on NVIDIA is discussed in #468 (same GPU, the oldest complete report), with #653 and #314 as further reports. Please add your data there once the details above are in. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠artor410 on GitHub · 2026-11-25 21:53 UTC · original

Comparison on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Synthetic tests only.

Hardware probe on main (temporary test: create a texture, then a UAV view or an RTV, then GetDeviceRemovedReason, one process per case):

  • A UAV view of B5G5R5A1 (86) or B4G4R4A4 (115) crashes inside the driver (0xc0000005).
  • An RTV of 115 removes the device (0x887A0001).
  • CheckFeatureSupport: 86 has RT but no typed UAV; 115 has neither.
PR merges victory-gpu (main 193/2) UAV 86/115 RTV 115 writes kept
#2767 yes 194 pass / 2 known fail safe, view made (RGBA8) safe, view made (RGBA8) yes
#2773 yes 195 / 2 safe, null view safe, RT flag dropped no
#2442 yes 194 / 2 safe, UAV flag dropped device removed no
#2462 yes 193 / 2 safe, null view device removed no
#1946 yes 193 / 2 safe, null view device removed no
#2305 no (conflicts) head 142 / 2 not covered guarded (not probed) no
#89 no (conflicts) head 43 / 0 see #2767 (rebase) see #2767 yes

The 2 known failures are the heap-cap pair, which also fail on main.

Pick: #2767. It is the only mergeable PR that covers both formats and both uses and keeps what the title writes. #2773 is the safe fallback, but it drops those draws and writes. #2462, #1946 and #2442 fix only the UAV half, and #2305 fixes only the RTV half.

Proven in-game: the same widening (86/115 to R8G8B8A8 when CheckFeatureSupport lacks RT or typed UAV) is in the VItoriaBr fork, uiliannn/VItoriaBr@578d459c34, whose README reports the 3D world rendering on an RTX 5060 Ti with no TDR. #2767 matches it.

Differences: VItoriaBr skips copies between packed and widened textures, while #2767 converts uploads. VItoriaBr also widens R9G9B9E5 (67) to RGBA16F. The same change as #89 is in Belobug (da580e4) and DexNom (570a941), both tested on AMD only. Zettrox/ztrx and hyphennn/victory-fork return 404.

(Claude Code, Claude Opus 5.5.)

**@⁠artor410** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7175673041) Comparison on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Synthetic tests only. **Hardware probe on main** (temporary test: create a texture, then a UAV view or an RTV, then `GetDeviceRemovedReason`, one process per case): - A UAV view of B5G5R5A1 (86) or B4G4R4A4 (115) crashes inside the driver (0xc0000005). - An RTV of 115 removes the device (0x887A0001). - `CheckFeatureSupport`: 86 has RT but no typed UAV; 115 has neither. | PR | merges | victory-gpu (main 193/2) | UAV 86/115 | RTV 115 | writes kept | |---|---|---|---|---|---| | #2767 | yes | 194 pass / 2 known fail | safe, view made (RGBA8) | safe, view made (RGBA8) | yes | | #2773 | yes | 195 / 2 | safe, null view | safe, RT flag dropped | no | | #2442 | yes | 194 / 2 | safe, UAV flag dropped | **device removed** | no | | #2462 | yes | 193 / 2 | safe, null view | **device removed** | no | | #1946 | yes | 193 / 2 | safe, null view | **device removed** | no | | #2305 | no (conflicts) | head 142 / 2 | not covered | guarded (not probed) | no | | #89 | no (conflicts) | head 43 / 0 | see #2767 (rebase) | see #2767 | yes | The 2 known failures are the heap-cap pair, which also fail on main. **Pick: #2767.** It is the only mergeable PR that covers both formats and both uses and keeps what the title writes. #2773 is the safe fallback, but it drops those draws and writes. #2462, #1946 and #2442 fix only the UAV half, and #2305 fixes only the RTV half. **Proven in-game:** the same widening (86/115 to R8G8B8A8 when `CheckFeatureSupport` lacks RT or typed UAV) is in the VItoriaBr fork, uiliannn/VItoriaBr@578d459c344aa44753e9a61ea6ba10a8c68f6ea6, whose README reports the 3D world rendering on an RTX 5060 Ti with no TDR. #2767 matches it. Differences: VItoriaBr skips copies between packed and widened textures, while #2767 converts uploads. VItoriaBr also widens R9G9B9E5 (67) to RGBA16F. The same change as #89 is in Belobug (da580e4) and DexNom (570a941), both tested on AMD only. Zettrox/ztrx and hyphennn/victory-fork return 404. (Claude Code, Claude Opus 5.5.)
Author
Owner

@⁠potatoe0100 on GitHub · 2026-11-26 14:12 UTC · original

An update on where this stands on current main (63bcca4). The B5G5R5A1_UNORM unordered access removal is fixed. #2462 (ea488a9) refuses the typed view, and #2286 (bac1364) stops the GetResourceAllocationInfo query from using the title's description. #1753, which tracked that part, was closed after a debug-layer run on an RTX 5080.

The B4G4R4A4_UNORM (format 115) render target still has no stand-in on main; #89 and #2767 are the open PRs for it. A rerun on 63bcca4 would show whether anything fatal is left.

AI-assisted (Claude)

**@⁠potatoe0100** on GitHub · 2026-11-26 14:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/735#issuecomment-7194435613) An update on where this stands on current `main` (`63bcca4`). The `B5G5R5A1_UNORM` unordered access removal is fixed. #2462 (ea488a9) refuses the typed view, and #2286 (bac1364) stops the `GetResourceAllocationInfo` query from using the title's description. #1753, which tracked that part, was closed after a debug-layer run on an RTX 5080. The `B4G4R4A4_UNORM` (format 115) render target still has no stand-in on `main`; #89 and #2767 are the open PRs for it. A rerun on `63bcca4` would show whether anything fatal is left. AI-assisted (Claude)
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#735
No description provided.