[gpu]Textures: over the queue's line the card's sweep rule goes first, also while the PC's memory is tight (VICTORY_SWEEP_CARD_FIRST) #2022
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!2022
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2022"
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?
@tupacfan04 on GitHub · 2026-11-29 07:42 UTC · original
tupacfan04:pr-sweep-card-first→main· +83 −0 · 2 files · 1 commits · closed without mergingRelated: #1963 (card use past the budget), #1475 (ray tracing on 12 GB).
What it changes
let_go_idle(resource.rs) has two rules for letting idle texture copies go: the card's (vram_keep_below: longest idle first, down to under the texture queue's line) and the PC's (residency::host_texture_idle_ms, taken whenever under 8 GiB of RAM is free). The PC's rule only takes copies whose title memory is unmapped, and while it holds the card's rule is never asked.On a 32 GB PC the PC's rule holds for the whole play (under 8 GiB free from the first world frames on). So mapped textures that had been idle for minutes were never let go, and the card sat over the queue's line and at or past the system's budget for whole runs: "no room, new textures wait" at every look, while the texture copies still grew.
With this, a look takes the card's rule when the PC's memory is tight and the card's rule wants bytes gone (the card within 2 % of the line or over it). Otherwise nothing changes.
VICTORY_SWEEP_CARD_FIRST=0restores the old behaviour.It also adds two log lines every 5 s next to the texture queue's room line: both of the system's memory groups at the same look (the shared one was only said when the budget moved), and how many looks took the card's rule while the PC's memory was tight.
Cost: textures idle 5 s or more (1.5 s when 5 % over) go while the card is over the line and are uploaded again on next use, so more mips can be waiting after turning around. I could not judge pop-in by eye (unattended runs).
How it was tested
VICTORY_BVH_BUILDER=1 VICTORY_LDS_LAST_RESORT=1). Same scripted 6-minute route, four runs alternating on / off on one build, nothing else running.VICTORY_SWEEP_CARD_FIRST=0), card in use over the run: 9759 → 10765 → 10906 MB and 10014 → 10455 → 10867 MB of a budget of about 10850 MB; no-room waits 255 and 250; looks by the card's rule 0; "on the GPU" averaged over the frame lines 30.8 and 80.9 ms, with 5 and 22 of ~82 lines over 100 ms.e1f2eb6+ #1939 + local log lines) with this same change; this branch is the change alone on main, where it needed a small adaptation (main's own weighing expression). On this branch I built and ran the tests, not the game.cargo testpassed for the crates it touches: yes (GPU 590, shader 395 with 8 ignored, loader 46; 0 failed), including the newthe_cards_rule_goes_first_over_the_line_with_the_pcs_memory_tight.Checked for overlap
🤖 Generated with Claude Code
@tupacfan04 on GitHub · 2026-11-29 12:54 UTC · original
Closing: current main (
829188e9) already does this.idle_sweep_policylets the card's rule win over the PC-memory rule whenever the card is pressured, with a test for exactly that case (idle_sweep_policy_keeps_vram_eviction_active_under_host_pressure). My branch was cut frome1f2eb6, before that landed, and now conflicts.The on/off measurements above (card memory staying about 1.3 GB lower on a 12 GB card, with no change in fps) were taken with my own change on the older base, not with main's version, so treat them as supporting the idea rather than as a test of main's code.
🤖 Generated with Claude Code
Pull request closed