GPU: boot on NVIDIA when a format cannot be a typed UAV #1926
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1926
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1926"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@QuentinDanblon on GitHub · 2026-11-25 01:06 UTC · original
QuentinDanblon:nvidia-boot→main· +49 −0 · 1 files · 247 commits · closed without mergingWhat this fixes
The title removed the host GPU on NVIDIA about 30 s after launch, before the menus. The debug layer names the calls:
GetResourceAllocationInfo/CreateCommittedResource3for a 2560x1440B5G5R5A1_UNORMtexture withALLOW_UNORDERED_ACCESS: "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".CreateUnorderedAccessViewwith a typed UAV ofB5G5R5A1_UNORM: "the current graphics implementation does not even support this Format", thenRemoveDevice(DXGI_ERROR_INVALID_CALL).B5G5R5A1_UNORMis not a typed-UAV format on this NVIDIA driver. The old code asked anyway, so the device was removed.This PR asks the host once per format (
resource::typed_uav,D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW):host_descdropsALLOW_UNORDERED_ACCESSbefore any resource creation call when the format cannot carry it.descriptor::host::fitsrefuses unordered views for those formats, so a null UAV is made instead and its writes are dropped.A format the host does support as a typed UAV keeps the permission, so the AMD path is unchanged.
Related: #1754, #1753, #1758, #1832, #1843. This unifies the two checks (#1832 dropped the resource flag, #1843 refused the view) behind one host query, and covers the no-description/default-view path as well.
Verification
Windows 11, RTX 5090, retail Series X build, Series X mode, 90% CPU cap.
crashes.logrecords0x887A0004and0x887A0001, and the debug layer points at the B5G5R5A1 UAV.Performance findings (not fixed here)
With
VICTORY_GPU_TIMING=1the world loads and the GPU timestamps name the costs:WindNew:CS_CopyLatestWindFieldForRenderingWithSmooth(00167d58cc5a78d7): about 1.3 s per frame.MSNC_VS_TransformSkinDplusPS_DeferredTextured(d0503aa87911743e,5a0b31c2cd7fb82e): about 1.8 s for two indirect draws.CS_Gather_Classified(8bbcbda6008eaa37): about 94 ms.The shadow-trace shader
f607780aa8e502d0(CS_IrradianceCache_ShadowTrace_WithFar) makes one world-load submission run 4.8 s. WithoutVICTORY_GPU_TIMING=1(which submits lists one at a time) the 2 s driver watchdog removes the device.VICTORY_SKIP_PIPELINES=f607780aa8e502d0also gets into the world. That loop and the translated-code cost are the next work. This PR addsVICTORY_DUMP_DXILto inspect the emitted code and an optional CPU ceiling so a long run leaves the machine responsive.Host copies of title memory are system memory (
D3D12_MEMORY_POOL_L0, write-back), so the shaders read them over PCIe. Mapping a GPU-local write-combine heap directly and letting the CPU write it reached the menus but crashed the title about 30 s into the world load, even afterFlushProcessWriteBuffers, so a VRAM mirror fed by GPU copies of the changed pages, with the shader writes copied back, is the next experiment.Known limitations left as on main
HEAP_VIEWSis still 2^21, so a computed index in the gap is not safe. #1848 and #1760 are the right place for that.B4G4R4A4_UNORMrender target the title asks for (format 115). The warning remains and the host texture is missing.cargo test --workspacestill fails the two heap-cap tests and the threevictory-shadertests reported in #1835, exactly as on main.cargo clippy --workspace --all-targets --locked -- -D warningspasses, and the new ignored GPU test passes withcargo test -p victory-gpu -- --ignored unordered_access_follows_typed_uav.Testing
@Headache3318 on GitHub · 2026-11-25 01:16 UTC · original
Independent second-read at head (not merged with main). The actual NVIDIA UAV fix is small and correct:
resource.rsqueries the host D3D12 device at runtime viaCheckFeatureSupport(D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)and drops theUNORDEREDflag when the format cannot be a typed UAV (avoids the device-removal error on B5G5R5A1_UNORM). The descriptor/host.rs change propagates the same runtime check. This is the right approach for NVIDIA compatibility.However, the fix is buried in a massive 104-file, +992/-11,875 line architectural simplification PR that removes many internal crates, tests, and features (memory.rs, bindless.rs, pipelines.rs, shaderpack.rs, publish.rs, many diagnostic features). The PR title severely understates the scope, making review difficult and obscuring potential regressions from the wholesale test removal. The removed tests covered title writes under GPU write ranges, snapshots, off-element buffer views, and root UAV write-back.
Recommendation: the UAV fix should land, but ideally split from the architectural simplification. The massive test removal is a regression risk and should be documented with rationale. A commit message explaining the removals would help reviewers understand the trade-offs.
Arch Linux, kernel 7.3.5-arch1-1, zero-CPU read, AI-assisted.
@fiestorra on GitHub · 2026-11-25 01:54 UTC · original
Measured both bit choices on the cards where this matters: they agree, so the queue has two pull requests for one fix
I ran the two format-support tests side by side on the RTX 4090 (driver
32.0.16.2124, session 1 — the adapter that refuses this format) and on the integrated AMD of the same machine (32.0.21045.29003, session 0):Support1TYPED_UAV(0x100000)Support20xc0)B5G5R5A1_UNORM0xe4d3f00x200R8G8B8A8_UNORM0x33fcd3f30x102c0R32_FLOAT0x6f4d7fb0x2c8B8G8R8A8_UNORM_SRGB0x1010f00x200So for the format this is about,
Support1 & TYPED_UNORDERED_ACCESS_VIEW(#1926) andSupport2 & (UAV_TYPED_LOAD | UAV_TYPED_STORE)(#1832, mine) give the same answer, and the one format where they differ — the sRGB one — never reaches the check:host_descmaps sRGB with the unordered-access permission to its UNORM family before it, which is why the pair disagrees there harmlessly.Two consequences, and the second is the one worth acting on:
Support1is the flag the D3D12 documentation points at;Support2's typed load/store is what a shader actually does. On these two drivers they agree on the formats the title uses, and the sRGB case shows they will not always.host_descdrops the permission, tri-state when the host cannot be asked, measured on the 4090 — noGetResourceAllocationInforefusal, no removal, 2,048 frames in 120 s) and #1926 (+214/−34 across nine files, which also carries CPU, pipeline and manifest changes). A maintainer should only have to review one of them.I am not precious about which. Mine is smaller and was measured on the card that fails; yours is the one that reads the documented flag and additionally refuses the unsupported view at creation, which is a real improvement over dropping the permission alone. If you want yours in, say so and I close mine — I would only ask that the tri-state behaviour be kept: when the host cannot be asked, the description should stay as the title wrote it, because dropping a permission that was legal loses a texture's writes silently.
If it is easier the other way round, mine is
MERGEABLE/CLEANwith a green check today and yours is too, so it is a choice and not a queue problem.No game data is involved: formats, support masks and counts.
Written with an AI assistant.
@welisonzika14-jpg on GitHub · 2026-11-25 03:01 UTC · original
RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC. No game files, unit tests only. Head
644aed4merged ontomain940d32f.resource::tests::unordered_access_follows_typed_uav(--ignored, needs the host GPU): passes on this card.cargo test -p victory-gpu -p victory-shader --lib: same results asmainhere (141 ok / 2 fail, 244 ok / 3 fail, the known #1744 ones). No new failures.Adds a Blackwell row next to the RTX 4090 run above.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@Marvisak on GitHub · 2026-11-25 08:20 UTC · original · edited 2026-11-25 16:01 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts inREADME.md). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs work) was for an older state ofmain.Generated by Claude Code
@Venom2054 on GitHub · 2026-11-25 19:13 UTC · original
I found an in-game regression from the exact-format UAV check in
93c4e18on an RTX 5070 Ti. This is a local integration based on940d32fwith the GPU change from this PR. Current main at13f91caealready preserves the flag in this case.The game requested a 2560×1440 R8G8B8A8_UNORM_SRGB render target with unordered access and created an R8G8B8A8_UNORM UAV on it. The integration normalized the resource to R8G8B8A8_TYPELESS, tested that exact format and stripped ALLOW_UNORDERED_ACCESS. The active hair pass ended up with a null output. The texture was newly allocated and the requested UAV referred to that same resource.
I compared this rule with kotekompotek's castable-view check from #2442 (
6b96691) using the same executable, starting save, caches, scripted input and ambient setting. One run per rule. I sampled the base-color buffer immediately before and after the hair pass in each run.With #2442 the host resource retained both flags. All 6,809 changed samples over the shirt also switched to material ID 6. The long curly ponytail was visible over the lettering in the final frame. Its lighting is still dark. The camera poses differ slightly between runs, so the counts above compare writes within each single frame. This tests one RGBA8 family case on Windows 11. The separate Device10-less case is already documented on #2442.
@KainanP on GitHub · 2026-11-25 19:36 UTC · original
RTX 4060 Laptop (610.47), merged onto main
13f91cae(README conflict only, tested with main's README): B5G5R5A1 UAV half fixed, B4G4R4A4 target half still removes the device; 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).644aed492eto948b7deb83Pull request closed