RTX 3070 Ti: DXGI_ERROR_DEVICE_HUNG in the world; debug layer reports a title buffer in UAV state used as vertex buffer #548
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#548
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Javicksa on GitHub · 2026-11-24 04:44 UTC · original
Environment: Windows [version], NVIDIA RTX 3070 Ti (driver [version]), 32 GB RAM, commit [git rev-parse --short HEAD], diag build. README says it was tested on AMD only; NVIDIA waves are 32 lanes.
Hang on the real GPU
Boot, menus and world loading work. In the world: 0.8-1.6 fps, ~1,400 of ~5,800 draws/frame dropped (untranslated shaders), then the device is removed (0x887A0006 / 0x887A0004, DXGI_ERROR_DEVICE_HUNG). Slow submissions of 5-6 s. VICTORY_SHADER_LOOP_LIMIT=64 did not avoid it.
Debug layer (VICTORY_D3D12_DEBUG=1), repeated ERROR id=538
DrawIndexedInstanced / IASetVertexBuffers on 'title buffer 0x159f0000+0xae00000' (182,452,224 bytes): state UNORDERED_ACCESS, expected VERTEX_AND_CONSTANT_BUFFER. Six lists in one run. Also with VICTORY_GPU_TIMING=1 (one list per ExecuteCommandLists), so it is not a batching artifact.
Code observation (hypothesis, not verified): these buffers come from Host::shared_buffer (COMMON, ALLOW_UNORDERED_ACCESS). shadow.rs tracks no resource state and I found no explicit buffer barrier in victory-gpu; draw.rs:373 binds shadow.gpu(...) as a vertex buffer without a transition. I could not confirm that fixing this avoids the hang.
DRED
Breadcrumbs stop at op 6 inside a list (command 111 of 429, commands 16..254 between barriers; an earlier run: 143 of 354). With GPU timing, a list took 6364 ms but its six slowest completed commands took <= 0.7 ms each, so some command never completes.
Perf
The 174 MiB buffer is refreshed ~90x/frame (~16 GB/frame); "preparing" is ~60% of frame time.
With VICTORY_D3D12_WARP=1 + DEBUG + GBV + DRED
It did not reach the world (3-12 draws/frame, ~1.2 fps), so item 2 did not reproduce there. Found:
@Len1k on GitHub · 2026-11-24 04:52 UTC · original
The code observation holds, and the gap is narrower than it looks:
ensure_statecannot cover buffers at all today.draw::readable(crates/victory-gpu/src/draw.rs:1074) handles a buffer view throughdescriptor::host::buffer_range: it callsshadow.refreshand, for a UAV,shadow.gpu_writes. The twoensure_statecalls below (View::ShaderandView::Unordered, around lines 1097 and 1114) only match texture views.list::ensure_state(list.rs:391) goes throughHostList::transition(host.rs:905), which resolveshost_copy— aHostTexture. A shadow buffer has none, sotransitionreturnsNoneand no barrier is ever recorded for it.draw.rs:335prepare_for,IASetVertexBuffersat line 373 andIASetIndexBufferafter it; the mesh path binds at line 888) useshadow.gpu(address)directly.host::shared_buffer(host.rs:1759):D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, created inD3D12_RESOURCE_STATE_COMMON(line 1789). D3D12 promotes COMMON to UNORDERED_ACCESS implicitly on the first UAV use, and that promoted state holds for the rest of the command list. So a compute pass that skins into the 174 MiB heap leaves the buffer in UAV; the mesh draw that reads the same heap as vertex data in that list is exactly the debug-layer 538 you see. The promoted state is not a per-list artifact either — the same mismatch on a driver that does not report it is a candidate for the hang, though that part is unproven.readablewrites no barrier betweengpu_writesand the vertex bind. (indirect.rshas auav_barrier()helper already.)Shape of a fix, for what it is worth:
HostLista buffer-state record keyed by theID3D12Resourcepointer ofShadow::buffer, mirroring the texture record that keys on the copy pointer (host.rs:905).readable's UAV arm for shadow buffers, and record (at least) VERTEX_AND_CONSTANT_BUFFER / INDEX_BUFFER / GENERIC_READ at the bind sites.host::transitionathost.rs:1874already builds the barrier struct).prelude()(host.rs:929) the way textures do; otherwise the per-list record is enough.I can write that as a PR with
cargo test -p victory-gpu(no title here — RDNA1, no mesh shaders), but I did not want to touch the state path without a word from you first. Whether it also stops theDEVICE_HUNGis a separate question from whether the debug-layer error is real; this report is the only place I have seen the mismatch named.AI-assisted.
@wwwwwwww3333333 on GitHub · 2026-11-24 05:07 UTC · original
@Len1k before you start on that: #334 (realhenners, open, clean against
d2a4bae) already implements the shape you describe. It adds a per-listBufferStatesrecord for host copies (GENERIC_READfor vertex/index/constant/SRV/indirect reads,UNORDERED_ACCESSfor shader writes) with transitions where the use changes. The prelude moves each buffer fromCOMMONto its first state andclosemoves it back. It also replacesindirect.rs's fixedUAV ↔ INDIRECT_ARGUMENTbarriers, which onmainleave the shared heap explicitly inUNORDERED_ACCESSafter every indirect draw.I ran #334 (
af2aecf) on Windows 11 / Rust 1.98.1 MSVC / RX 6750 XT (RDNA2).cargo test -p victory-gpupasses (45 passed, 1 ignored). That includesdebug_layer_accepts_buffers_written_then_read_as_vertices, which ran with the D3D12 debug layer (not skipped) and reported no errors. Clippy-D warningsis clean apart from the pre-existinghost.rs:267lint that #355 fixes.So this report looks like #199/#264 on another NVIDIA card. Testing #334 on the RTX 3070 Ti would show whether id 538 and the hang go away. Not runtime-tested with game files.
AI-assisted (Claude did the source analysis; I ran the tests above on my machine).
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 05:14 UTC · original
PR #588 addresses this exact issue:
eadable, buffers accessed via UAV transition to \UNORDERED_ACCESS.
@Len1k on GitHub · 2026-11-24 05:18 UTC · original
Good catch, and it settles it: #334 already implements the shape I sketched, so my four-step plan is redundant — I would rather not duplicate realhenners' work.
For the record on the two differences, in case they matter for the RTX 3070 Ti test: my sketch wanted the state record keyed by the
ID3D12Resourcepointer ofShadow::buffer, and the UAV barrier betweenshadow.gpu_writesand the vertex bind. If #334'sBufferStatesmoves every buffer fromCOMMONto its first state in the prelude and returns it inclose, the promotion question I raised in the original comment is answered, since nothing is left promoted across a list boundary.One thing worth keeping from it:
indirect.rs's fixedUAV ↔ INDIRECT_ARGUMENTbarriers leaving the shared heap inUNORDERED_ACCESSafter every indirect draw is the same class of defect, and #334 replacing those is the more important half on this card — a buffer left in UAV is exactly what a following vertex bind in that list trips over.#588 proposes a second implementation of the same thing (
Shadow::ensure_statewith anAtomicU32). Whichever lands, thedebug_layer_accepts_buffers_written_then_read_as_verticestest #334 adds is the part worth keeping — the shape is otherwise unverifiable without the title.AI-assisted.
@colehammond65 on GitHub · 2026-11-24 06:58 UTC · original
PR #334 tested on RTX 4080. The new buffer-state unit test passed. The debug-layer child test skipped because this Windows build has no usable debug layer, so error 538 could not be checked directly. Both baseline and #334 runs still ended in device removal, with DRED stopping in indirect execution or mesh dispatch and no page fault. Full report: #334
AI-assisted test report.
@Marvisak on GitHub · 2026-11-25 01:48 UTC · original
Automated triage for the maintainers.
The debug-layer error (id 538:
title buffer ...+0xae00000inUNORDERED_ACCESSatIASetVertexBuffers) is the failure first reported in #199, which is where its cause is tracked. Your code observation still holds on currentmain(940d32f):COMMONbyHost::shared_buffer(crates/victory-gpu/src/host.rs) and get no transitions;State::prepare_for(crates/victory-gpu/src/draw.rs) bindsshadow.gpu(...)as a vertex buffer without a barrier;indirect::done(crates/victory-gpu/src/indirect.rs) explicitly moves the argument buffer back toUNORDERED_ACCESSafter each indirect execution.The open PR for this is #334 (needs a rebase). #588 was closed. An RTX 4080 run of #334 still lost the device, so whether this mismatch causes the hang is not settled.
The environment line in the report still has its placeholders. To compare it with the other NVIDIA runs, please fill in:
git rev-parse --short HEAD).If you can, also do a run of current
main(or of #334) withVICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, and post the completehost GPU device removed ...line.The WARP-only access violation at
+0x23cf683(write 0x0) is discussed in #1118.Generated by Claude Code