NVIDIA world hang: mesh shaders read through root SRVs megabytes past the end of their title-memory copy (DMA page fault, Aftermath); fix on a fork #951
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?
Imported from Marvisak/VIctory. Originally posted by gangg111 on 2026-11-24T14:26:35Z.
Setup
d2a4bae, plus #459, #483 and local work; diagnostics build (--profile diag --features diagnostics)How it was measured
Nsight Aftermath (Nsight Graphics 2026.4) in global mode with GPU crash dumps only, shader error reporting off. With shader error reporting on, the driver stops the title on accesses that are otherwise harmless, and every run blamed a different compute shader; those reports were not the hang. The dumps were decoded with the Aftermath SDK, the faulting PC mapped to DXIL via
VICTORY_DXIL_DUMPandGFSDK_Aftermath_GetShaderHash.Finding 1: the world's device removal is a page fault behind a root SRV
Every real hang in the world (7 dumps) is
Device state: Error_DMA_PageFault, a read of a GPU address that does not translate, in a mesh shader (857b2e13c9cc107f,c962201cddbdd7dd,f0c7efd2aceb2aaa,c2b963cd8c154f0a,37f363f0a5dcd806,7f7b42a21c8e68e3,db4835a364449a45). The faulting instruction is aRawBufferLoadfromt3, space1, the title's root SRV.A root SRV is a bare GPU address without bounds.
draw.rs::root_viewgives it an address inside the copy (shadow) of the title buffer or loose window it points into, and the shader fetches vertices megabytes past that point, past the end of the copy. On the console that is more title memory; on the host it is the next allocation. Logging every root SRV's host range (VICTORY_ROOT_LOG) against the fault address:0x71fffc900had 14,080 bytes left in its 4 MiB loose window; the fault was 3 MB past the window's end, inside a freed BC7 2048x2048 texture placed right after it (Aftermath resource tracking);This matches #59 (
c2b963cd8c154f0ais the mesh shader in the RX 9070 XT fault there) and probably part of #898.Fix (on a fork)
Two commits on
gangg111/VIctorybranchgpu-189:[address, address + 32 MB): a title buffer around it if there is one, else a window of title memory on a power-of-two grid (each byte in at most two windows).Results on the RTX 3080:
The seventh run ended in a TDR: a single 6.4 s list of compute work, no page fault, no Aftermath dump. That looks like the #898 family, not this one.
Finding 2 (preliminary): the world stays black because most indirect mesh records run empty
With the hang gone the world still presents black. Render target dumps (
VICTORY_DUMP_TARGETS) at frames 1900 and 2000 show the geometry (a per-pixel class buffer written by compute has the opening cutscene's characters, scaffolding, a crane), but the RGBA8 G-buffer targets are all zero, although about 944 indirect mesh executions and 50 direct mesh dispatches target them and run. In a PIX capture of a world frame, 4,366ExecuteIndirectcalls expand to only 202 executed commands, with zero pixel shader invocations attributed to them. None of these executions use a count buffer.Raising the argument clamp's per-list budget in
indirect.rs(BUDGET2^27 to 2^31,VICTORY_INDIRECT_BUDGET_LOG2=31, a local knob) made the G-buffer targets at frame 1950 hold the world (power line pylons with wires, the water surface, the sky in the normal target). The final image is still black, so lighting or later passes lose it too. A same-frame A/B against the default budget is running; I will add it here. If it holds, records with garbage arguments (from passes that do not translate) use up the budget early in a list, and every later record runs empty. Note that #898 lowered the budget without curing its hang, which is a different symptom.Also found earlier: NVIDIA reads a raw view of a structured SRV only up to
NumElements * 4bytesByteAddressBuffer.Loadthrough a structured SRV returns zero pastNumElements * 4bytes on NVIDIA (WARP reads the whole buffer). A shader that the translator lowers to raw loads on a structured table slot therefore reads zeros on NVIDIA, which made the world's cascade loops run to the loop limit. Fixed on the same branch in gangg111/VIctory@0a4b89f (raw views for table slots a shader reads only raw). Related: #704, #709.AI-assisted (Claude).
Imported from Marvisak/VIctory. Originally posted by gangg111 on 2026-11-24T14:32:21Z.
Correction to Finding 2: the same-frame A/B does not support the budget explanation.
With the default budget (2^27), frame 1895 of the world has the G-buffer drawn: two RGBA8 targets hold the scene's geometry (normals of walls and ground, mean 20 and 61 of 255) and the depth-like target holds the same shapes. The all-zero G-buffer at frames 1900 and 2000 of earlier runs came from what was on screen at that moment (the opening cutscene), not from the clamp's budget, and the "raised budget" run that showed pylons and water simply landed on a gameplay frame. Please disregard that part.
What stands: in all variants the presented image stays black while the G-buffer has geometry, so the picture is lost in lighting or a later pass. The root SRV fix (Finding 1) and its measurements are unaffected.
Imported from Marvisak/VIctory. Originally posted by jamesn-xt on 2026-11-24T16:59:14Z.
Independent RTX 4080 reproduction and a synthetic regression test for the raw-table-view change described here.
Windows 11 x64 build 26200, Ryzen 5 5600, 32 GiB RAM, RTX 4080 / NVIDIA 617.42, Rust 1.98.1.
I backported gangg111's
0a4b89fonto the tested integration from #1096/#492, preserving the original authorship. API adaptations retain current heap-initialization safety and table-allocation failure handling, use #206's current raw-window argument order, and update current HostShader test initializers/cache metadata.Source: https://github.com/jamesn-xt/VIctory/tree/test/rtx4080-raw-table-views
5640d9819fb9d56a3006fd0d8f4790eacc51db1a(original author retained).682eed07349a9e642d6031c0ee3db0e6bb78db50.The new case reuses #206's synthetic read/write fixture, but starts the SRV on a 32-byte element boundary so the misalignment fallback cannot fix it. Four 32-byte records are read through a ByteAddressBuffer; all 128 bytes must match the generated numbered dwords, and existing write/canary checks remain.
VICTORY_RAW_SRV=0: the targeted test fails, returning the first 8 expected dwords and zeros for the remaining 24. This is the measured result, not a claim about the exact general hardware bound.No title run with this backport yet, so it is not established as a fix for our 32-list device hang or black 3D output. The previous integrated runtime still produced a black 3D-stage frame and device removal as reported in #1096. No retail logs, game captures or title-derived fixtures are attached.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:57:23Z.
Automated triage for the maintainers.
Thanks for the Aftermath work (RTX 3080, driver 621.01, Windows 11 26300,
d2a4baeplus patches), and to @taovuokko for the run on currentmain.Raw reads through structured views: confirmed on
main(940d32f).buffer_srvincrates/victory-gpu/src/descriptor/host.rsmirrors the title's structured view as a structured host view with its stride. When the translated program reads that slot with raw loads, NVIDIA returns zeros past the firstNumElements * 4bytes, as measured here. The RTX 2080 Ti run ties the world's slowest compute program (8.7-13 s per dispatch) to this and shows that cost disappearing once such views are raw. #1762, which made that change, was closed without being merged. Open PR #2178 ("back structured buffer views with raw descriptors") appears to carry the same change. Review belongs there, including the 16-byte start alignment noted above.Root SRV page fault: since
d71c388,root_viewincrates/victory-gpu/src/draw.rsbinds a raw view over the whole host copy, so a read past the copy returns zero instead of faulting. Nobody has rerun Aftermath on currentmainyet. A run showing whetherError_DMA_PageFaultin these mesh programs is gone would settle that part. Thegpu-189branch isn't in a pull request, and pull requests are open to everyone. The NVIDIA world hang is tracked in #71.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by taovuokko on 2026-11-25T09:36:33Z.
Title run on current
mainfor the structured/raw part ("NVIDIA reads a raw view of a structured SRV only up to NumElements * 4 bytes"): on an RTX 2080 Ti it is the cause of the world's slowest compute program, and converting the views removes itAnswering the triage's request for a run of current
main, for the last section of this issue (not the root SRV page fault, which I did not measure: no Aftermath here).Setup: RTX 2080 Ti (Turing, 32-lane waves), i9-9900KS, 32 GB, Windows 11, driver 32.0.16.1088.
main940d32f+ #1763 (needed on NVIDIA to get past boot, #1753/#1754), diagnostics build,VICTORY_GPU_TIMING=1, default loop limit (2^20). The title's view heap budget is lowered locally so the heap fits the 1,000,000 cap (#1760) and the title's own hang-watchdog crash is disabled, so runs reach the world. My run script's memory guard stops runs after about 165 s in the world. No game data attached.What the slow program does. The slowest command in the world on this card is compute
00167d58cc5a78d7(dispatch 16x16x16, 262,144 lanes): 8.7-13 s per dispatch, about 90 % of the GPU time of a world frame (5.3-9 s per frame). Its loop bounds come from a dword that a raw (ByteAddressBuffer) handle reads at byte 284 of a heap slot that the title made as a structured view of stride 680;mainmirrors that view as structured. On NVIDIA that read returns the wrong value, so the loops run to the 2^20 cap. (Counts only from the translated program.)Converting the views, measured in game:
main+ #176319c8013(structured views made raw on the host, the same idea as0a4b89fabove, with 16-byte alignment handling; 1 run)Frame rate in the world goes from 0.2-0.3 to 0.65-0.94 fps and is CPU-bound after it. This is the title run that the RTX 4080 backport comment above did not have yet.
Two notes for whoever takes this up:
main. The same change is still needed; the measurements above say it matters on Turing too.DXGI_ERROR_INVALID_CALLat about frame 1,100, before the world. Not traced, but it fits the 16-byte start rule that #1762 handled.Not covered:
Measured on my own machine; analysis AI-assisted (Claude Code). No game data, captures or addresses are attached.
Imported from Marvisak/VIctory. Originally posted by oeirughrepuiohg on 2026-11-27T17:26:02Z.
A related short-copy case on Linux/NVIDIA, on the path where the root SRV is bound through a bounded descriptor: the view ends at the 4 MiB window boundary, reads past it do not fault, and a character's face loses its texture coordinates. Different path from the fault reported here and no common fix tested yet, but the same starting point: a root SRV with little left of its loose window.
Setup
833a282b(main lineage plus fxceless/victory-fork#1002), diagnostics builds: a logging build for the capture comparison, and833a282b+ thin LTO + the fix commit for timingWhat happens
On this base the title's
t3, space1root SRV for mesh shaders is bound as a one-descriptor table holding a rawR32_TYPELESSview. The title gives only an address, so the view's length is whatever is left of the copy that the unsized lookup (shadow::find(address, 1)) selects. When no registered title buffer covers the address, that copy is a loose window ending at the next 4 MiB boundary. A buffer that starts near the end of a cell gets a view shorter than the data the shader reads.For the waitress's face (mesh shader
f841ad74ec6e7367, pixel shader6695d7f5e3f6d351, root slot 3), three launches without a fix:A sized table SRV at the same title address (a compute pass uses one, 934,368 bytes) is not affected: it carries its own length.
Narrow fix we run
For that one root slot we reuse the copy behind the largest explicitly sized SRV at the same title address, only while it is the live canonical sized shadow, aligned, shared-memory, at most 1 MiB, with the extension bytes committed and no pending writes on either shadow; otherwise the stock view is used (+202/-7 lines).
We can put the patch on a branch if it is useful.
It is not only this shader
In launch 1, counting root views shorter than a known sized view at the same base:
685b26d33,040 of 3,153 binds,5bd95fde1,815 of 23,636,a97a5ee6548 of 559,d4111a6e69 of 311,02df3d738 of 9,927. This is a proxy; we did not measure executed out-of-view reads for these. From the source, sizeless root CBVs end at the cell boundary the same way; we have no measured incidence for them.Applying our reuse rule to every shader removed about 96% of those short views (613 / 1,009 / 791 left per launch) and its 0.1% lows were worse (4.75 fps average against 5.18), so we did not adopt it. The wider-window approach in gangg111's
a3a8fe7/94908df(a 32 MB window, then sparse backing) is untested here. From reading it, it works on the direct root-address path, while this base binds root SRVs through bounded tables, and its multi-GiB window backing does not fit a 12 GB card that is already at its cap, so we have not ported it. A general fix for the bounded path is still open.Measured and written with AI assistance (Claude Code with Claude Opus 5.5 and Claude Mythos 5.2; Codex with gpt-6.2-sol for the fix and the capture analysis).