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
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2313
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2313"
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?
@wildheathen on GitHub · 2026-11-29 11:45 UTC · original
wildheathen:windows-bar-default→main· +62 −17 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCWhat 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+ #2048 (diagnostics build fix) + #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).@Ondra97 on GitHub · 2026-11-29 13:14 UTC · original · edited 2026-11-29 13:21 UTC
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.
@schoperena on GitHub · 2026-11-30 12:13 UTC · original
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
nvidia-smiBAR1 total 16,384 MiB, logcard memory the CPU maps supported=true, budget ~14.9 GB.mainat41adb551, release build. Series X, 2560x1440 (VICTORY_NATIVE_SIZE=2560x1440, the monitor is 2560x1080), DLSS Quality, frame generation off, ray tracing off, warm shader cache and pipeline library. The launcher's own switches otherwise (VICTORY_WC_NO_BACK=1,_MIN_KB=1024,VICTORY_ALLOCATOR_TRIM=1, ...).VICTORY_KEYSpresses Enter every 4 s from 8 to 140 s (continue the last save), then the game runs by itself until closed at 420 s. Same save each time (the prologue cell and its first scripted scenes). Nothing else open; PC untouched.host: N fps ...(one sample every ~5 s),memory now: committed ...,process memory: ..., and whethertextures picked by index: the card has no room for more; they waitappeared. Percentiles are of the ~5 s samples.VICTORY_WINDOWS_BAR_MB, everything else as onmain(VICTORY_WC_BARunset)"none" is
mainat41adb551as it is. The other four runs used one build:41adb551plus a default equivalent to this PR's but with 6144 (budget 14 GiB or more and card memory the CPU maps → 6144). The 4096 runs setVICTORY_WINDOWS_BAR_MB=4096explicitly, which overrides that default, so they behave asmainwith the switch; the 6144 runs left it unset and the log printed the default's line, so the default path was taken.What I read from it:
0x8007000Ein any of these runs. The run script takes a desktop screenshot every 30 s; the ones I looked at (the same moment of the same scene, with none and with the windows in card memory) showed the same, correct picture. I did not watch every run live, so a flicker between screenshots would not have been seen.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
window_mapped_defaultplus its test; I have it as a commit on top of this branch and can open it as a PR against yours or againstmain, whichever you prefer.For comparison, with
VICTORY_WC_BAR=1added (same rig, one run each)VICTORY_WC_BAR=1adds nothing measurable on top of the windows in frame rate here (19.1-19.9 with it, 18.7-20.4 without), and about 0.6 GB less shared memory; given #553's flicker I would not touch its default.