RX 7700 XT 12 GB (RDNA3), Windows: device lost in the loading screen every run, page faults inside freed resources #26
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD#26
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?
@zGLados on GitHub · 2026-11-25 12:32 UTC · original
Setup
4cbe9d7(runs 1–3) and71652a2(run 4),cargo build --profile diag -p victory --features diagnostics, own dump of 1.0.2.1VICTORY_PRESENT_TARGET=1x1:1 VICTORY_HAIR=1(+VICTORY_SKIP_PIPELINES=<the 8>on4cbe9d7),--console series-x, Enter pressed every 6 s until 46 s, DRED onWhat happens
Four runs, all end with a device removal while the loading art is still on screen; the world never appears.
staging of … 16x9x1 f10 (type 34)VICTORY_STAGING_BUDGET_MB=4096 VICTORY_CARD_BUFFERS_MB=1024unnamed (type 25),unnamed (type 34)71652a2, its README settings (no skip list)staging of … 1024x1024x1 f71 (type 34)VRAM sampled every 30 s with the
GPU Adapter Memorycounters: dedicated use sits at the card's limit within a minute of loading, and shared use keeps climbing until the fault.Notes
4e17478+ its PR #98 runs 15 min in the prologue without a device loss (~4.6 fps withVICTORY_RELAY=2), so the card and driver can hold a run.Logs available on request.
@adrianmjim on GitHub · 2026-11-25 17:24 UTC · original
Thanks for the detailed runs. These are notes from reading the code at
01aadd1. I could not reproduce anything: there is no game executable on my machine (RX 7900 XT, Windows 11 26300), so everything below comes from the source and unit tests. #95 (RX 7900 XTX) reports the same kind of fault, a page fault inside a freed "staging of ..." plus view and sampler heap offsets past their ends, and #144 is a fix proposed there. Some of what follows overlaps with it.What the DRED names mean on main
Candidates I can see (none confirmed)
What you could try, if you have time
--features diagnostics) withVICTORY_D3D12_DRED=1gives the DRED report. Onmainthe pooled allocations above are unnamed or misnamed; I have a small change that names pool heaps by slot size, pooled textures by size and format and stride tables as "descriptor strides and counts", plus fixes for the two lifetime gaps above. I can open it as a PR on top of #144, which touches the same naming.VICTORY_KEEP_RETIRED=1in a diagnostics build. Nothing that goes through the retire queue is freed (staging buffers and their pool memory, texture copies, slots' resources), so if the fault goes away, it points to a use after free. Two caveats:VICTORY_TEXTURES=keep. Placed textures are then not evicted when the title remaps their memory, which rules out the placed-texture case above. It also uploads each texture once and never refreshes it, so some textures may look wrong, and it keeps more texture memory, so it may run out sooner on 12 GB.None of this is known to fix the device loss. These are things that could produce faults inside freed allocations, and the names should make the next DRED report say which one it is.
@zGLados on GitHub · 2026-11-25 19:26 UTC · original
Thanks @adrianmjim, that helped. Two more runs on the same RX 7700 XT 12 GB, README settings, diag build, DRED on, 12 minutes each:
000ffddstaging of … 128x128x1 f71 (type 34)000ffdd+ #144 merged locallySo #144 stopped the device loss in this one run.
The picture is not right in either run: in the prologue's window scene only the window pane and the outside are drawn; Lucia, the room's walls and the window frame are missing (the same scene renders them on fxceless/victory-fork
ca8829fon this card). I can't tell whether that is the 12 GB card running out of room for the room's resources or something else; happy to run a switch or a branch for it.Small note on #144: against
000ffddit needed..targetin theemit::Target { lanes_min, lanes_max }initializer inapps/victory/src/translate.rsto build (the newview_slots/sampler_slotsfields).@adrianmjim on GitHub · 2026-11-25 19:40 UTC · original
Thanks for the runs. #144 stopping the device loss is worth saying on #144 itself as well, together with the
..targetnote, since its author may not follow this issue.Missing Lucia, walls and window frame: one candidate
On
main, 71 mesh programs of the title'sshaders.rpfare refused when translated on their own: their outputs are over D3D12's 32 KiB limit for a mesh shader (65 to 71 scalars per vertex for 128 vertices, against 64). Their draws are dropped. Most of them are character variants (MS_VS_PedTransform*,*TransformSkin*, theFire/Spatter/Transmissionversions), and a few are plainMS_VS_Transform*. #138 (a port of upstream's #2398) translates each one together with the pixel shader it is drawn with, and leaves out the outputs that pixel shader does not read. Offline, all 1178 signature-compatible (mesh, pixel) pairs I built from those 71 programs validate and create pipelines on an RX 7900 XT with #138 (details on #138). I have not seen it in the game (no game executable here).You can check whether this is what you see without a new build. In the diagnostics build's log, each shader that does not translate gets one line,
shader does not translate; its pipelines' draws are dropped, with the reason. These are the lines to look for:mesh outputs beyond the host's 32 KiB: the case above.title memory refused by the host GPU/a stretch of title memory refused by the host GPU: memory the 12 GB card could not take, which would also leave things undrawn.A branch to try
test/main-144-138on my fork (https://github.com/adrianmjim/VIctory-Belobug-AMD/tree/test/main-144-138,bd95048) is000ffddwith #144 and #138 merged. Getting them to build together took three changes:emit/mod.rs, keeps both sides: #144'sClampGuardand #138'slower_pruned...targetinapps/victory/src/translate.rs.000ffdd. ItsShader::from_translatedpredates thedraws_sky/ends_reflectionsfieldsmainadded since, so the branch copies them from the source shader.It builds here as a release build with
--features diagnostics, andcargo test -p victory-shader --lib -- --test-threads=1passes (271 passed, 0 failed). It is untested in the game. The mesh programs translate differently on this branch, so expect another round of shader translation with a cold cache.If the characters come back and the walls or frame do not, the
shader does not translatelines from that run would be the next thing to look at.@zGLados on GitHub · 2026-11-25 20:46 UTC · original
Ran
test/main-144-138(bd95048) on the RX 7700 XT 12 GB, diag build, README settings, DRED on, 16 minutes:shader does not translatelines are now only 35 compute programs, allan address in an SGPR that is no root parameter is not supported; no mesh or vertex shader. On000ffdd+ #144 it was the same 34 compute programs plus one mesh program (72da0ba1efaec1e0,mesh outputs beyond the host's 32 KiB).title memory refused by the host GPU/a stretch of title memory refusedlines in any run.One more data point that may narrow it down: the draws are there. The layer's own line reads
4603 draws/frame, dropped 334 without a host pipelineon this branch, and4849 draws/frame, dropped 339 without a host pipelineon fxceless/victory-forkca8829fin the same scene on the same card, where the room, Lucia and the frame do render. So it doesn't look like dropped draws or refused memory; more like the room is drawn but ends up invisible (depth, culling or visibility data?). Happy to run a switch or capture something specific if that helps.@adrianmjim on GitHub · 2026-11-25 21:13 UTC · original
Thanks, that rules my mesh guess out for the room, and the draw counts point somewhere else.
What the numbers say (from the code at
000ffdd)draws/framecounts the title's own calls (Draw,DrawIndexed,DispatchMesh,ExecuteIndirect, once each) when they arrive, before the host does anything with them (list.rs,count_draw). So 4603 against 4849 means the title itself issues about 246 fewer calls a frame on this build. The host drops (334 against 339) are about the same, so dropped draws do not explain the difference. The caveat is that the two runs may not have been in exactly the same shot.XboxBvhBuilder.dll:ConstructBVH4,CopyAndCompactBVH, the sorts and prefix sums, ...).translate_forhandles their spilled user-data table and raw addresses only withVICTORY_RAYS=1. With the runtime's owntranslate_forandVICTORY_RAYSunset, all 52 of that DLL's compute programs fail offline with exactlyan address in an SGPR that is no root parameter. With it set, all 52 translate. None of them builds culling, indirect arguments or a depth pyramid for raster draws. fxceless/victory-fork does not run them by default either (VICTORY_BVH_BUILDER). So they are expected, and probably not the room. If you paste the 35hash=values I can match them against the 52.fxceless saw the same thing
Its source describes this scene: the room at the start of the prologue lost its walls in five runs of seven, with the outside cut by one rectangle around the window (the comment on
VICTORY_SCISSOR_TESTin itsdraw.rs). It has aVICTORY_WALLS_TRACEfor the GPU read-backs the title's CPU uses there. Its commits credit two things, both on by default there and missing on ourmain, with the room rendering:VICTORY_HEAP_SYNC: descriptor records the title copies into its shader-visible heaps as plain bytes are mirrored before each submission.VICTORY_VIEW_OWN_COPY: a buffer view that starts off an element of its host copy gets its own copy of the bytes. Ours refuses it, loggingbuffer view not on an element of its host copy, and the shader reads zeros.On our side, title submissions return before the host GPU is done since
a59f3e5(VICTORY_ASYNC_SUBMIT, on by default). That came after #45 fixed the walls on a 9070 XT. fxceless waits for every submission by default.If you have time, one switch per launch, same save and shot
On
test/main-144-138(none of these needs a rebuild):VICTORY_ASYNC_SUBMIT=0VICTORY_PLAN_REUSE=0(undoes000ffdd's bindless plan reuse)VICTORY_HOIST_CLAMPS=0(each indirect clamp right before its draw)VICTORY_DEPTH_TWINS=0For each one: whether the room, Lucia and the frame appear, and the
... draws/frame, dropped ... without a host pipelineline. The question is whether it moves towards 4849.On fxceless
ca8829f, the reverse:VICTORY_HEAP_SYNC=0, thenVICTORY_VIEW_OWN_COPY=0. Does the room disappear there? A run withVICTORY_WALLS_TRACE=1would add itswalls trace:lines.From the logs you already have on our build, these lines would also help, with counts and the first occurrence of each:
dropped X/frame without a host pipeline: <why>line under the frame line;buffer view not on an element of its host copy;no free dynamic descriptor slots;host wave sizesline.A screenshot of the same shot on both builds would also help. Where the walls should be, is it the outside or sky (not drawn), black (drawn but unlit), or cut to a rectangle?
@zGLados on GitHub · 2026-11-26 19:32 UTC · original
Ran the list, one switch per launch, same start (new launch, Enter until 46 s, no input after), RX 7700 XT 12 GB, diag build, 11 minutes each, window scene of the prologue at frames ~4000–8800. "Room" = Lucia, walls and window frame.
On
test/main-144-138(bd95048), README settings:4603 draws/frame, dropped 335 without a host pipeline4475 / dropped 339VICTORY_ASYNC_SUBMIT=04333 / dropped 355VICTORY_PLAN_REUSE=04436 / dropped 343VICTORY_HOIST_CLAMPS=04623 / dropped 340VICTORY_DEPTH_TWINS=04478 / dropped 340So it is intermittent here too (run 1 vs 2), and none of the four switches brings the room back; the draw counts move between 4333 and 4623 without a pattern.
The reverse on fxceless/victory-fork
ca8829f(our 7-switch set:ASYNC_SUBMIT QUEUE2 INDIRECT_WINDOW JOIN_PARTS BACK_OWN_VIEW INDIRECT_GATHER CARD_REHASH_RUNS), withVICTORY_WALLS_TRACE=1:VICTORY_HEAP_SYNC=04614 / dropped 339VICTORY_VIEW_OWN_COPY=0buffer view not on an element of its host copylogged twice4659 / dropped 339Walls trace in the window scene (frame ~3001) on both:
main_pass_draws=1418(run 7) /1446(run 8),rectangles=2, scissors["548 0 1753 1334 x1303", "0 0 2560 1440 x115"]/x1334+x112, cullingtree=2 tree_imposter=2 grass=1 prop=2 prop_nocull=2 simple=1 slod=1 meshlet_args=46 depth_pyram…– i.e. most main-pass draws go through the window-sized scissor there too, and the room still renders.Log lines you asked for (Belobug runs):
buffer view not on an element of its host copy: 0 in all six.no free dynamic descriptor slots: 0.host wave sizes and descriptor heap limits lanes_min=32 lanes_max=64 view_slots=2294784 sampler_slots=2048.dropped X/frame without a host pipeline: <why>: the same set every time – the compute programs that don't translate (largest:3b90165a77d95cdf~84/frame,5062bc7a48e842f8and5279ae36796c31fc~63/frame,caa78b8ca62bc3d6100–550/frame early on),refused [compute 39f0e9aeb156a61c], andindirect kind 1: a rectangle list (not expanded: indexed, …).an address in an SGPR that is no root parameter):14394a322f6dd5c2 162216b9cfd91aaf 190fbf0ebe040169 198f6dfd2b81bcea 28918b7150a7aad5 35e51bb27a463294 3b90165a77d95cdf 3cea4534bbc15632 3df629ffc3d0a2a6 4b5aedc0e96b0770 4ddd6f9702fab2a7 5062bc7a48e842f8 5279ae36796c31fc 5552dac6a2b7a1fd 5c09eb42b7a3c362 5e68767498c57eb6 6f6a359d1166bb27 7bb5b1b91d283a28 894c91654720595f 9205d2655bf8cc88 a197f50cd8481541 a63e2dfc25ba3155 bb55c842c391589f c42a31951201f9a0 c85822de2e41cfaa caa78b8ca62bc3d6 cb9647e77864cb3a e63d22c4def9ba6a e95858837a9aa22d f28a33a89eaa2caa f6e47efa50226beb f6eb6498409ca974 f94e5d8bf4e1cf05 ffd93c8a029ff016What the missing walls look like: not black and not cut to a rectangle – the outside and sky are drawn where the walls should be, i.e. the room's geometry is simply not there in the final image (run 1 shows parts of it).
For comparison, avatarmanz/VIctory-7900XTX
c9c932c(Series S, its play settings + renderer patches) renders this scene completely on the same card, at ~13 fps.@adrianmjim on GitHub · 2026-11-26 19:46 UTC · original
Thanks, that's a clean set, and it rules out what I suggested. Three findings from going through it:
1. The 34 hashes are all ray-tracing builder kernels. I matched every one against the 52 compute programs of
XboxBvhBuilder.dll(blake3 of the container, as logged): 34 of 34 are in that set. Your biggest drops by hash arecaa78b8ca62bc3d6Box16Rehydration,5279ae36796c31fcRefitBVH4,5062bc7a48e842f8ReloadTrianglesand3b90165a77d95cdfResetCounterValues. They are refused becauseVICTORY_RAYSis off, as expected, so they are not the room.2. The avatarmanz comparison mixes two things. "Series S" is
victory run ... --console series-s. That flag exists, with the same code, onbd95048too, and the default on both is Series X (the README line uses--console series-x). It changes:On a 12 GB card that was at 10.4–10.5 GB dedicated plus ~10 GB shared on our build, that alone can matter. Also,
avatarmanz/VIctory-7900XTXdoesn't descend from this repo'smain: it is Marvisak → fxceless (up toa26859f) → its own commits. So it differs in both code and console profile. Itsscripts/play.ps1doesn't pass--console, so how did you set Series S there?3. What fits "geometry simply absent, sometimes partly, one stretched triangle" is a host copy of title memory that stays stale, with the mesh read as zeros or old bytes. Both forks where the room renders describe this room as an intermittent memory-sync problem. On our side, reading
bd95048(itswatch.rsandshadow.rsare the same asmain's), there are two gaps that no open PR closes:title_memory_remappedsees nothing to change, so the region's epoch doesn't move andupdate_freekeeps returning "clean" for that copy.protect()skips an alias of a page while it is pinned (by a DirectStorage or file read, a copy-back, or aSTRETCHwindow) and doesn't come back to it when the pin ends. CPU writes through that alias are then never seen.Neither is shown to happen in the game. There are also two paths only this repo has, which both forks that draw the room lack: the
VICTORY_STRETCHwindows (on by default) and the VRAM card buffers (card.rs).If you have time, on
bd95048, README settings, same start, one switch per launch:title memory in place was mapped anewtitle memory in place through a view of oursa stretch of title memory could not be mapped againa reservation of physical pages shown wholea page mapped again in a reservation shown wholedstorage: request failedVICTORY_ALWAYS_COPY=3, 2 launches. It takes write-guarded memory again every frame, which bypasses both gaps above. If the room comes back, add one launch withVICTORY_ALWAYS_COPY=1(slow; every copy, every frame).VICTORY_STRETCH=0, thenVICTORY_CARD_BUFFERS=0, thenVICTORY_COPY_MEMORY=1(any value turns off in-place use of title memory). UseVICTORY_STRETCH=0rather thanVICTORY_VIEW_GUARD=0, which also turns the stretch windows off and mixes the two.bd95048with--console series-s, 2 launches.For each: room yes/no/partly, the
draws/frame, droppedline, thecopies per frameline, and the dedicated and shared VRAM.If
VICTORY_ALWAYS_COPYbrings the room back, the next step would be a fix for those two gaps. I'd write it as a branch with a unit test, for you to try.@zGLados on GitHub · 2026-11-26 20:33 UTC · original
Thanks for matching the hashes, that settles the compute side.
How I set Series S on avatarmanz: not through its
play.ps1– I start the runs with my own launcher, which sets the same environment as thatplay.ps1(non-safe) plus the fiveVICTORY_PORT_*patches and passes--console series-safterrun <exe> --execute. You're right that this mixes profile and code. One more data point on that: the same avatarmanz build in the Series X profile (withVICTORY_OUTPUT=1920x1080) also draws the whole room (Lucia, walls, frame) on this card, at 12.7 fps; Series X at its native size without the patches fills the 12 GB card (1.9 fps) but the room is there too. So on that code the room doesn't depend on the profile here.From the logs I already have (runs 1–6 on
bd95048), counts per run (1 = room partly there, 2–6 = missing):title memory in place was mapped anewtitle memory in place through a view of oursa stretch of title memory could not be mapped againa reservation of physical pages shown wholea page mapped again in a reservation shown wholedstorage: request failedFirst occurrences (run 2):
title memory in place through a view of ours count=1 start=0x100a5e0000 len=13303808about 60 s in,title memory in place was mapped anew count=1~4 s later,a reservation of physical pages shown whole at=0x2bef0000 len=193986560right at start. Nothing that separates run 1 from the others.One thing before more runs on the old line: the repo's default branch is now
a-publier(cd8dfc0), which is built on avatarmanzc9c932crather than onmain/bd95048. On this card it renders the room completely and runs at 13.2–13.8 fps (Series S, same settings as above, ~12 min, no device removal). So the missing room is something of the oldmainline only. If tracking it down there is still useful to you (e.g. for a fix that goes back intomain), I can do theVICTORY_ALWAYS_COPY=3/VICTORY_STRETCH=0/VICTORY_CARD_BUFFERS=0/VICTORY_COPY_MEMORY=1/--console series-sruns – just say so.@adrianmjim on GitHub · 2026-11-26 20:34 UTC · original
Thanks, that answers the profile question: on avatarmanz's code the room is drawn with Series X too, so on this card it is the code line, not the console profile. And the log counts don't separate run 1 from the others, which is useful in itself.
Given that
a-publier(cd8dfc0) draws the room completely here, at 13–14 fps and without a device removal, I'd hold off on the extra runs on the old line.mainhasn't moved since4f62c2a, and the recent work is going intorx9070xt/a-publier. If the maintainer keepsmainas a line of its own, the one run that would say the most isVICTORY_ALWAYS_COPY=3onbd95048. If that brings the room back, the stale-copy gaps I described are where to look, and I'd write the fix formain. Otherwise, thanks for all the runs. They narrowed it down to the memory path that only the old line has.