Repository navigation
Windows in card memory the CPU maps on 16 GB cards too, not only on small hosts (VICTORY_WINDOWS_BAR_MB=4096 when unset) - #2313
Conversation
…mall hosts (VICTORY_WINDOWS_BAR_MB=4096 unset) With VICTORY_WINDOWS_BAR_MB unset, hosts with 24 GB of RAM or more kept windows outside buffers in shared GPU memory. Those whose card has a budget of 14 GiB or more (16 GB cards) now get the 4096 MiB cap that hosts with a small shared budget already get. Small hosts keep 4096/3072 as before (trustno1-coder#1520), other cards keep it off, and an explicit value, 0 included, decides as before. window_mapped_for also returns at once without card memory the CPU maps, instead of counting the window and asking the host for a buffer it cannot make. RTX 5080 16 GB, 32 GB RAM, Series X 1440p DLSS Quality, 3-minute runs: shared GPU memory of the process 6.72/6.54 GB without, 4.36/4.95 GB with the switch and 4.47/4.66 GB with this default; the card's own 9.76/9.62 -> 11.62-11.87 GB; picture unchanged in the saved frames.
|
Independent placement check on an RTX 4070 Ti SUPER (driver 621.40, 32 GB system RAM). I tested the existing VICTORY_WINDOWS_BAR_MB path on the same diagnostic binary, with explicit 0, 1024 and 4096 MiB values. Series X 2560×1440, DLSS Performance, RT requested and FG off. Emulator image, shader and PSO caches started empty for each run. The existing driver cache was left in place. The binary includes #2263, #2148, #2188 and the diagnostic build fix from #2386. The GPU upload heap reported supported=true. Here are the final placement census snapshots, taken during late startup at roughly 5,500–5,900 draws/frame. The snapshots have different live window populations.
No sampled DXGI local usage exceeded budget. The 4096 probe also activated all 53 builder stages and completed its 30-second post-activation observation without a device fault. It remained in cold compilation. This confirms that the mapped placement is real on a second 16 GB NVIDIA model. These are cold diagnostic samples, so a steady gameplay FPS or visual parity claim would need a separate paired run. Release follow-up with explicit 4096 MiB on the same startup stack, without the diagnostic build fix and instrumentation. In the seven-minute empty-cache probe, peak DXGI shared usage was 4,058 MiB and all 200 local samples remained within budget. There was no device fault. The final workload still rendered at 0.8 FPS with 2,505 pending PSOs and the window showed a black loading screen at the visual check. Memory placement improved in the diagnostic series, while cold gameplay remains unverified. |
|
Independent check of this change on a different 16 GB card: RTX 5060 Ti 16 GB on PCIe 4.0 x8, Ryzen 7 5800X, 32 GB DDR4-3200. It holds here too, and the frame rate goes up as well. (AI-assisted with Claude Code: the runs, the log parsing and this write-up. Every number below comes from the layer's own log lines.) Rig and settings
"none" is
What I read from it:
So I'd suggest 6144 for the big-card branch instead of 4096, if it holds on your 5080 as well. It is a one-line change to For comparison, with
|
What it changes
With
VICTORY_WINDOWS_BAR_MBunset, windows outside buffers go to card memory the CPU maps (D3D12_HEAP_TYPE_GPU_UPLOAD) only on hosts with a small shared GPU budget (4096 MiB) or under 24 GB of RAM (3072 MiB, #1520, #1640). Other hosts keep them in shared GPU memory, which is physical RAM.This gives 4096 MiB to hosts whose card has a budget of 14 GiB or more (16 GB cards). 8 and 12 GB cards keep it off as before: their render targets, texture floor and card copies arrive after the windows, and the existing guard (a fifth of the card's budget free) does not count them. Small hosts are unchanged, and an explicit value (0 included) decides as before. The default is moved into
window_mapped_default, with a unit test.window_mapped_foralso returns at once when the card has no memory the CPU maps (no resizable BAR), instead of counting the window inWINDOW_MAPPED_BYTESand asking the host for a buffer it cannot make. That was already the case for small hosts without a resizable BAR.How it was tested
829188e9+ Clippy -D warnings clean across the workspace (main's CI gate) #2048 (diagnostics build fix) + XMem: place a reservation above 128 GiB when nothing below has room (#2081) #2133, with and without this commit.VICTORY_WINDOWS_BAR_MB=4096. After: this branch with nothing set, twice.VICTORY_WINDOWS_BAR_MB=4096(2 runs)card memory the CPU maps supported=true.VICTORY_WINDOWS_BAR_MB=1024alone on an RX 7800 XT as "no visible change"; its breakage came withVICTORY_WC_BAR=1, which this does not touch.cargo testfor the crate it touches:victory-gpulib, 915 passed, 1 failed in the full run (host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started), which passes when run alone and tests the F1 menu settings file, not this code. Clippy: no warnings in the changed lines.Calibration of the counters (synthetic, no game)
A small local test on the same PC makes one 1 GiB buffer at a time, maps it, writes every byte, and reads the process and DXGI counters after each step:
GPU_UPLOAD(where this puts windows)UPLOADGPU_UPLOADtakes its pages out of the process's physical memory. In the first runs, with other programs open, the working set did not fall clearly (19.1-19.7 GB against 19.3-20.4 GB); the pairs below, with the PC otherwise idle, show it.UPLOADheap buffer also lands in card memory.Three alternated pairs with this branch (physical RAM)
Same exe (this branch on
829188e9+ #2048 + #2133), 3-minute runs, base =VICTORY_WINDOWS_BAR_MB=0, on = nothing set, order base/on three times, other programs closed. Means from 40 to 100 s after the first world frame:VICTORY_WINDOWS_BAR_MB=2048: frame time 48.0 -> 40.2 ms, MakeResident total 13.6 -> 8.9 s, peak working set about 1.9 GB lower in a 0-2048 MB sweep.Not changed here
The 80 % guard in
window_mapped_foris the existing one: it does not followVICTORY_TEXTURE_ROOM_PERCENT(74 % with multi-frame generation inplay-foxhound.ps1), as on small hosts today; making it do so would change those hosts too, so it is left for a separate change. A window in this memory that a GPU write is declared on (root or table UAV, an on-card copy) goes through the deferred-write path, which reads it back across the bus; the code notes no shader writes a window in this title, and diagnostic switches (VICTORY_UPLOAD_CHECK,VICTORY_REFRESH_CHECK,VICTORY_FACE_WATCH) read it too.VICTORY_WINDOWS_OWN=1needsVICTORY_WINDOWS_BAR_MB=0to keep two-sided windows on these hosts, as on small hosts today.Checked for overlap
VICTORY_CARD_CPU_HEAP, which on the same runs lowered shared memory by 0.8-1.1 GB but free RAM by only about 0.1 GB).