Keep the dynamic VRAM reserve in the idle texture sweep #4339
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4339"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T19:03:40Z.
Follow-up to #4005. Related to #4309.
What it changes
The first-upload path checks the dynamic cap from
VICTORY_TEXTURE_KEEP_FREE_MB. The idle sweep usedsoft_budget().or_else(...), so a configuredVICTORY_TEXTURE_SOFT_MBtook precedence over the dynamic cap. This also applies to the defaultvictory playprofile, which sets the soft budget to 3,000 MiB.Use the lower of the two active caps for the idle sweep. With a 3,000 MiB soft budget and 2,000 MiB left for texture copies after the reserve and other allocations, the sweep now asks for enough idle copies to reach 2,000 MiB. The existing age, descriptor and ownership checks still apply.
VICTORY_TEXTURE_KEEP_FREE_MB=0continues to disable the dynamic cap.How it was tested
cargo test -p victory-gpu --features diagnostics --locked --lib resource::tests:: --quietpassed (66 passed, 2 ignored). The staged asset-policy check passed.Checked for overlap
dynamic_texture_capand both environment switches. This is a follow-up to #4005. #4305 changes when the sweep is run, and #3754 changes how reusable room is counted.Developed with Codex and reviewed with Claude Opus 5.5.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Jesper-Andersson on 2026-11-30T19:44:23Z.
A data point from an 8 GB card, in case it helps size this. This is arithmetic on logged numbers, not a test of the PR.
Setup: RTX 2070 SUPER 8 GB (Turing), driver 621.40, Windows 11, Series S profile with DLSS Performance and FSR 3 frame generation (x2) on. Release build of our fork (v2026.11.30.02 plus opt-in ports, all off unless set), one session. Started through
scripts/play-nvidia.ps1, which doesn't setVICTORY_TEXTURE_SOFT_MB. WithVICTORY_TEXTURE_KEEP_FREE_MB=0the dynamic cap was off too, so the idle sweep (let_go_idle) ran on the card-use rule alone, withVICTORY_SWEEP_CAPPED=1; that rule is not a texture cap.VICTORY_HOST_TEXTURE_SWEEP=0was also set, but that controls a different sweep.From the
memory now:lines of a 26-minute session, I computed whatdynamic_texture_capwould have returned with the default 512 MB reserve: budget − 512 − other card bytes. Other card bytes means card use minus host texture bytes. Four sample lines:(MB.) Across all 699
memory now:lines, leaving out the first one at startup, the computed cap never went below 3,124 MB. That means it stayed above the 3,000 MB soft budget for the whole session. On this card in this scene,min()would pick the soft budget either way. The PR would make a difference here only once other card bytes pass about 3.5 GB, or on smaller cards like the 6 GB one in #4309.Card use was over the budget in about two thirds of the logged lines, by up to roughly 800 MB. If a 3,000 MB soft budget had been set,
min()would have picked it on every line. I can't tell from this log what limited this session.Not tested: this PR's code, frame generation off, other GPUs, other scenes or areas. One 26-minute session.
We can run a matched pair on this card if that's useful: play-nvidia.ps1 with
VICTORY_TEXTURE_SOFT_MB=3000, with and without this PR.Drafted with AI assistance (Claude Code).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.