Skip to content

GPU: refuse typed UAVs in unsupported formats regardless of family or castability - #1763

Open
n-romanovich wants to merge 2 commits into
Marvisak:mainfrom
n-romanovich:fix/typed-uav-format-support
Open

n-romanovich wants to merge 2 commits into
Marvisak:mainfrom
n-romanovich:fix/typed-uav-format-support

Conversation

@n-romanovich

@n-romanovich n-romanovich commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes #1753
Fixes #1754

Related: #1755, #1758

fits() in crates/victory-gpu/src/descriptor/host.rs previously checked typed_store() only when cast && family(view) != family(own). When a typed UAV used the texture's own format, a default view (view == 0), or a same-family cast (such as B5G5R5A1_UNORM), CreateUnorderedAccessView was still called on formats without D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW, triggering DXGI_ERROR_INVALID_CALL (0x887A0001) on NVIDIA.

  • Always check typed_store() for unordered == true in fits(), including view == 0 and same-family/non-castable targets.
  • Add synthetic unit test unsupported_typed_uav_format_is_refused.

AI-assisted; verified with cargo test -p victory-gpu --locked -- unsupported_typed_uav_format_is_refused and cargo build --release --locked -p victory on Windows 11 / RTX 5060 Ti.

@DesertGamer

Copy link
Copy Markdown

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Typed UAVs in unsupported formats are refused regardless of family or castable-ness: unsupported_typed_uav_format_is_refused pins the refusal. This tightens view validation — please confirm the format list matches what the hardware tests cover, since over-refusal breaks titles that worked.

@WillyboPeep

Copy link
Copy Markdown

Tested on an RTX 4090 (Ada, 32-lane waves, driver 621.01), Windows 11 build 26300, 32 GB RAM. 70564ae + this PR (ca168de), cargo build --release --locked -p victory, shader cache and pipeline library warmed first with translate --cache --pipelines (25,669 shaders translated, 316 refused; 26,664 of 28,164 pack pipelines in the library). Title 1.0.2.1, Series X profile, scripted Enter presses.

unsupported_typed_uav_format_is_refused passes on this card.

Build Result
70564ae device removed, DXGI_ERROR_INVALID_CALL (0x887A0001) after a submission of 1 list, 28 s after start, during the boot screens
70564ae + #1763 the format is refused once (an unordered view in a format the host cannot store target=86 own=86); boot, menus and loading run at 30 fps and the world is reached about 76 s after start

So on this card it fixes the #1753 / #1754 removal.

What stops it next, about 13 s into the world: 1.2 then 0.4 fps with 2,587 to 3,013 draws dropped per frame, then slow host submission ms=3041 lists=25 (all compute pipelines), then the device is removed with 0x887A0006 (hung) after that submission of 25 lists. The NVIDIA driver logged two Error occurred on GPUID: 100 events (nvlddmkm 153) at the moment of the hang; there was no display-driver reset (no event 4101). The view heap is capped as in #1760 (host view heap capped at 1000000, title count 1,245,184, no room for the null buffer views, 310,720 title slot past the host heap warnings), so this looks like the world stall that #1760 traces to the capped heap, not something this PR adds.

Run and written up with Claude Code.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown

Overlap for the reviewers: #1775 (22:20) and #1780 (22:25) make the same change as this PR (22:09). In descriptor::host::fits, check typed_store for every unordered view, not only one cast to another family, so the B5G5R5A1_UNORM UAV is refused on NVIDIA (#1753 / #1754). This one closes both issues; #1775 closes #1753, #1780 #1754. Only one can merge as is. From reading the three descriptions and file lists (all descriptor/host.rs); nothing built.

AI-assisted (Claude Code).

@Ryanarcx2

Copy link
Copy Markdown

Tested ca168de on an RTX 5070 Ti (driver 32.0.16.1742), Windows 11, after translate --cache --pipelines. On plain 70564ae this machine removes the device 16 to 17 s after start (see #1753).

Run Duration B5G5R5A1 debug messages End
release, no debug layer 2m39s n/a past the account picker; device removed after 7 lists ("GPU will not respond to more commands"), frame rate 0.2 to 0.3 fps beforehand
diag, VICTORY_D3D12_DEBUG=1 7m53s 1 (CreateCommittedResource3 ALLOW_UNORDERED_ACCESS warning, non-fatal) no device removal; the title's own crash handler fired (Breakpad minidump, upload blocked by the net policy)

So the startup INVALID_CALL from #1753 is gone on this card. The later failures look like the existing NVIDIA problems rather than this PR: the diag run still logs 185 CreateComputeShader wave64 refusals and 182 UAV-state "invalid for use as a vertex buffer" messages, and the release run's late removal matches the cutscene hang seen on ffe310e.

One remaining debug-layer note on the same texture: CreateCommittedResource3 also warns that the D3D12_CLEAR_VALUE format is not valid as a render target when ALLOW_RENDER_TARGET is set.

@n-romanovich

Copy link
Copy Markdown
Author

All review feedback has been addressed in dbd4fc2:

  • fits() in crates/victory-gpu/src/descriptor/host.rs does not use a hardcoded format list — typed_store(format) queries ID3D12Device::CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) on the live host device for D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW.
  • sRGB textures with ALLOW_UNORDERED_ACCESS are created typeless on the host in crates/victory-gpu/src/resource.rs, and fits() maps sRGB UAV view formats to their linear counterparts before calling typed_store, so valid sRGB/linear UAVs are not over-refused.
  • Added descriptor::host::tests::supported_typed_uav_formats_are_accepted to pin that supported typed UAV formats (R8G8B8A8_UNORM, R8G8B8A8_UINT, R8G8B8A8_UNORM_SRGB → R8G8B8A8_UNORM, and default/explicit UAVs on R32_UINT and R16G16B16A16_FLOAT) remain accepted while None on typeless is still refused.

Verified on Windows (dbd4fc2):

  • cargo test -p victory-gpu --locked -- descriptor::host::tests::supported_typed_uav_formats_are_accepted descriptor::host::tests::unsupported_typed_uav_format_is_refused — 2 passed, 0 failed.

@AgneyaK

AgneyaK commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tested in the title on an RTX 3050 6 GB Laptop (driver 32.0.16.2124, Windows 11 26300): 70564ae + this PR (dbd4fc2, clean merge), diag build, VICTORY_D3D12_DRED=1, local NVIDIA-adapter patch.

  • Plain 70564ae removes the device (0x887A0001) right after frame 128 here.
  • With this PR: no removal in 5 minutes, frames 128 → 4,096 (the menus, about 15 fps). It logged an unordered view in a format the host cannot store target=86 own=86 once.

One run. Details and the comparison with a sampler-heap change: #1754 (comment)

AI use: Claude Code (Claude Opus 5.5) ran the build and wrote this; the results are from the run described.

@alexodee

Copy link
Copy Markdown

Another NVIDIA data point for this problem: RTX 3070 Ti Laptop 8 GB (driver 596.36, 32-lane waves), 16 GB RAM, Windows 11 26300, Series X mode, 70564ae, diag build, shader cache and pipeline library pre-built.

I tested my own local equivalent, not this PR's commit: in descriptor::host::fits, every unordered view whose final format fails typed_store is refused, including a view in the texture's own format.

build runs result
70564ae 6 of 6 device removed, 0x887A0001, about 40 s after start (frame 128 to ~200), before the profile screen was passed
70564ae + that check 7 of 7 no 0x887A0001; menus at 30 fps and the loading art are reached

Some of the runs also had local diagnostics (probes, per-list submission, reserved textures), so this is not a clean A/B beyond the view check itself.

Where the device goes. The debug layer is not installed here, so I checked GetDeviceRemovedReason after every descriptor call. The first failing call is the CreateUnorderedAccessView in make(), View::Unordered:

view:  format 86 (B5G5R5A1_UNORM), TEXTURE2D, mip 0
host:  2560x1440, 1 mip, format 86, flags 0x5 (RENDER_TARGET | UNORDERED_ACCESS)
title: format 86
castable: [49, 50, 51, 52, 54, 56, 57, 58, 59, 68, 69, 85, 115]

So it is the view in the texture's own family that gets past fits(): the existing typed_store check only covers castable views of another family. With the check, the log has one line, an unordered view in a format the host cannot store view=86 own=86, and the run goes on.

What this does not fix: later, as the world loads, this machine still loses the device with 0x887A0006 (one compute list run alone) or 0x887A0007 / 0x8007000E with memory nearly full. Those look like separate problems.

AI use: Claude Code (Claude Opus 5.5) did the diagnosis and wrote this; posted at the request of the person whose machine ran the tests.

zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 24, 2026
Backport Marvisak#1763 (related to issues Marvisak#1753 and Marvisak#1754). The integrated host.rs is byte-identical to the independently tested PR head. Windows MSVC-target GPU test compilation passed with blake3/pure only in a disposable Linux check. The source PR records one RTX 3050 Laptop Windows 11 menu run with no early removal; no exact target machine run here.
@dragoso

dragoso commented Nov 25, 2026

Copy link
Copy Markdown

I tested this on a Blackwell card, and it clears the boot-time removal reported in #1754 and #1753.

Setup

  • RTX 5060 Ti 16 GB, driver 617.42, Windows 11 26300. DXGI adapter 0 is the 5060 Ti.
  • diag build with VICTORY_D3D12_DRED=1.
  • Shader cache and pipeline library warmed with translate --cache --pipelines on 70564ae.
  • The same scripted Enter presses in both runs.

main 70564ae

This PR (dbd4fc2) on 70564ae

  • No INVALID_CALL. The run gets past frame 128, through the menus and the start screen, and on into loading.
  • About 2 min 20 s in, the device is removed with 0x887A0006 (HUNG), after 16 lists.
  • DRED stops at command 53 of 69 in list 5, a single dispatch between barriers: compute f607780aa8e502d0.
  • Slow submissions before that: 24, median 459 ms, max 5,685 ms. That looks like a separate GPU timeout, not a problem with this change.

The host view heap capped at 1000000 warning (#1760, #1808) appears in both runs.

No retail data, logs or screenshots are attached.

AI-assisted (Claude Code).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Recommended for a maintainer's look. fits() in crates/victory-gpu/src/descriptor/host.rs now checks typed_store for every unordered view, in the format the view is actually created in: the texture's own format for a default view or a non-castable view of a typed texture, and the view's format otherwise. Before, the check only ran for a castable view of another family, so a B5G5R5A1_UNORM UAV in the texture's own format reached CreateUnorderedAccessView and removed the device on NVIDIA (#1753, #1754). I checked the target choice against the format rewrite at the end of fits and the sRGB-to-linear mapping above it. Several testers report that the boot-time removal is gone on RTX 30/40/50 cards. #1775 makes the same change and #1780 a partial one (it misses the view == 0 case); only one should merge, and this one is the earliest and most tested. CI: passing.


Generated by Claude Code

@n-romanovich

Copy link
Copy Markdown
Author

@Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.

@walterwallaceson

Copy link
Copy Markdown

Windows 10, RTX 3070, rebased head 50d91b1: works, and does what #1775 does on the same stack.

Setup: RTX 3070 8 GB, driver 621.14, Windows 10 22H2 (19045). main 940d32f + #463 (Agility SDK runtime, needed on Windows 10) + #1751 + #1906 + #385 + #688 + #189 (wave32). Diag build, a scripted Enter at the start screen, nothing skipped. The three rows differ only in which of the two fixes is in.

end world from
neither #1763 nor #1775 device removed 13 s after start (frame 64): DXGI_ERROR_INVALID_CALL after a submission of one list, no breadcrumbs, the #1753 symptom –
#1775 (b079909) 15 min, no removal, no errors 76 s
this PR (50d91b1) instead 15 min, no removal, no errors 82 s

With this PR the two 15-minute runs match within run-to-run noise (122 vs 121 submissions over 250 ms, 0.85 vs 0.9 fps at the end). cargo test --workspace gives the same results as with #1775 plus one more passing test.

Since #1775 is proposed for close as a duplicate of this PR: on this card and Windows 10 I see no case #1775 covers that this one doesn't.

Not checked: the removal with the debug layer on (so not shown that it is the same B5G5R5A1_UNORM view here); more than one run per row.

No game data attached. I'm testing with Claude's help, and Claude drafted this comment.

@ShyVortex

ShyVortex commented Nov 25, 2026 •

Copy link
Copy Markdown

RTX 3080 Ti Laptop 16 GB (Ampere, 32-lane waves, driver 621.40), i7-12700H, 32 GB RAM, hybrid graphics (Iris Xe), Windows 11 26300. Diag build, VICTORY_D3D12_DRED=1, TDR at defaults (logged level=default delay=default ddi_delay=default).

  • main 940d32f: device removed (0x887A0004 / 0x887A0001) in the menus, ~6 s after no host texture for the 2560x1440 format 115 target. 2 of 2 runs.
  • 940d32f + this PR (50d91b1, clean): no removal at boot. Menus and loading art at 21-28 fps, through to world loading (the title's own state: "Game Running", prologue leadout cutscene prestreaming).

So it does what it says on this machine too.

What came next is the world-entry problem (#71), not this change, but one detail may be useful: about 3 s into world loading Windows reset the GPU (nvlddmkm 153) with TDR at defaults, the runtime logged no device removal at all, ~30 s later the title faulted (0xc0000005, write to 0x0 at victory-image+0x23cf683), and then the whole PC froze hard and needed the power button (Kernel-Power 41, bugcheck 0). The title's own crash report at that moment shows 0.9 GB of a 50 GB page file free, so commit was nearly exhausted; my sampler died with the PC, so I can't say how much of that was VIctory's. #1054 / 42961e8 warn only for TdrLevel 0/1; here it froze with the defaults.

AI-assisted (Claude Code).

@r4tedx

r4tedx commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

One more NVIDIA data point for 50d91b1, with the debug layer's reason for the removal on plain main.

RTX 5070 (non-Ti), driver 616.92, Windows 11, diagnostics build (--profile diag --features diagnostics), Series X mode:

  • main 940d32f, D3D12 debug layer + DRED: device removed 11 s in, at boot. The debug layer logs id 342, CreateUnorderedAccessView: typed UAV of B5G5R5A1_UNORM not supported, then id 232, RemoveDevice / INVALID_CALL. Without the debug layer: removed at 9.5 s, 0x887A0001, DRED breadcrumbs empty.
  • main + this PR (50d91b1), DRED on: 10 minutes (the time limit I set) with no device removal, menus, then the world after the opening credits. No Kernel-Power or display-driver events in the System log during either run.

Not fixed by this PR, and not expected to be: the host view heap is still capped at 1,000,000 of the 1,245,184 descriptors asked for, and the frame is still unlit on main.

These were runs of the title with my own local copy of its data on my PC; only the logged messages and counts are quoted.

AI-assisted

@StExpeditus

Copy link
Copy Markdown

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 50d91b1. cargo test --workspace --locked --no-fail-fast -> 697 passed, 6 failed, 10 ignored. Failed: descriptor::host::tests::dynamic_slots_are_held_until_released ... FAILED | draw::tests::root_views_reach_their_copy_and_read_zeros_past_it ... FAILED | memory::tests::lists_share_a_table_and_copies_keep_their_views ... FAILED | emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride ... FAILED | emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros ... FAILED | emit::synthetic_tests::gathers_at_a_level_match_the_hardware ... FAILED

@Xvania7 Xvania7 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally merged onto origin/main (940d32f, head 50d91b1, Windows 10 x64 19045, NVIDIA GeForce RTX 5060, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib -- --test-threads=1 descriptor:: — 11 passed, 1 failed (unrelated baseline #1835 NVIDIA 1M heap limit in dynamic_slots_are_held_until_released; new supported_typed_uav_formats_are_accepted and unsupported_typed_uav_format_is_refused passed)
  • cargo test -p victory-gpu --lib -- --test-threads=1 draw::tests:: — 4 passed, 1 failed (unrelated baseline #1999 Win10 in-box ID3D12Device10 failure in a_texture_written_in_one_format_reads_in_another_through_a_placed_view)
  • cargo clippy -p victory-gpu --all-targets -- -D warnings — 0 warnings

Clean typed-UAV format validation (addresses NVIDIA 0x887A0001 on B5G5R5A1_UNORM / unsupported formats).

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 25, 2026
…evice removal, head 50d91b1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 25, 2026
…in game, 0 programs lost

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet