Repository navigation
[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
Open
tupacfan04 wants to merge 1 commit into
Conversation
…o with the PC's memory tight With under 8 GiB of the PC's memory free (a 32 GB PC, from the first world frame on) every look for idle textures took the PC's rule: only copies whose title memory is unmapped go, and the card's rule was never asked. The card stayed about 1 GB over the texture queue's line and past the system's budget for whole runs (11,062 MB in use of 10,848 MB with ray tracing on). Now a look takes the card's rule when that rule wants bytes gone (VICTORY_SWEEP_CARD_FIRST=0: as before). Log only besides: the system's two memory groups every 5 s beside the queue's room line, and the count of such looks. Frame times UNVERIFIED. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #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+ Shaders: an atomic subtraction on group memory is a compare-exchange loop on NVIDIA (port of Marvisak/VIctory#3619) #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