GPU: a shared texture's allocation size is asked of its own description (NVIDIA device removal) #2286

Manually merged
github merged 1 commit from gh-pr/2286/head into gh-pr/2286/base 2026-11-26 05:01:00 +00:00
Owner

@⁠Bullet18x on GitHub · 2026-11-25 09:48 UTC · original
Bullet18x:fix/nvidia-allocation-info → main · +5 −2 · 1 files · 1 commits · merged 2026-11-25 21:56 UTC

Problem

Since 13bbd6f ("one host texture per texture memory"), shared_texture() asks GetResourceAllocationInfo for the bytes sharing saved, using the title's description d. That description can ask for uses its format does not take on the host. On NVIDIA it asks for unordered access on B5G5R5A1_UNORM, the query rejects it, and the device is removed a few seconds into the title on every NVIDIA card.

With VICTORY_D3D12_DEBUG=1 (RTX 5090, driver 621.40):

ID3D12Device::GetResourceAllocationInfo: A texture that has D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS set in
D3D12_RESOURCE_DESC::Flags must be created with a format that either can be used as unordered access, or cast to a
format that could be used as unordered access. FeatureLevel is D3D_FEATURE_LEVEL_12_2. D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM.

followed by host GPU device removed after a submission of 1 lists ... (0x887A0001 DXGI_ERROR_INVALID_CALL) around frame 32.

Fix

Ask the size of the live texture the description is shared with (t.texture.GetDesc()), as HostTexture::new already does. That is a description the host made a texture from, so the query always accepts it. Only the SAVED statistic reads the result; it now counts the live texture's size, which is the memory the sharing actually saved.

Tested

  • RTX 5090 32 GB, driver 621.40, Windows 11 10.0.28000.
  • Debug-layer run: with this change, that GetResourceAllocationInfo error is gone and the run gets past frame 32 (before, the device was removed there every time).
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
  • cargo test -p victory-gpu: 141 passed, 2 failed. The 2 (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views) fail the same way on main on this card: NVIDIA's 1,000,000 view-heap cap, which #2177 / #2185 address.

Not covered

B5G5R5A1_UNORM also reaches CreateUnorderedAccessView and render-target creation on NVIDIA. #1780 and #2180 cover those; with them on top of this, the title gets much further on this card. This PR only fixes the statistics query, which main hits first.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠Bullet18x** on GitHub · 2026-11-25 09:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2286) `Bullet18x:fix/nvidia-allocation-info` → `main` · +5 −2 · 1 files · 1 commits · merged 2026-11-25 21:56 UTC ## Problem Since 13bbd6f ("one host texture per texture memory"), `shared_texture()` asks `GetResourceAllocationInfo` for the bytes sharing saved, using the **title's** description `d`. That description can ask for uses its format does not take on the host. On NVIDIA it asks for unordered access on `B5G5R5A1_UNORM`, the query rejects it, and the device is removed a few seconds into the title on every NVIDIA card. With `VICTORY_D3D12_DEBUG=1` (RTX 5090, driver 621.40): ``` ID3D12Device::GetResourceAllocationInfo: A texture that has D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS set in D3D12_RESOURCE_DESC::Flags must be created with a format that either can be used as unordered access, or cast to a format that could be used as unordered access. FeatureLevel is D3D_FEATURE_LEVEL_12_2. D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM. ``` followed by `host GPU device removed after a submission of 1 lists ... (0x887A0001 DXGI_ERROR_INVALID_CALL)` around frame 32. ## Fix Ask the size of the live texture the description is shared with (`t.texture.GetDesc()`), as `HostTexture::new` already does. That is a description the host made a texture from, so the query always accepts it. Only the `SAVED` statistic reads the result; it now counts the live texture's size, which is the memory the sharing actually saved. ## Tested - RTX 5090 32 GB, driver 621.40, Windows 11 10.0.28000. - Debug-layer run: with this change, that `GetResourceAllocationInfo` error is gone and the run gets past frame 32 (before, the device was removed there every time). - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. - `cargo test -p victory-gpu`: 141 passed, 2 failed. The 2 (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`) fail the same way on `main` on this card: NVIDIA's 1,000,000 view-heap cap, which #2177 / #2185 address. ## Not covered `B5G5R5A1_UNORM` also reaches `CreateUnorderedAccessView` and render-target creation on NVIDIA. #1780 and #2180 cover those; with them on top of this, the title gets much further on this card. This PR only fixes the statistics query, which `main` hits first. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
shared_texture() asks GetResourceAllocationInfo for the size it saves, with
the title's description. That description may ask for uses its format does
not take on the host: on NVIDIA, unordered access on B5G5R5A1_UNORM. The
query rejects it, and the device is removed (DXGI_ERROR_INVALID_CALL) a few
seconds into the title on every NVIDIA card.

Ask it of the live texture the description is shared with, as
HostTexture::new does: a description the host made the texture from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:58 +00:00
github manually merged commit 97df7659b6 into gh-pr/2286/base 2026-11-26 05:01:00 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 13:33 UTC · original

Automated triage for the maintainers.

This is a small, focused fix that may matter a lot. In shared_texture (crates/victory-gpu/src/resource.rs), main sizes the SAVED statistic by calling GetResourceAllocationInfo on the title's description d. That description can ask for unordered access on a format the host cannot take that way (B5G5R5A1 on NVIDIA), and the PR's debug-layer log shows the call failing and the device being removed. The PR queries the live texture's own description instead, and only the statistic reads the result. CI passes. The same line is also fixed inside the much larger open #2212, which uses t.bytes instead, even simpler and with no COM call. That would be a fine one-line change here, but this PR is the cleaner one to merge.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 13:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2286#issuecomment-7163938319) <!-- victory-triage v1 head=97df7659b64900ecf3599d1aa88e6eda2566904f verdict=merge-candidate at=2026-11-25T13:47:00Z --> Automated triage for the maintainers. This is a small, focused fix that may matter a lot. In `shared_texture` (`crates/victory-gpu/src/resource.rs`), main sizes the `SAVED` statistic by calling `GetResourceAllocationInfo` on the title's description `d`. That description can ask for unordered access on a format the host cannot take that way (B5G5R5A1 on NVIDIA), and the PR's debug-layer log shows the call failing and the device being removed. The PR queries the live texture's own description instead, and only the statistic reads the result. CI passes. The same line is also fixed inside the much larger open #2212, which uses `t.bytes` instead, even simpler and with no COM call. That would be a fine one-line change here, but this PR is the cleaner one to merge. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

RTX 4060 Laptop (610.47), merged onto main 13f91cae: neither half fixed alone (the UAV in 86 and the RTV in 115 still remove the device; without the debug layer the allocation-size query did not remove it here); no new failures. 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:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2286#issuecomment-7172522712) RTX 4060 Laptop (610.47), merged onto main 13f91cae: neither half fixed alone (the UAV in 86 and the RTV in 115 still remove the device; without the debug layer the allocation-size query did not remove it here); no new failures. 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).
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!2286
No description provided.