GPU: unordered views only in formats the host stores to (NVIDIA device removal on B5G5R5A1) #1843

Open
github-bot wants to merge 1 commit from github-bot/gh-1843 into main AGit
Owner

@⁠KevinPratap on GitHub · 2026-11-24 23:16 UTC · original
KevinPratap:gpu/typed-uav-format-support → main · +25 −6 · 1 files · 1 commits · open

Problem

On NVIDIA (RTX 4050 Laptop, driver 621.24), current main removes the device a few seconds into the menus. The D3D12 debug layer names the call:

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

fits() asks typed_store() only when a view is cast to another format family. An unordered view in the texture's own format skips the check. AMD supports typed stores to this format; NVIDIA does not.

Fix

Every unordered view now needs typed stores in its final format (stores()). Without them the view is null: its writes are dropped, and that's logged once.

Verified

  • The same run on that laptop: before, the device was removed after about 35 s; after, no removal, and it keeps running through the menus. The new warning fired once, for format 86.
  • New test unordered_views_need_typed_stores passes.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings is clean.

Only crates/victory-gpu/src/descriptor/host.rs changes.

AI-assisted.

🤖 Generated with Claude Code

**@⁠KevinPratap** on GitHub · 2026-11-24 23:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843) `KevinPratap:gpu/typed-uav-format-support` → `main` · +25 −6 · 1 files · 1 commits · open ## Problem On NVIDIA (RTX 4050 Laptop, driver 621.24), current `main` removes the device a few seconds into the menus. The D3D12 debug layer names the call: ``` ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. RemoveDevice: ... DXGI_ERROR_INVALID_CALL ``` `fits()` asks `typed_store()` only when a view is cast to another format family. An unordered view in the texture's own format skips the check. AMD supports typed stores to this format; NVIDIA does not. ## Fix Every unordered view now needs typed stores in its final format (`stores()`). Without them the view is null: its writes are dropped, and that's logged once. ## Verified - The same run on that laptop: before, the device was removed after about 35 s; after, no removal, and it keeps running through the menus. The new warning fired once, for format 86. - New test `unordered_views_need_typed_stores` passes. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` is clean. Only `crates/victory-gpu/src/descriptor/host.rs` changes. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fits() checked typed-store support only for views cast to another family, so an unordered view in the texture's own format went to CreateUnorderedAccessView regardless. On an RTX 4050 Laptop, main removed the device a few seconds into the menus: the D3D12 debug layer reports 'The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View' and DXGI_ERROR_INVALID_CALL. Every unordered view now needs typed stores in its final format; without them it is null (its writes dropped, logged once). With this the same run kept going through the menus with no device removal.

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

@⁠upipibi on GitHub · 2026-11-24 23:16 UTC · original

Overlap for the reviewers: the same B5G5R5A1_UNORM typed-UAV removal on NVIDIA (#1753 / #1754) has open fixes on the view side in descriptor/host.rs (#1763, #1775, #1780, #1801) and on the texture side in resource.rs (#1787, #1832). From reading the file lists; nothing built.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-24 23:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843#issuecomment-7147222626) Overlap for the reviewers: the same `B5G5R5A1_UNORM` typed-UAV removal on NVIDIA (#1753 / #1754) has open fixes on the view side in `descriptor/host.rs` (#1763, #1775, #1780, #1801) and on the texture side in `resource.rs` (#1787, #1832). From reading the file lists; nothing built. AI-assisted (Claude Code).
Author
Owner

@⁠0xSAW on GitHub · 2026-11-25 01:44 UTC · original

Tested commit 3502e6c on NVIDIA GeForce RTX 2060 6GB (Turing / TU106, Driver 566.14, Windows 11 x64).

Can confirm this completely resolves the D3D12 device removal crash on Turing:

Context & Reproduction

On main prior to this PR, running with VICTORY_D3D12_DEBUG=1 consistently produced a device removal immediately after the first command list submission:

Results with PR #1843

  1. Unit Test: crates/victory-gpu/src/descriptor/host.rs::tests::unordered_views_need_typed_stores passed cleanly.
  2. Runtime Verification: Built binary with the diag profile (features = ["diagnostics"]) and executed with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=1:
    • The D3D12 debug layer reported 0 errors / 0 warnings regarding unsupported UAV formats.
    • The device is no longer removed on B5G5R5A1_UNORM allocation.
    • Command list submission and descriptor allocation proceed successfully past the GPU initialization stage.
      (The execution later encountered an unrelated CPU-side 0xc0000005 null-pointer write in image loading, which is expected on this branch and unrelated to D3D12/GPU views).

LGTM! Thanks for the fix, @⁠KevinPratap.

**@⁠0xSAW** on GitHub · 2026-11-25 01:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843#issuecomment-7149900503) Tested commit `3502e6c` on **NVIDIA GeForce RTX 2060 6GB** (Turing / TU106, Driver 566.14, Windows 11 x64). Can confirm this completely resolves the D3D12 device removal crash on Turing: ### Context & Reproduction On `main` prior to this PR, running with `VICTORY_D3D12_DEBUG=1` consistently produced a device removal immediately after the first command list submission: ### Results with PR #1843 1. **Unit Test:** `crates/victory-gpu/src/descriptor/host.rs::tests::unordered_views_need_typed_stores` passed cleanly. 2. **Runtime Verification:** Built binary with the `diag` profile (`features = ["diagnostics"]`) and executed with `VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_DRED=1`: - The D3D12 debug layer reported **0 errors / 0 warnings** regarding unsupported UAV formats. - The device is no longer removed on `B5G5R5A1_UNORM` allocation. - Command list submission and descriptor allocation proceed successfully past the GPU initialization stage. *(The execution later encountered an unrelated CPU-side `0xc0000005` null-pointer write in image loading, which is expected on this branch and unrelated to D3D12/GPU views).* LGTM! Thanks for the fix, @⁠KevinPratap.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:18 UTC · original

Automated triage for the maintainers.

Proposed close: duplicate of #1763. The new stores helper in fits (crates/victory-gpu/src/descriptor/host.rs) refuses an unordered view in a format without typed stores, in all three arms. That fixes the B5G5R5A1_UNORM device removal in #1753. #1763 makes the same change to the same function, merges cleanly and was triaged first. Its tests make a real host texture and check the castable case. unordered_views_need_typed_stores here only compares stores with typed_store, so it does not exercise fits.

If this PR covers a case #1763 misses, say which one and this verdict can be revisited.

CI: no check runs on the head commit.

This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843#issuecomment-7154650940) <!-- victory-triage v1 head=3502e6c54ae71c0fb2fc2fe9fbfd3023293dc00b verdict=proposed-close at=2026-11-25T06:37:30Z --> Automated triage for the maintainers. **Proposed close: duplicate of #1763.** The new `stores` helper in `fits` (`crates/victory-gpu/src/descriptor/host.rs`) refuses an unordered view in a format without typed stores, in all three arms. That fixes the `B5G5R5A1_UNORM` device removal in #1753. #1763 makes the same change to the same function, merges cleanly and was triaged first. Its tests make a real host texture and check the castable case. `unordered_views_need_typed_stores` here only compares `stores` with `typed_store`, so it does not exercise `fits`. If this PR covers a case #1763 misses, say which one and this verdict can be revisited. CI: no check runs on the head commit. This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠KainanP on GitHub · 2026-11-25 19:35 UTC · original

RTX 4060 Laptop (610.47), merged onto main 13f91cae (test-only conflict, kept both): B5G5R5A1 UAV half fixed (views refused), B4G4R4A4 target half still removes the device; no new failures. With #1832 too: same, and also fixes the UAV half on Intel UHD. Details and the side-by-side table with the other #1753 PRs: #1753. Tested with the help of an AI assistant (Claude Code).

**@⁠KainanP** on GitHub · 2026-11-25 19:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843#issuecomment-7172518778) RTX 4060 Laptop (610.47), merged onto main 13f91cae (test-only conflict, kept both): B5G5R5A1 UAV half **fixed** (views refused), B4G4R4A4 target half still removes the device; no new failures. With #1832 too: same, and also fixes the UAV half on Intel UHD. Details and the side-by-side table with the other #1753 PRs: https://git.gtahub.st/github/Marvisak--VIctory/issues/1753. Tested with the help of an AI assistant (Claude Code).
Author
Owner

@⁠krcenov on GitHub · 2026-11-25 21:52 UTC · original

Tested #1843 + #1832 together on 940d32f: RTX 3070, driver 32.0.16.1714, Windows 10 22H2 (19045), with a local Agility SDK 1.620.2 export (needed on Windows 10, see #2563). No more device removal from the B5G5R5A1 typed UAV. It ran ~5 min 40 s at a steady 30 fps until an unrelated GPU hang at world load. Debug layer on (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1).

**@⁠krcenov** on GitHub · 2026-11-25 21:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/1843#issuecomment-7175645723) Tested #1843 + #1832 together on 940d32f: RTX 3070, driver 32.0.16.1714, Windows 10 22H2 (19045), with a local Agility SDK 1.620.2 export (needed on Windows 10, see #2563). No more device removal from the B5G5R5A1 typed UAV. It ran ~5 min 40 s at a steady 30 fps until an unrelated GPU hang at world load. Debug layer on (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1).
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1843/head:github-bot/gh-1843'
git switch 'github-bot/gh-1843'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1843'
git switch 'github-bot/gh-1843'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1843'
git switch 'github-bot/gh-1843'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1843'
git switch 'main'
git merge --squash 'github-bot/gh-1843'
git switch 'main'
git merge --ff-only 'github-bot/gh-1843'
git switch 'main'
git merge 'github-bot/gh-1843'
git push origin 'main'
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!1843
No description provided.