Keep the dynamic VRAM reserve in the idle texture sweep #4340
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!4340
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@tyr0nsur on GitHub · 2026-11-30 19:03 UTC · original
tyr0nsur:codex/keep-sweep-vram-reserve→main· +23 −2 · 1 files · 1 commits · openFollow-up to #4005. Related to #4310.
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. #4306 changes when the sweep is run, and #3754 changes how reusable room is counted.Developed with Codex and reviewed with Claude Opus 5.5.
@Jesper-Andersson on GitHub · 2026-11-30 19:44 UTC · original
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 #4310.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).
1cba1d7d45to94726a5b86View 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.