d3d12: on an 8 GB card the story scene after the first placements never starts in 5 of 9 runs (flat grey picture, texture queue stops), with and without DLSS #3434
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Reference
No Branch/Tag specified
Notifications
4 participants
Due date
No due date set.
Reference
leonida/mandy#3434
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?
What happens
On an 8 GB card, at the story transition into the second protagonist's prologue (about 6 minutes into the world from the one save all these runs start from, reached standing still), the scene never starts in about half the runs: the picture stays a flat grey while frames keep coming, the player's position stops changing, and the texture queue stays at about 17,000 "waiting for their memory" to the end of the run. It happens with and without DLSS: 5 of the 9 runs that got past the transition.
Commit
main4d9e4d05d. Some runs are that commit plus one open PR: #3400 + #3385 (one run, the scene ran), or #3198 with its variable at 0, where it does nothing (READ IN CODE: itsresidency.rsreturns before any call), so those three runs aremain's behaviour; they all stuck. On plainmainalone it is 2 stuck of 5. No local patches.System
NVIDIA GeForce RTX 3070 8 GB desktop (video memory budget about 7.2 GB), driver 621.47, Windows 11 Pro 26200, Ryzen 7 5700X, 16 GB RAM, fixed 24 GB page file. Profile M. Runtime:
d3d12(leonida.exe),diagnostics,dlss,mimallocbuilds.Where
runtime
Command and steps
scripts/game-gate.ps1 runfrom one save each time, Series S,-NoFrameGen,mods/gate_driveridle (LEONIDA_GAME_ACTIONS=1: it passes the menus, takes control and then stands still), memory stops widened. Two recipes:-Dlss quality(the launcher's pick for this PC), and d3d12/docs/windows-memory.md's 8 GB profile (-Resolution 540 -NoSmoothMotion,LEONIDA_FPS_CAP=30). From this save the title moves the player through a few placements in the first 6 minutes and then into the prologue scene, standing or not.Seen by the tester on the first such run: from that transition to the end the picture was a flat dark grey while frames kept coming at 21-24 fps. The other runs were not watched; they are classed by the signature below, which that watched run has.
Output
No log lines or game content here, per the rules; these are counts from each run's log, per minute after control.
The signature (READ IN the runs' logs,
GATE MARKpositions and the runtime's per-frame lines):The runs (MEASURED, n=9; every run that evening that reached 8 minutes after control):
mainmain+ #3400 + #3385main-Resolution 540main-Resolution 540main,LEONIDA_D3D12_BACKGROUND=0main,LEONIDA_D3D12_BACKGROUND=0main+ #3198 at 0-Resolution 540main+ #3198 at 0-Resolution 540main+ #3198 at 0-Resolution 540(The run that lost the device at 8.4 min is left out of the minute-10 rows above.)
The first run was also reported as a PICTURE line on #2464.
AI-assisted: Claude Code (Claude Opus 5.5) ran and read the runs; the counts were recomputed from the logs by a separate read-only agent before posting.
Thanks, this is a very useful report: the stuck texture queue on 8 GB at that story transition matches what #3400 (VRAM margin on small cards) and #3031 (shared command allocators, about 2 GB less private memory) aim at. Both are queued for an in-game A/B on an 8 GB laptop RTX 4070. If you can, a run of
main+ #3031 on the same save would tell a lot.🤖 Generated with Claude Code
Thanks. Taken on #3031 (comment 25476): an A/B of
main+ #3031 on this save,LEONIDA_ALLOCATOR_RING=0against the PR's default, three runs a side, each 600 s so it passes the transition. Result there by about 11:00 UTC. AI-assisted: Claude Code (Claude Opus 5.5).Result of the run you asked for is on #3031 (comment 25604): with
main+ #3031 on this save, the pooled allocators lowered the private peak by about 1 GB here, but the scene stayed stuck in all six runs, with and without them (three each). So on this 8 GB / 16 GB PC this issue is not unstuck by that much less private memory. One more thing for whoever tests this on other PCs: here the device loss depends on the folder the executable runs from (#2821, comment 25546); these runs were made from the folder where it holds. AI-assisted: Claude Code (Claude Opus 5.5).Addendum to my report above, from the code, on what the stuck counter means | AI-assisted: Claude Code (Claude Opus 5.5)
My ASSUMED line read the flat "textures picked by index … waiting for their memory" (about 17,000) as textures that never become resident on the card. The code says otherwise: that count is not video memory.
waiting_kind()(d3d12/crates/leonida-gpu/src/descriptor/host.rs, near line 1890) puts a queued slot in "waiting for its memory" when it has been looked at and nothing of it was uploaded; the texture pass (draw.rs, near line 4487) finds that bytexture::mapped_bytes()returning 0 for the texture's placed memory, i.e. the title's own pages for that texture are not mapped (streamed out, or not streamed in yet). Such a slot holds no copy on the card.draw.rsnear line 4540), and the code's own note says a heap normally keeps some 25,000 slots waiting for their memory (descriptor/host.rs, near line 1609). So 17,000 is not high in itself; what marks the stuck runs is that the count stops changing, together with the player's position.What it does not say: why the title's streaming stops there in some runs and not others. Next on my side: whether the DirectStorage requests for that scene are issued and completed in the stuck runs (the runtime logs its DirectStorage work), compared with a run where the scene starts.
A read-only code audit of this issue (no game run) found that the “~17,000 waiting for their memory” is not one population, and that the queue has no retry deadlock. Before a cause is assigned, the counter must be pinned down.
1. Two different numbers share the words.
textures picked by index … waitingprintsHEAP_TEXTURES_WAITING=census[0], the whole queue (draw.rs:4280,host.rs:13905).{away} waiting for their memoryprintscensus[2]=mapped == 0 && looks > 0(host.rs:13787,descriptor/host.rs:1889-1897).Which of the two is ~17,000 changes everything below.
2. Class 1 is a mixed set. The doc says “looked at, never uploaded”, but
rechecksetslooks = 1, mapped = 0after a whole upload (descriptor/host.rs:1839-1848), andholddoes not resetlooks(1795-1803). So class 1 = never-uploaded + uploaded-waiting-for-a-re-look + held-while-looked. A flat class 1 is therefore not a liveness signal on its own.3. The queue cannot deadlock on a retry. A looked-at slot is re-armed by
lateron the frame alone, at most everymostframes (clamped 16..1024, ~20 s at 21–24 fps), with no mapping event required (descriptor/host.rs:1774-1783,draw.rs:4294-4308). The “retry needs an event the title never sends” hypothesis is false.4.
room == falsedoes not freeze class 1. Themapped == 0look happens before the no-room branch (draw.rs:4482-4493vs4532-4552); room false stops new host copies, held slots and levels waiting for tiles — not the re-look.So the flat queue is more likely an effect: the title’s pages stay unmapped (title-side stall), or
heap_texturesis not running at all and the census is stale. The code has no direct wait edge from the title to a queue slot; the only circular shape is indirect VRAM/commit competition, which is unproven.Probe to add (diagnostics only, no hot path): a 5 s line with
HEAP_TEXTURE_PASSES(once per real pass),HEAP_TEXTURES_ARRIVED(due slot found withmapped > 0after class 1), a split of class 1 (never uploaded / recheck / held), and the already-defined but never-printedHEAP_TEXTURES_FULLandHEAP_TEXTURES_REUPLOADED_FULL, plus lastroom,used/budget,KINDS[1],tiles::given_total()andpool::texture_room().Outcomes it separates: passes growing with
awaygrowing and uploads flat → title not mapping; everything flat → pass not running;roomfalse with held/recheck growing → VRAM circular wait; uploads and arrived growing while class 1 is flat → recheck churn.Three device-free tests are possible in the existing
TextureQueuetests: a slot looked at without memory is due again without a mapping event; an uploaded slot waiting for a re-look counts as class 1; a held slot that was looked at before stays class 1. No fix is proposed until the probe says which population it is.Baseline healthy-run reading from #3457 (
871a5a9a6d, NVIDIA RTX 5070 12 GB, Windows 11,-SeriesS, 315 s automated run, 0 errors):In a healthy run the
~16,700"waiting for their memory"figure splits almost entirely intorecheck(99.1%), not unmapped never-uploaded textures:315 s):16682 waiting for their memory=never_uploaded=151+recheck=16531,held_for_room=0,passes=11441,first_arrivals=0,full=0,reuploaded_full=0,room=true(used_mb=8136/budget_mb=11176).This confirms @KelboLive's read-only audit on real hardware — on an 8 GB stuck run, the
#3457line will immediately separate whetherpassesstops advancing,never_uploadedgrows, orheld_for_room/fullclimbs underroom=false.AI-assisted: yes