ProjectScarlett at 3840x2160: native copies of guest textures reach 9.2 GB by the loading screen, and a 12 GB card runs out of memory #292
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 brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T02:04:54Z.
What happens
With #258 (
d50a51c) the RX 6700 XT runs ProjectScarlett without the #191 preload and gets through the page-remap batch, but every run then ends on the story loading screen: VRAM fills, GTT climbs, and the kernel refuses a submit (radv/amdgpu: Not enough memory for command submission, device lost) or the title's watchdog fires on stalled label waits. The run reports are on #258. @DrArroway measured about 28.5 GiB of VRAM + GTT on a 16 GB / 64 GB machine once the world streams, against about 27.5 GiB available on a 12 GB / 32 GB one.The console has 16 GB in total, so most of that is how the provider holds data, not what the title needs. This issue is a breakdown of where it goes, from one run.
Setup
RX 6700 XT (
1002:73df, 12 GB), 32 GB RAM, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14, ProjectScarlett 1.0.2.1 offline, 3840x2160, shaders prepared, noLD_PRELOAD. Build: #258 atd50a51cplus one local diagnostic commit that counts the provider's live native objects by category and logs them every 5 s (TUXBOX_TRACE_GPU_MEMORY=1). The counters go down when the native object is released. Sizes are approximate (GetResourceAllocationInfofor textures). The commit is on my fork aslocal/mem-accounting; it is a measuring aid, not something I am proposing to merge as it is.Result
Native device memory the provider holds, MiB (live objects in parentheses). The page-remap batch is at about 90 s.
Driver counters for the game process at the last sample (
/proc/<pid>/fdinfo):amd-requested-vram13,425 MiB,amd-requested-gtt7,626 MiB,drm-memory-vram9,809 MiB,drm-memory-gtt11,241 MiB. Card totals: VRAM 12,271 of 12,272 MiB used, GTT 11,335 of 15,913 MiB. This run ended with the label-wait stall and the watchdog at 269 s; the two before it ond50a51cended the same way or with the submit refused when GTT reached its total.So:
Where the copies come from (reading the code, not measured further)
runtime/d3d12/src/device/placement.rs: a CPU-visible texture placed at a guest address gets a committed native image on a DEFAULT heap, andContents::previouskeeps an exact per-mip copy of what was uploaded so later writes to the guest pages can be detected.runtime/d3d12/src/device/heap.rs(RenderHeaps::acquire): images placed at guest addresses get device heaps while the guest range stays committed.Buffers are imported in place now (#218, #253, #258). Textures are not, and on Vulkan they probably cannot be in general (console tiling and layouts differ from what a host image can alias), so I am not suggesting that. Cheaper things might be possible: dropping the CPU snapshot where a write-watch or a hash would do, releasing native images the title has stopped referencing, or creating the native image on first use rather than at placement.
What I am asking
Whether someone who knows the placement code sees which of these is realistic. I can run any candidate on this card, where the limit is hit two minutes after the picker, and report the same table.
Not established
amd-requested-gttat the end that the provider-side counters do not explain; vkd3d-proton's own allocations are not counted.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-27T02:09:07Z.
Yeah, this seems to be one of the last blockers to getting in the game.
I can look into a solution and I emplore others to do so as well.
Realistically, the way we have to handle this is to keep certain resources out of RAM + VRAM and only load when ready to display.
I'll try and dig and see what I can find.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T02:20:23Z.
Some numbers from the NVIDIA side that may help separate the two endings. They come from an RTX 5090 (32 GB), 3840x2160 output, with a local probe build on
e76ff6a+ #235:We get the same stall with plenty of memory free. The story intro runs at one frame per 12–18 s, and the label waits are force-released after 5 s, which is the #215 picture. So the watchdog endings on your card are probably #215 itself, with running out of memory making it worse rather than causing it.
Publication is what makes it big. Any batch with a whole-heap descriptor range counts every UAV-viewed placed texture as written. Over 354 s of the world phase that gave:
Each job allocates a readback buffer of that size, which may be what your staging figure is catching. The per-mip CPU snapshots in your table are the copies each submit compares against: 250 GiB read and compared in that phase.
Narrowing the write set to the textures a pipeline can actually store to would cut the readback allocations and the per-job traffic. It wouldn't reduce the number of native images or the size of the snapshots held. I'm working on that narrowing, building on the findings in #215.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T02:25:05Z.
Follow-up with the question I left open: are the native texture copies in use? On this card, almost none of them are, and almost none have ever had anything uploaded into them.
I extended the local trace (same branch on my fork, now two commits) to stamp each native copy of a guest texture when a submission uses it, when a view is created over it, and when the provider uploads guest bytes into it. One no-preload run of #258
d50a51cplus the trace, RX 6700 XT, 3840x2160; this one ended withNot enough memory for command submissionat 186 s.What I read from it:
never_titledin the trace: 23,357 of the 25,756 come from address-only SRVs), long before anything draws with it, if anything ever does. Creating the native image at the first upload instead would have kept about 7.6 GB of VRAM free here. That is the "load when ready to display" direction, and this says how much it is worth on this path.released=0), so the provider is not parking anything itself; the title, or a descriptor slot, still names them. Nothing evicts a copy today.So on a 12 GB card the two things worth doing look like: do not allocate the native image until the first upload (about 7.6 GB here), and bound the publication readback (about 10 GB at the peak here). Both would have to hold before this card can get past the loading screen.
Limits: one run. "Used" is counted per submission and over-counts when a whole descriptor heap is bound, so the never-used numbers are lower bounds; the never-uploaded column does not have that problem. Descriptor copies and
Mapare not counted as uses.I can run either change on this card when there is a branch, with the same table.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T02:32:05Z.
I'm trying a prototype of the first of those (allocating the native image at first upload instead of at placement or view creation) on this card. I'll post what it does to the table either way; say so if you already have this in hand and I'll test yours instead.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-27T07:07:54Z.
Status on the first-upload prototype: my test machine is unreachable until about Saturday midday, so I can't run or push anything until then. The work in progress is local to that box. If anyone wants to take this direction in the meantime, go ahead, and I'll test your branch on the RX 6700 XT when I'm back instead of finishing mine. Otherwise I'll pick it up Saturday and post the table.
Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-27T20:54:47Z.
A run report from a Radeon RX6600 with 8 GB of VRAM, which hits the memory limit described here sooner than the 12 GB card. The runs end on the #215 watchdog, not on a refused submit.
Summary
On an all-AMD machine, ProjectScarlett gets through the profile picker and into
fbk_stry000_FBK_STRY000_INTRO(Prestream). Every run then ends the same way: the title's 30 s main-thread watchdog fires atgame_scarlett_master.exe+0x23CF683and the game exits with code 5. The crash report tags itGPU Loc Sig=921cc4ae, the watchdog described in #215. #215 is closed, but on this card the stall it describes is still there onmainat7953f0a, which includes #277 and #290.The host profile shows the memory copy path active on RADV (
section-import=substituted), which PROJECTSCARLETT.md asks for reports on. With it, the game gets as far as the story intro.During the intro the 8 GB of VRAM fill and a large part spills into system memory. See "Memory" below for what I measured and what I only saw in a system monitor.
Setup
1002:73ff, RDNA2, 8 GB)mainat7953f0a, D3D12 provider sha25633d10b472dc1e5aecc6c3cecce7d9438c78f29e2ae5690a0ace45b4b1df7863a(staged matches local build)adapter=1002:73ff wave=32-64 section-import=substituted descriptor-bytes=64/16930.048.020-vb_sub_story, offline throughtuxbox.py rungame_scarlett_master.exesha256e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993dxcompiler.dll/dxil.dll1.9.2609.5 staged; Linux DXC is Archdirectx-shader-compiler-gitr5623.b43c5651dAnaconda)tuxbox.py run --prepare-onlybefore the runsMESA_SHADER_CACHE_MAX_SIZE=8Gin both runs; run 1 alsoTUXBOX_PIPELINE_DEADLINE=0Runs
Both runs on 2026-11-27 used the build above, with a warm shader cache.
0(wait)+0x23CF683, exit code 5+0x23CF683, exit code 5Three runs on 2026-11-26, on builds before #290, ended the same way at the same address and in the same SRL state.
The backtrace is the same in every run:
In both crash reports the title's own memory state is the same:
Game Physical2,167 of 2,305 MB,Unused0 of 590 MB,TileHeapabout 3.4 of 6.2 GB.Streaming Requestsis 89 in run 1 and 264 in run 2.Presentation rate from the provider's
presented N frames in 10slines in run 1:The GPU is idle for most of that time. The log has 144 (run 1) and 120 (run 2)
err:winevulkan:signaller_worker wait timed out with non-empty poll listlines, most of them in the intro.Memory
What I saw in a system monitor during the intro, not measured per process:
I have no
/proc/<pid>/fdinfonumbers from during a run yet. I can take them in the next run, in the same form as the tables above.My guess, which I have not tested: on 8 GB the texture-copy and publication volume from this issue and #215 meets the VRAM limit earlier than on the 12 GB cards. The spill to GTT then makes each publication slower, which makes the intro frames slower, and the watchdog fires. The crash itself is still the watchdog, not an allocation failure. I found no
Not enough memory for command submissionand no device loss in either log.Shaders
The two runs wrote byte-identical pipeline-failure files, although run 1 waited for every compile (
TUXBOX_PIPELINE_DEADLINE=0) and run 2 used the 20 s deadline. So none of the stand-ins below come from the deadline.tools/rank_pipeline_failures.pyon either run: 412 pipelines not delivered: 234 stand-ins, 870x80070057, 830x80004001, 80x80004005. By creation path: 177 stand-ins on slot 62, and 57 stand-ins plus all 178 HRESULT failures on slot 86.s_load at 0x_: dynamic soffset unsupportedwave reduction at 0x_ may execute in divergent control flowmixed lane Wave32 cannot lower ds_write2_b32 at 0x_unsupported mesh operation s_add_i32 at 0x_mubuf at 0x_: atomic on a non-UAV bufferwave operation requires complete 32-lane compute wavesv_readlane_b32 at 0x_: inside non-uniform loop (0x_..=0x_); barrier/wave read cannot be proven convergentmesh wave exchange v_readlane_b32 at 0x_ inside a loopcompute swizzle inside a loopunsupported mesh launch or output configuration: MeshInfo { vertices: 128, primitives: 128, topology: 2, threads: [128, 1, 1], payload: 0, shared_bytes: 3072 }PS attr3 has no signature register [v_interp_p1ll_f16 @ 0x_]raw BVH node intersection requires traversal translation at 0x_MeshInfowithshared_bytes: 10368PS attr5 has no signature register [v_interp_p1ll_f16 @ 0x_]Another 26 reasons cost 1–9 pipelines each. They include two shaders whose HLSL exceeds the 8 MiB compiler budget,
ds_max_i32encoding,image_get_lod dim 5andv_add_f16reductions. I can paste the full list.The 2 runs found 22 and 0 new refusals while running. Reasons for the 22 in run 1:
32-bit read of half-float PS attr3 [v_interp_p1_f32 @ 0x15c]mimg at 0x_: sN not a sampler descriptor (None)wave reduction at 0x_ may execute in divergent control flows_load at 0x_: heap buffer in a pixel shaderPS attr9 has no signature register [v_interp_mov_f32 @ 0x998]lane op at 0x_: non-constant lane operand Some(Sgpr(_))wave operation requires complete 64-lane compute wavesunknown two-word visibility atomic [image_atomic_umax @ 0xe8c]s_load at 0x_: dynamic soffset unsupportedThe provider substituted a null compute pipeline for untranslated shaders (8 such log lines in run 1), and the cache skipped up to 1,024 requests with known refusals.
The
wave=32-64profile means the 64-lane programs run as 64-lane waves here, so the 32-lane-only reasons on this list (complete 32-lane compute waves,mixed lane Wave32 …) may be different from what NVIDIA hosts see.What I'm asking
mainfor the provider's memory categories? I'd like to report numbers rather than system monitor readings.I can share the pipeline-failure TSV, the crash reports and the run log privately. The log contains local paths, so I didn't attach it.
Not established
TUXBOX_PIPELINE_DEADLINE=0.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-28T15:13:32Z.
Could you retest this on current
main? Several changes target this memory use:TUXBOX_VRAM_RESERVE_MIB);TUXBOX_PARTIAL_MIPS);With these, an RTX 4070 Ti SUPER (16 GB, 32 GB RAM) reached the opening world scene. None of them has been run in the game on a 12 GB or AMD card. A run with
--log-file, with thememory ledgerandtexture ledgerlines from the log, would show where it stands (setWINEDEBUG=-all,+debugstrif they don't appear).Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-28T16:36:46Z.
I'm on it, will report back when I can share insights.
Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-28T18:21:23Z.
I retested on current
mainwith the RX 6600 from my report above. On 8 GB the memory changes make a large difference. The runs now end in a GPU page fault, which I'm reporting on #232.Setup: RX 6600 (
1002:73ff, RDNA2, 8 GB), Ryzen 5 5600, 32 GB RAM + 34 GB swap on disk, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14, Microsoft DXC 1.9.2609.mainat2af42c9, D3D12 provider sha256e9a5f358…. Full prepare before the runs (0 failed, 708 unsupported). ProjectScarlett 1.0.2.1, offline, 3840x2160 output. Default settings (TUXBOX_VRAM_RESERVE_MIB1536,TUXBOX_PARTIAL_MIPSon,TUXBOX_RESIDENT_PIPELINES4096), plusTUXBOX_TRACE_GPU_FAULT=1.Two runs
Neither run hit the #215 watchdog. In both, frames slowed to one every 17–34 s at the end.
Memory: before and after
The game process's own amdgpu counters (
/proc/<pid>/fdinfo), sampled every 10 s, compared with my earlier run onmainb426c1a:b426c1a2af42c9run 12af42c9run 2amd-requested-vram, peakdrm-memory-gtt(resident), peakRequested VRAM now stays within the card instead of asking for nearly twice its size. The data moves to GTT instead, and host memory is still tight.
Ledger lines
From the start of run 1:
The last ledger before the fault, run 1:
The last ledger before the fault, run 2:
What I read from this:
TUXBOX_PARTIAL_MIPSsaves about 2.6 GB, close to the 2.4 GiB in FOCUS.md.Readback volume
The
placed texture readbacklines in the last seconds before the fault in run 2:The largest entries are 2560x1440 targets (formats 10, 41, 26) with
sources=heap-uav. That's about 1.9 GB read back in 5 s, most of it unchanged. It fits the write-set issue from this thread and #300. With most textures in system memory, I think it explains the 20–30 s frames, but I haven't measured that.Not established
Current Mission Name: 0x98c85f2a). This time the full GPU reset ended the game before it wrote a crash report.TUXBOX_PARTIAL_MIPS.I can run again with a different
TUXBOX_VRAM_RESERVE_MIB(for example512) if a comparison helps.Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-28T22:13:53Z.
A follow-up from the RX 6600 (8 GB). With the GPU faults gone (NickStallman's
fix/as-update-unbuilt-source,ce620c77, on top of #409 ata2b56c9), a run now reaches the world and ends on the title's watchdog. In the last 20 seconds before that, the readback buffers fill the card's GTT.Setup: RX 6600 (
1002:73ff, 8 GB), Ryzen 5 5600, 32 GB RAM + 34 GB swap, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14. Default memory settings (TUXBOX_VRAM_RESERVE_MIB1536,TUXBOX_PARTIAL_MIPSon).Run
It lasted 540.5 s, with no GPU fault and no reset. It ended with exit code 5, the watchdog: the crash report shows the mission set at frame 1,734 and the crash at frame 1,747. Each presented frame took 18–28 s.
Memory, sampled every 10 s
From the game process's amdgpu counters (
/proc/<pid>/fdinfo) and the host:Requested VRAM stays near 6.8 GB the whole time, so
TUXBOX_VRAM_RESERVE_MIBholds. GTT is what grows. Its limit on this card is 16 GB, and in the last sample the process asked for 17.8 GB. The swap grew by 3.3 GB in those 20 s.Where it comes from
The
placed texture readbacklines before the end:Each 5–7 s window creates 1–3 GB of new readback buffers and reuses almost none. Most of the copied data is the same 504 textures (
largest=939.3MiB/504 textures), mostly 2560x1440 targets. The ledger at the end shows the adapter's system memory over its budget:Reading
On 8 GB, the world frames now end because readback buffers outgrow system memory, not because of faults. I think the watchdog fires because the GPU and the host are stalled by swapping and GTT eviction at that point, but I haven't measured that link.
Two questions:
reused=0)? With the same 504 textures each time, reuse would cap the GTT.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-29T00:29:57Z.
Retest on the 12 GB card. Short version: the memory changes work here, VRAM never fills, and the run gets into the world. It ends the same way your RTX 4070 Ti SUPER run did, on the distant lights draws, and on AMD the kernel says a bit more about which access it is.
Setup: RX 6700 XT (
1002:73df, 12 GB), i5-12600K, 32 GB RAM, 16 GB disk swap + zram, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14.mainat70f4892with #409 (ce620c7) merged on top. All providers rebuilt and staged includingXboxBvhBuilder.dll, shaders prepared right before (32,421 requests, 201.7 s, nearly all cached). Offline, 3840x2160, default memory settings,TUXBOX_TRACE_GPU_FAULT=1, noLD_PRELOAD.The run (3,703.7 s, exit code 3)
No stalled label waits, no rejected batches, no
Not enough memory for command submission.Ledgers. During loading:
Last ones before the fault:
So #378 does what the numbers in this issue said it would. At the point where the old build had 2.4 GB of native images nothing had touched, this one has 65 MiB on the card and 2.4 GB unbacked. The reserve holds the card at about 9.2 GB by sending 4.9 GB of textures to system memory, and partial mips saves another 2.7 GB.
Process counters (
/proc/<pid>/fdinfo, MiB):Readback is what grows, same as @1093i3511 saw on the 8 GB card and the same 504 textures:
GTT went from 1.2 GB to 10.8 GB in about two minutes and swap from 1.4 GB to 14.6 GB. It didn't reach the 15.8 GB GTT limit before the fault, but it was headed there.
The end. Nine commands started and not finished, all the same pipeline, which
evidence/projectscarlett-world-run.jsonnames as the distant lights programs:That's the same nine draws as the Xid 13 run, so it's the same fault on both vendors. What amdgpu adds:
Ten of these, eight at
0x8002bf934000and two at the next page,0x8002bf935000. The client is TCP, the texture cache, andRWis 0. So on this card it's a texture read that faults, not a buffer load and not a write, and it's two adjacent pages. The record says the faulting access isn't established, so maybe that narrows it. After that the kernel reported agfx_0.0.0ring timeout, reset the ring and carried on; the desktop survived.About #409: its case never came up in this run. There's no "was given new storage after a list recorded it" line at all, so this neither confirms nor contradicts it.
The 37 minutes of black. This is the part I didn't expect. Shaders were prepared on the same build minutes earlier, and the launcher still compiled 3,811 during the run (174 unsupported), about 3,250 of them before the picker showed. Your record has a prepared launch reaching the fault 234 s after start. Is that many unprepared requests expected after
--prepare-only, or does it mean my recorded request set is stale? Happy to send the launcher's list of what it compiled if that helps.Not checked: whether the picture was right (I saw the loading images and heard music; in the world I saw a still image and a moment of audio), and anything past the first 90 seconds of the world.
Update, same evening. Three more runs on the same build, about 6 to 10 minutes each now.
The slow start answers itself: it was a one-time cost. Second launch reached the picker in 67 s and compiled nothing. So
--prepare-onlydidn't cover about 3,800 requests the first launch on this build needed, but they're cached after that.TUXBOX_PARTIAL_MIPS=0TUXBOX_LAZY_TEXTURES=0TUXBOX_LAZY_TEXTURES=0So partial mips isn't it: the fault is the same with every mip backed (
mip ledger: images missing large mips 0). When it faulted in run 2 the texture ledger still hadunbacked 73 (51 MiB), which is why I tried lazy off next. Run 3 got through about three times as many world frames with no fault, but run 4 went down a different way a minute in, so I can't say lazy off avoids anything. With lazy off the card is overcommitted here (card 16321/12272 MiB), so those two runs are the least comfortable ones.Run 4 is the one other AMD testers should know about, and it had #409 in:
After that every process's GPU thread and kswapd block for good, the desktop freezes, killing the game doesn't release anything, and it takes a reboot. These are writes (
RW: 0x1), where runs 1 and 2 were reads. The addresses are in the driver's range, not raw title addresses, and there's no "was given new storage" line, so this isn't the case #409 fixes. It may be the compute write fault @DrArroway describes in #403. It's the same sequence @1093i3511 posted on #232 (compute ring reset failed, MODE1) and what took this machine down for two days on Thursday.What I take from the four: on this card a fault on the gfx ring is survivable and a fault on the compute ring isn't. If you're testing on RDNA 2, have a way to reboot.
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-29T20:20:03Z.
A data point from a 16 GB RDNA 4 card, with #501 and
TUXBOX_XMEM_PRIVATE_VIEWS=1.Setup: RX 9070 XT (
1002:7550, 16 GB), RADV / Mesa 26.3.1, GE-Proton11-14, Linux 7.3.6 (CachyOS), Ryzen 7 9800X3D, 32 GB RAM. Story save, offline. Render targets in the logs are 2560x1440.Runs (all with
TUXBOX_XMEM_PRIVATE_VIEWS=1 TUXBOX_SUBMIT_PROFILE=1 TUXBOX_LOG=1):fd636d09+ #501 (before its rebase) + #4982d6dc338+ #501 (cbb6a2df)0x741041), device lost, exit 32d6dc338+ #501 (cbb6a2df)winevulkan signaller_worker wait timed out, title watchdog, exit 5, no kernel page faultThe memory ledger's last line before the end shows the card at 12.0–13.2 of ~15 GB in each run (title pages 7131 MiB, process commit 13.5–16.8 GB).
Placed texture readback grows to GBs per window in the world. In the menus it's a few MiB per 5 s. After the story save loads:
The largest single readbacks are 2560x1440 targets written through UAVs (
flags=0x300004,layout=0x102,sources=heap-uav), 14–28 MiB each.Submit time is no longer the limit with private views. Over the last ~4 minutes of the cold run, the direct queue spent about 26 s in batches, 19 s of it in placement, against about 156 s of gap. Before #501, on
fd636d09without private views, placement was about half of every queue's batch time (the #472 digest). In the world it still renders a few incomplete frames below 1 fps.Two of these three runs end within a minute of vkd3d falling back to system memory. That ordering also matched every earlier run here that showed the fallback, so on this card the memory growth looks like what ends runs once #472's cost is gone. I haven't shown that the readback is the cause rather than another symptom; I can rerun with
VKD3D_CONFIG=faultor another trace if it helps.Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-29T21:11:33Z.
A follow-up to my comment above, which pointed at placed texture readback. That turned out not to be what fills memory here.
What I measured. With a local probe, I split each 5 s window's readback by where the texture's pages are mapped in XMem: a CPU aperture, a GPU-only aperture (the NOACCESS placeholder reservations), or not XMem pages at all. I also checked whether any other mapping of the same physical pages exists. In the world, on the same RX 9070 XT setup:
The largest of these are the 2560x1440 UAV targets, each wholly in a GPU-only aperture.
What happened when I skipped them. As a local experiment (not proposed), I dropped readbacks of textures whose every page is GPU-only with no other mapping:
int_prolo_int_prolo_ext).What I take from it:
I've removed the probe and the experiment from my build.
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-29T21:40:01Z.
Another data point from the RX 9070 XT (16 GB, RADV / Mesa 26.3.1, GE-Proton11-14,
2d6dc338+ #501,TUXBOX_XMEM_PRIVATE_VIEWS=1, warm caches). The vkd3d "falling back to system memory" warnings here come from the resizable BAR budget, and the placed-texture spill to system memory appears to be what fills it.The jump. The card doesn't fill gradually. Within one 5 s ledger window after the story save loads, the lazy textures from #378 go from 64 backed (80 MiB) to 22,371 backed (6,451 MiB), and the card from 4.7 GB to 11.3 GB. vkd3d's first fallback lands inside that window.
Where the fallbacks come from. At device creation vkd3d logs
Applying resizable BAR budget to memory types: 0x218. In the logs, the fallbacks follow TuxBox's ownvideo memory is nearly full: placed texture #N put in system memorymessages on the same thread.residency.rsmakes those spill heapsD3D12_HEAP_TYPE_CUSTOMwithWRITE_COMBINE/MEMORY_POOL_L0. With ReBAR, vkd3d places that CPU-visible memory in the BAR part of VRAM, so the spill ends up in the BAR budget instead of system memory.TUXBOX_VRAM_RESERVE_MIB=4096TUXBOX_VRAM_RESERVE_MIB=4096+VKD3D_CONFIG=no_upload_hvvWith
no_upload_hvvthe spill goes to host memory, no allocation falls back, and the card stays around 11.2 of 15 GB. That run also got further than any other on this card (int_chase_int_chase_int0). One run per row, so the times are only indicative. The shader cache stayed warm withno_upload_hvv.It still ended on a GPU fault, with no fallback before it this time: TCP write, status
0x741041, at0x800328dd0000. So on this card the fallback was not the only cause of the crashes, and there is a separate fault left to look at.A possible direction, untested: make the spill heap one that vkd3d keeps in host memory under ReBAR, or have the launcher set
no_upload_hvvwhen it spills.Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-30T06:26:46Z.
@Kayotic1337 #575 tries your direction: spill heaps are now
WRITE_BACK(host-cached, never in the BAR), with a fallback to write-combined if the driver refuses. Could you rerun yourTUXBOX_VRAM_RESERVE_MIB=4096case withoutno_upload_hvv?Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-30T06:45:30Z.
I tried this on a 12 GB RX 6700 XT (
1002:73df, RDNA 2, RADV, full ReBAR, GE-Proton11-14, Linux 7.3.6). Same0x218budget line at device creation (types 3, 4 and 9 on the 11.98 GiB heap, so about 767 MiB of budget). I can confirm thatno_upload_hvvgets rid of the fallbacks, but I don't think the spill is what fills the BAR budget.Both runs are
mainf482572aplus #557 (plain main crashes at init here, #554), default settings, one run each:VKD3D_CONFIG=no_upload_hvvWith
no_upload_hvvthe spill was bigger and there were still no fallbacks. Four of the default run's fallbacks also come long before anything spills: one about 25 s after device creation and three at the picker, with the card 1.5 to 4 GB full of 10. And in the world, the first 8 fallbacks are logged before TuxBox's first "put in system memory" line, during the lazy texture burst. Your two default rows with 0 textures in system memory and 4 and 2 fallbacks look like the same thing.I read vkd3d-proton's
memory.c(GitHub master, I didn't check the exact version in GE-Proton11-14) to see where the spill heap goes.CUSTOMwithWRITE_COMBINEandMEMORY_POOL_L0asks forHOST_VISIBLE | HOST_COHERENTwithoutDEVICE_LOCAL(only L1 adds it), and when system memory types exist the device-local candidates are dropped, so those heaps should land in system RAM, not in BAR. The "falling back to system memory" message only fires for requests that includeDEVICE_LOCAL.no_upload_hvvonly changesUPLOADheaps, and with it set the ReBAR budget isn't set up at all. So my guess is the fallbacks come fromUPLOADheaps going over the 1/16 budget, TuxBox's own staging and mirrors included, and the spill just happens at the same moment because both follow the lazy texture burst.Neither run ended on a GPU fault here. Both hit the title's 30 s main-thread watchdog (
exe+0x23CF683, like #215), crash log "Game Running", with an unsignaled cross-queue barrier, and the kernel log was clean. So on this card the fallbacks don't decide how the run ends either, which matches your last row.@NathansDomainSolutions on #575: if I'm reading
memory.cright, the write-combined L0 heap already stays out of BAR, so I'd expectWRITE_BACKto leave the fallback count where it is. Happy to run it on this card withTUXBOX_VRAM_RESERVE_MIB=4096and withoutno_upload_hvvto check.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:37:34Z.
@JeffreyBytes thanks, this is a careful result, and it fits why #575 is held: it wasn't run on hardware, and your reading of
memory.csays the L0 write-combined spill already stays out of the BAR. If you do run #575 withTUXBOX_VRAM_RESERVE_MIB=4096and withoutno_upload_hvv, that would settle it either way.Your lead, that the fallbacks are
UPLOADheaps going over the 1/16 ReBAR budget (TuxBox's own staging and mirrors included), looks like the one to follow. A count of TuxBox's ownUPLOADheap bytes at the first fallback would test it. Since neither run ended on a GPU fault and both hit the title's 30 s watchdog (exe+0x23CF683, as in #215), that ending is worth its own look; the unsignaled cross-queue barrier is the obvious suspect.Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T12:27:21Z.
Currently in school with no way to acces this machine. Will report back when i get home
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T17:43:26Z.
Correction, and what the fallbacks actually are. On an RX 9070 XT (
1002:7550, RDNA 4, RADV, ReBAR, GE-Proton11-14, 16 GB), the vkd3d "falling back to system memory" allocations are TuxBox's own texture-upload staging buffers. They hit vkd3d's fixed ReBAR budget. Texture spill doesn't cause them, and VRAM isn't full.1. My spill claim was wrong. @JeffreyBytes was right. My own logs already showed it. I just hadn't put them side by side:
no_upload_hvvFallbacks also happen with no spill at all. The spill landing a few lines before the fallbacks was a shared cause (a burst of lazy texture uploads), not cause and effect. Sorry for the wrong lead.
2. It's the ReBAR budget, not VRAM. Run C used the old write-combined spill heap, reserve 4096, and
VKD3D_CONFIG=log_memory_budget(vkd3d-proton 71cae091). Every fallback is the fixed budget refusing a large request while VRAM still has room:In 71cae091,
vkd3d_allocate_memoryonly enforces this budget for heaps that normalize toD3D12_HEAP_TYPE_UPLOAD(respect_budget, memory.c:1612). A write-combined L0CUSTOMheap also normalizes toUPLOAD, but it never asks forDEVICE_LOCAL, so it never tries the ReBAR types 3/9. The refused requests are therefore realUPLOADheaps.About half of the budget is gone before any of them. One internal, non-budgeted allocation of 488 MiB (
500128 KiB, type 4) is made at device creation, right after the descriptor-size queries, and it counts toward the samerebar_current. That happened in both runs where I logged it. I haven't identified what it is. That leaves about 530 MiB for everyUPLOADheap.3. Those
UPLOADheaps are TuxBox's texture-upload staging. For run D I added one log line before the committedUPLOADbuffer inplacement/upload.rs(Transfer::begin) and one where the idle pool trims a buffer. Everything else matched run C: the #575 build withTUXBOX_SPILL_WRITE_BACK=0. There were 3 fallbacks, and the line right before each refused request, on the same thread, is a staging create of exactly that size:The match holds for the whole run. All 11 staging creates of 32 MiB or more line up one to one with a vkd3d allocation of the same size: 8 landed in ReBAR (type 3) and 3 fell back to system memory (type 2). Run C's sizes (528/288/240 MiB) are also multiples of 16 MiB, which is how
upload_capacityrounds anything over 32 MiB.That also explains why
no_upload_hvvgives 0 fallbacks: it moves everyUPLOADheap, staging included, out of ReBAR.Possible lever (untested). At each failed create, the pool held 31–32 idle buffers.
IDLE_BYTESlets up to 256 MiB of idle staging stay allocated, and in ReBAR that's a quarter of the budget.beginonly reuses an idle buffer that's at least as large as the request, so a 240 MiB batch always allocates a new buffer next to it. Options would be: trimming the idle pool before a large create, splitting batches so no staging buffer gets that big, or putting staging in aCUSTOMwrite-combined L0 heap so it stays out of the BAR. I haven't tried any of these.What this doesn't say: there's one run with the diagnostic (n=1). The size match is exact, so I'm confident about who allocates. Whether fixing staging removes the fallbacks is untested. All four runs (A–D) still end on the separate compute-queue TCP write fault (
0x641041/0x741041), so that crash isn't caused by the fallbacks. In C the compute ring reset failed and the kernel did a full MODE1 GPU reset.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T23:18:34Z.
@Kayotic1337 thanks for the correction and for matching the fallbacks to staging creates one to one. That settles who allocates them.
Correction (edited): I first wrote that we'd take this on. In fact main already has the third option: #595 (
0a57ca9c, merged 30 Nov, after the builds in your runs) puts texture-upload staging in a write-combinedCUSTOML0 heap. That's system memory, so vkd3d doesn't count it against the fixedUPLOADReBAR budget. So the fallbacks you matched to staging creates shouldn't happen on current main.If you rerun on current main with
VKD3D_CONFIG=log_memory_budget, could you check that the "exceeding fixed ReBAR budget" fallbacks are gone? If any remain, the line before each one should name what's left. We're running the same logging on an NVIDIA card now.The 488 MiB type-4 allocation at device creation is still unexplained. If you can get a backtrace for it (it comes right after the descriptor-size queries), that would tell us whether TuxBox asks for it or vkd3d makes it internally.
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T23:24:48Z.
@brcly thanks. One note on the options: the write-combined
CUSTOML0 staging is already on main. It's #595, merged as0a57ca9c, andTransfer::begininplacement/upload.rscreates staging that way now. With it I had 0 ReBAR refusals and 0 fallbacks in four runs, against 3 without it (the table is in #595). Trimming the idle pool or capping the buffer size would still help on top, but the fallbacks from staging should already be gone on current main.About the 488 MiB type-4 allocation: I'll try to get a backtrace when I next build vkd3d-proton with debug logging.
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T00:19:03Z.
@brcly the 488 MiB type-4 allocation is TuxBox's shader-visible descriptor heap.
With a local vkd3d-proton build (020fc944) that logs a stack for internal allocations of 256 MiB or more, and a map file for
d3d12_xs.dll:The title creates a shader-visible CBV/SRV/UAV heap of 1,245,184 descriptors.
Arena::createmakes the host's shader-visible heap for it (NumDescriptors: limit, fromresources::create_heap:max(1,000,000, MaxViewDescriptorHeapSize), capped byTUXBOX_DESCRIPTOR_HEAP_LIMIT). Only shader-visible heaps get device memory ind3d12_descriptor_heap_create_descriptor_heap(the staging heapsArena::createalso makes are CPU-only), and vkd3d-proton places that heap's descriptor buffer in ReBAR memory (type 4), as one 500,128 KiB allocation that counts toward the same 1,019 MiB budget asUPLOADheaps. I didn't read the exactlimitthis card gets, so I can't give the bytes per descriptor.Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T03:24:50Z.
Related, from a 16 GB card: at the story-intro prestream, backed placed textures go from about 3 to 8.6 GB within seconds, and 3.3 GB then spills to system memory. With bindless, "first use" backs every texture in an indexable heap. That fits the 9.2 GB native-copy figure here. The plan to back only what the GPU actually samples is in #533.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T15:14:25Z.
@Kayotic1337 thanks for finding the 488 MiB allocation: the title's shader-visible heap of 1,245,184 descriptors. And thanks for the #595 correction.
For the 9.2 GB of native copies: read residency, which backs only the textures bindless programs actually read, is now on by default (
e40d8052). At the story intro on a 16 GB card it kept card memory at 7.3-8.7 GB where it had gone to 13 GB plus spill. A 3840x2160 run on current main would show whether it brings this case under the card's size too.Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-02T20:09:38Z.
@brcly about the 3840x2160 run on current main you asked for: I can't give you that number yet. On
c1139ab2my RX 6700 XT dies right after the account picker in all three runs. Ahandoffs::planrefusal fails the present and the watchdog ends the title. Details are in #661.The only number I have is from the account picker at 3840x2160. It tells you nothing about the story intro:
I'm working on the crash. I'll post the story-intro number here once a run gets past it.