GPU: no unordered views in formats the host cannot store (NVIDIA) #1800

Closed
bulva2 wants to merge 1 commit from upstream-pr/1801 into main
bulva2 commented 2026-11-24 22:47:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by bulva2 on 2026-11-24T22:47:28Z.


Title: GPU: no unordered views in formats the host cannot store (NVIDIA boot crash)

Summary

On NVIDIA, main loses the device about 17 s into the first-boot screens
(DXGI_ERROR_INVALID_CALL). The cause is a typed unordered access view in
B5G5R5A1_UNORM, a format NVIDIA cannot store to through typed UAVs. This
change asks the device before making any typed UAV and leaves the slot a
null view when the format is refused. With it, an RTX 3070 boots into the
world again.

Hosts that store to every format the title uses (AMD) make exactly the same
views as before.

The failure

RTX 3070, driver 32.0.16.1088, main at 70564ae, diagnostics build with
VICTORY_D3D12_DEBUG=1:

D3D12: ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM)
cannot be used with a Typed Unordered Access View. This is because the current
graphics implementation does not even support this Format.
D3D12: ID3D12Device::RemoveDevice: Device removal has been triggered for the
following reason (DXGI_ERROR_INVALID_CALL: ...)
ERROR victory_gpu::host: host GPU device removed after a submission of 1 lists;
breadcrumbs (done/count, list) []

Create*View returns nothing, so D3D12 removes the device for an invalid
one. The same machine reached the world on 8e79c80; the views appeared
with the texture changes since then (13bbd6f and others).

Cause

typed_store() already queries D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW
(cached per format), but it only guarded castable views of another format
family. Three paths made typed UAVs without it:

  • fits(): a view in the texture's own family (or a castable one of the
    same family);
  • buffer_uav(): typed buffer views (not raw, not structured);
  • twin::uav(): views of a depth texture's writable twin.

The change

  • fits() checks the format the view ends up with (the title's view format,
    or the texture's own when the view takes it). This subsumes the old
    cross-family check, which is removed.
  • buffer_uav() checks typed buffer views; raw and structured views use
    fixed formats and are unchanged.
  • twin::uav() checks the twin plane's format.
  • A refused view returns nothing from make(), so the slot gets the existing
    null_for() null view of the title's kind (writes dropped, reads zero),
    as for any view the host cannot make.
  • typed_store() logs each refused format once:
    the host cannot store to unordered views in this format: they are null format=86.

34 lines added, 7 removed, in descriptor/host.rs and twin.rs.

Testing

  • RTX 3070, in game (diagnostics build, debug layer and DRED on): format 86
    is refused once, the debug layer reports no typed-UAV errors, and the title
    boots into the world (first world frame 1695, 11,178 draws). Before: device
    removed at boot in 2 of 2 runs.
  • New test typed_unordered_views_only_in_formats_the_device_stores:
    R32_UINT (required on every device) is accepted, UNKNOWN is not.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without
    --all-features: clean.
  • cargo test --workspace: passes except two victory-gpu tests that already
    fail on main on NVIDIA (see below).
  • Not tested on AMD. The change only skips views the device itself reports
    it cannot make, so an AMD host that supports these formats takes the same
    path as before.

Known NVIDIA issues this does not fix

Found while testing, left for separate changes:

  1. After the boot fix, the world still hangs the GPU about 11 s in
    (DXGI_ERROR_DEVICE_HUNG, a dispatch with no marker).
  2. Heap indices past NVIDIA's heap. NVIDIA caps shader-visible view heaps
    at exactly 1,000,000 descriptors (measured on the RTX 3070, binding tier 3).
    Translated shaders clamp heap indices below HEAP_VIEWS (2^21) and read
    NULL_BUFFER_VIEW (2^21 − 2) for a missing buffer view. On a 1,000,000-slot
    heap that null view is always out of bounds.
  3. Too few dynamic slots. At the cap, NVIDIA gets 2^16 dynamic slots; they
    ran out 2 s into the world in earlier runs, dropping about 800 indirect mesh
    draws per frame.
  4. Two tests fail on NVIDIA on main:
    dynamic_slots_are_held_until_released (asserts a heap of at least
    HEAP_VIEWS) and lists_share_a_table_and_copies_keep_their_views (asserts
    2^18 dynamic slots).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6592946292 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1801). Originally posted by [bulva2](https://github.com/bulva2) on 2026-11-24T22:47:28Z. --- **Title:** GPU: no unordered views in formats the host cannot store (NVIDIA boot crash) ## Summary On NVIDIA, `main` loses the device about 17 s into the first-boot screens (`DXGI_ERROR_INVALID_CALL`). The cause is a typed unordered access view in `B5G5R5A1_UNORM`, a format NVIDIA cannot store to through typed UAVs. This change asks the device before making any typed UAV and leaves the slot a null view when the format is refused. With it, an RTX 3070 boots into the world again. Hosts that store to every format the title uses (AMD) make exactly the same views as before. ## The failure RTX 3070, driver 32.0.16.1088, `main` at `70564ae`, diagnostics build with `VICTORY_D3D12_DEBUG=1`: ``` D3D12: ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. This is because the current graphics implementation does not even support this Format. D3D12: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_INVALID_CALL: ...) ERROR victory_gpu::host: host GPU device removed after a submission of 1 lists; breadcrumbs (done/count, list) [] ``` `Create*View` returns nothing, so D3D12 removes the device for an invalid one. The same machine reached the world on `8e79c80`; the views appeared with the texture changes since then (`13bbd6f` and others). ## Cause `typed_store()` already queries `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW` (cached per format), but it only guarded castable views of another format family. Three paths made typed UAVs without it: - `fits()`: a view in the texture's own family (or a castable one of the same family); - `buffer_uav()`: typed buffer views (not raw, not structured); - `twin::uav()`: views of a depth texture's writable twin. ## The change - `fits()` checks the format the view ends up with (the title's view format, or the texture's own when the view takes it). This subsumes the old cross-family check, which is removed. - `buffer_uav()` checks typed buffer views; raw and structured views use fixed formats and are unchanged. - `twin::uav()` checks the twin plane's format. - A refused view returns nothing from `make()`, so the slot gets the existing `null_for()` null view of the title's kind (writes dropped, reads zero), as for any view the host cannot make. - `typed_store()` logs each refused format once: `the host cannot store to unordered views in this format: they are null format=86`. 34 lines added, 7 removed, in `descriptor/host.rs` and `twin.rs`. ## Testing - **RTX 3070, in game** (diagnostics build, debug layer and DRED on): format 86 is refused once, the debug layer reports no typed-UAV errors, and the title boots into the world (first world frame 1695, 11,178 draws). Before: device removed at boot in 2 of 2 runs. - **New test** `typed_unordered_views_only_in_formats_the_device_stores`: `R32_UINT` (required on every device) is accepted, `UNKNOWN` is not. - `cargo clippy --workspace --all-targets -- -D warnings`, with and without `--all-features`: clean. - `cargo test --workspace`: passes except two `victory-gpu` tests that already fail on `main` on NVIDIA (see below). - **Not tested on AMD.** The change only skips views the device itself reports it cannot make, so an AMD host that supports these formats takes the same path as before. ## Known NVIDIA issues this does not fix Found while testing, left for separate changes: 1. **After the boot fix, the world still hangs the GPU** about 11 s in (`DXGI_ERROR_DEVICE_HUNG`, a dispatch with no marker). 2. **Heap indices past NVIDIA's heap.** NVIDIA caps shader-visible view heaps at exactly 1,000,000 descriptors (measured on the RTX 3070, binding tier 3). Translated shaders clamp heap indices below `HEAP_VIEWS` (2^21) and read `NULL_BUFFER_VIEW` (2^21 − 2) for a missing buffer view. On a 1,000,000-slot heap that null view is always out of bounds. 3. **Too few dynamic slots.** At the cap, NVIDIA gets 2^16 dynamic slots; they ran out 2 s into the world in earlier runs, dropping about 800 indirect mesh draws per frame. 4. **Two tests fail on NVIDIA on `main`:** `dynamic_slots_are_held_until_released` (asserts a heap of at least `HEAP_VIEWS`) and `lists_share_a_table_and_copies_keep_their_views` (asserts 2^18 dynamic slots). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
catminou4 commented 2026-11-24 23:05:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:24Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

No unordered views in formats the host cannot store (NVIDIA): third leg of the #1775/#1787/#1801 capability-gating trio.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048801345 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1801#pullrequestreview-6048801345). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:03:24Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. No unordered views in formats the host cannot store (NVIDIA): third leg of the #1775/#1787/#1801 capability-gating trio.
upipibi commented 2026-11-24 23:06:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T22:51:10Z.


Overlap for the reviewers: this is the fourth open fix for the same B5G5R5A1_UNORM typed-UAV boot crash on NVIDIA (#1753 / #1754). #1763 (opened first, at 22:09), #1775 and #1780 each make descriptor::host::fits check typed_store for every unordered view. #1787 (resource.rs) is the complementary half: it drops UNORDERED from such a texture's host description before GetResourceAllocationInfo. This PR edits descriptor/host.rs like the first three. From reading the descriptions and file lists; nothing built.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146719991 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1801#issuecomment-7146719991). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T22:51:10Z. --- Overlap for the reviewers: this is the fourth open fix for the same `B5G5R5A1_UNORM` typed-UAV boot crash on NVIDIA (#1753 / #1754). #1763 (opened first, at 22:09), #1775 and #1780 each make `descriptor::host::fits` check `typed_store` for every unordered view. #1787 (`resource.rs`) is the complementary half: it drops `UNORDERED` from such a texture's host description before `GetResourceAllocationInfo`. This PR edits `descriptor/host.rs` like the first three. From reading the descriptions and file lists; nothing built. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:07:13 +00:00

Pull request closed

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!1800
No description provided.