16 GB cards: every title buffer's copy in the card's memory (VICTORY_CARD_BUFFERS_MIN_KB=64) takes ~10 ms of snapshots off the submitting thread #343
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#343
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?
@Arvi23 on GitHub · 2026-11-26 17:48 UTC · original
On a 16 GB card,
VICTORY_CARD_BUFFERS_MIN_KB=64(every title buffer's copy in the card's memory) takes the CPU snapshots (~9 ms a frame) off the submitting thread: in busy gameplay it went from working 53.7 to 46.5 ms a frame, and frames from 58.1 to 49.4 ms (median). VRAM in use stayed the same.Edited: an earlier version gave 7–18 ms for the submitting thread; those were menu frames at the end of the run. The numbers below are busy stretches only (frame lines with more than 3,000 draws, and the lines logged with them).
Machine: RX 9070 XT 16 GB (budget 14.8 GB), driver 32.0.32029.2010, Ryzen 7 5800X3D (8 cores), 32 GB, Windows 10 LTSC 21H2 (Agility SDK 620). Build:
c9c932c+ local patches, diag,scripts\play.ps1defaults, Series X, renderer ports 1 and 2. Same route both runs: opening cutscene, then the city waterfront on the boat.On a 12–20 GiB budget,
default_card_limits_mbputs copies in the card's memory from 4 MiB. Smaller copies that shaders write take the CPU path: a snapshot on the submitting thread before each submission, and a compare afterwards. On this machine that path set the frame.VICTORY_CARD_BUFFERS_MIN_KB=64preparing per frameline)VICTORY_ASYNC_SUBMITline)the card's clockline)There was no device loss in either run. By eye: cutscenes reach 30 fps, and the boat averages 20–22 instead of 16–18. The submitting thread still sets the frame (the title waits ~20 ms at each present in both runs). With more cores the gain may be smaller, but the snapshots ran one after another on that one thread either way.
Suggested default: 64 KiB on budgets over 12 GiB, unless
VICTORY_CARD_BUFFERS_MIN_MBasks for a size (the_KBvariable still wins). This is what we run:Diff (crates/victory-gpu/src/shadow.rs)
@Lancito01 on GitHub · 2026-11-26 18:27 UTC · original
Same switch on a 10 GB NVIDIA card, where the effect is much larger. One run each, so treat it as a strong lead rather than a measurement.
Machine: RTX 3080 10 GB (budget 9285 MB), 32 GB RAM, Windows 11. Tree: cool_fox f4b48ad (on this repo's
0a43566), diag, Series S profile. Switches: INDIRECT_WINDOW=1 LEVELS_ON_DEMAND=1 TEXTURE_NO_WAIT=1 CARD_REHASH_RUNS=1 TEXTURE_BACK=1 LATE_WAIT=3 AMBIENT=0.6 CARD_BUFFERS_MB=1536 (the #213 set). Scene: prison cutscene, ~4,000-4,500 draws, all pipelines built (0 being made).On a budget under 12 GiB the default puts copies in the card's memory only from 16 MiB (logged
card_buffers_min_kb=16384).CARD_BUFFERS_MIN_KB=64So on this card the bigger cost of the default is on the GPU, not the submitting thread: shaders reading and writing the small copies in system memory over the bus. With 64 KiB the GPU drops to about a tenth, and the frame is then set by the CPU side (preparing plus copying back, ~100 ms together).
The same tree with output at 1080p instead of the default gave the same 79-85 ms, so on this card resolution is not the limit once the copies are in VRAM.
@Arvi23 on GitHub · 2026-11-26 19:55 UTC · original
Thanks for running it on a 10 GB card, that's the most useful data point here. It also shows where the cost really sits: on your card it's the GPU reading and writing the small copies over the bus, and on mine it was mostly the CPU snapshots on the submitting thread.
In our fork the 64 KiB default only applies to budgets over 12 GiB (
default_min_kbin the diff above). Your run suggests it's worth it on smaller cards too. One thing to watch there: a copy that shaders write takes its size twice in VRAM, so on 8–10 GB cards theVICTORY_CARD_BUFFERS_MBcap (1536 MB in your set) matters more. If someone has an 8 GB card, a run with 64 KiB and the texture memory line would show whether it starts evicting textures.