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

Closed
github-bot wants to merge 1 commit from gh-pr/1801/head into gh-pr/1801/base
Owner

@⁠bulva2 on GitHub · 2026-11-24 22:47 UTC · original
fix/nvidia-typed-uav-formats → main · +34 −7 · 2 files · 1 commits · closed without merging

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

**@⁠bulva2** on GitHub · 2026-11-24 22:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1801) `fix/nvidia-typed-uav-formats` → `main` · +34 −7 · 2 files · 1 commits · closed without merging **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)
An RTX 3070 lost the device 17 s into the first-boot screens with
DXGI_ERROR_INVALID_CALL. The debug layer names the call:

  CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be
  used with a Typed Unordered Access View.

View creation returns nothing, so D3D12 removes the device for an
invalid one. typed_store() (FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW,
cached per format) guarded only castable views of another family; views
in the texture's own family, typed buffer views and the depth twins'
views went to the device unchecked.

Every typed unordered view now asks it first: fits() checks the format
the view ends up with, buffer_uav() checks typed (not raw, not
structured) buffer views, and twin::uav() checks the twin plane's
format. A refused view leaves make() with nothing, so the slot gets a
null view of the title's kind (writes dropped), and the refused format
is logged once. fits()'s narrower cross-family check is folded into the
new one.

Hosts that store to every format the title uses (AMD) make the same
views as before. On the RTX 3070 (driver 32.0.16.1088) format 86 is
refused once, the debug layer reports no typed-view errors, and the
title boots into the world (frame 1695, 11,178 draws) instead of losing
the device at boot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:45:01 +00:00
github-bot closed this pull request 2026-11-26 04:45:01 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:51 UTC · original

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).

**@⁠upipibi** on GitHub · 2026-11-24 22:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1801#issuecomment-7146719991) 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).

Pull request closed

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