fix(gpu): raise 12GB VRAM window gate to 88% to prevent premature shared-memory spill #2988
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!2988
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2988"
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?
@Luca121 on GitHub · 2026-11-29 19:13 UTC · original
Luca121:pr/12gb-window-card-percent→main· +6 −6 · 1 files · 1 commits · closed without mergingSummary
On 12 GB GPUs (DXGI budget ~10.8–11.2 GiB, e.g. RTX 4070 / 4070 Super / 4070 Ti / 3080 12 GB),
shadow.rspreviously fell into the_ => 80catch-all indefault_window_card_percent(budget)(designed for 8 GB cards) and hardcodedbudget / 10 * 8(80%) inwindow_mapped_forandwc_mapped_for, while also double-gatingwindow_room_forwith|| !crate::resource::card_copy_fits(budget, used, size):default_window_card_percent10–12 GiB tier (88%):> 12 GiB) get89%and 24 GB cards (>= 20 GiB) get91%, while 12 GB cards (~11,229 MiBDXGI budget) dropped all the way to80%(~8,800 MB).window_room_forrejected all new vertex/index/constant shadow windows from their dedicatedwindow_card_most(1,010 MB) allowance and spilled them toSHAREDsystem RAM over PCIe, even with >2.2 GB of VRAM budget remaining.mb if mb >= 10 * 1024 => 88todefault_window_card_percent(budget)(leaving 8 GB cards at80%), and alignwindow_mapped_forandwc_mapped_fortobudget / 100 * 88.Remove redundant
!card_copy_fitsveto inwindow_room_for:window_line(budget, percent, kept, crate::resource::room_line(budget))already caps window allocations atresource::room_line(budget)with a floor ofshare(percent.min(80)).|| !crate::resource::card_copy_fits(budget, used, size)check unconditionally vetoedwindow_line's 80% floor wheneverVICTORY_TEXTURE_ROOM_PERCENTwas set below 80% (e.g.78%), preventing windows from using even the baseline 80% line thatwindow_lineexplicitly preserves (tested bywindow_line_keeps_the_room_held_for_targets).Hardware Telemetry (RTX 4070 Ti 12 GB, 32 GB RAM)
80.0%(~12 minutes into open-world driving),shadows cardshrank from1,912 MB→1,413 MBas all new neighborhood shadow windows were refused from VRAM and forced intoSHAREDsystem memory over PCIe.88%gate (window_card_moststill strictly capped at1,010 MB),shadows cardremains resident in VRAM (~1,897 MB) across 15–30 minute open-world drives with0OOMs and0.0 mslists in the air.Testing
shadow::window_tests::window_line_keeps_the_room_held_for_targets,window_room_follows_the_budget, andarenas_do_not_use_the_windows_room(cargo test --locked -p victory-gpu --lib).@DoubleD17 on GitHub · 2026-11-30 07:58 UTC · original · edited 2026-11-30 09:57 UTC
We ran a test of this PR on a 12 GB card, on current main (
41adb551with this PR merged).We compare only the seconds where the idle camera shows the same lighter views (about 7,500 draws a frame). Its heavier view (about 15,000 draws, half the frame rate) takes 10 to 60 s of each 150 s run, and it moved whole-run means by several ms.
No difference we can measure. The five main runs of the session agreed within 1.3 ms on these seconds. But we also ran main again, built in another folder, eight times: it ranged from 57.5 to 65.5 ms. Its first four runs were 2.4 ms slower than main on average, and the last four 4.2 ms faster. All nine PRs we tested in this session came out 0.4 to 3.9 ms slower than main, and fps moved with it. So we read the difference as a newly built executable, not as this PR.
Memory in the last 100 s of each run: shared 8.8 and 8.4 GB and dedicated 10.8 and 10.7 GB, against 8.5 to 9.0 GB and 10.6 to 10.8 GB on main. So on this card we see no less spill to shared memory.
Picture: in round 1, one frame (of 160) had the island trees and the potted plants missing. They were back in the next frame. We now see it on main too (1 frame in 3,160 tonight, against 7 in 4,240 on PR builds), so it is not this PR alone; it looks like the one-frame gap in #1165.
Setup:
41adb551(only its own commits on top), against41adb551itself;Picture check: a burst of 10 captures a second at the end of each run (80 frames), looked at frame by frame.
AI Assisted
@Luca121 on GitHub · 2026-11-30 20:11 UTC · original
Closing to keep the PR queue clean — will focus on real-hardware A/B testing on current main instead.
Pull request closed