GPU: release idle placed textures, sooner past 90% of the VRAM budget #2161
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2161
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2161/head"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 06:41 UTC · original
0xkn0wh3r3:gpu/free-idle-placed-textures→main· +360 −16 · 4 files · 1 commits · closed without mergingProblem
Textures the title places in its own memory get a resource and a host texture the first time a view reads one (
texture_at), and are never released: one host texture per address and description ever viewed. On Zettrox/ztrx that was 18,639 of them, 2.5 GB, after nine minutes of Grand Theft Auto VI. Past the card's memory budget the system moved video memory into system RAM, which ended two of its runs.Fix
texture_atnotes each placed texture's last use (time and frame) under the table's lock, so a texture just handed out is never idle.QueryVideoMemoryInfo);VICTORY_TEXTURE_SWEEP=0keeps everything, as before. The host textures log line counts the placed textures released and their bytes.Limit: a thread handed a resource by
texture_atis protected by the idle time alone until its use makes a list or slot hold it. Every caller uses it at once, within the title's call.Idea from Zettrox/ztrx (
let_go_idle). ztrx makes host copies lazily (as #1969 proposes) and releases only the copy; here the whole placed resource goes, which needs no lazy host textures.Testing
cargo test -p victory-gpu --libon an RTX 5070 Ti: all pass except the two tests that already fail onmainfrom the NVIDIA heap cap (#1835).cargo clippy -p victory-gpu --all-targets, with and without--features diagnostics: clean.@Marvisak on GitHub · 2026-11-25 11:26 UTC · original · edited 2026-11-25 15:59 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/host.rs,crates/victory-gpu/src/object.rs,crates/victory-gpu/src/queue.rs,crates/victory-gpu/src/resource.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs-work) was for an older state ofmain.Generated by Claude Code
@Slay326 on GitHub · 2026-11-25 14:13 UTC · original
Hardware test on an RTX 3070 (8 GB), merged with #1962, #1969, #2129, #2180 and #1873 on a local test branch; 480 s into the world of Grand Theft Auto VI.
host_made()instead of thehostfield (two places,unheldandlet_go);texture_atkeepshost().AI-assisted.
@0xkn0wh3r3 on GitHub · 2026-11-25 18:51 UTC · original
Closing: upstream
69d1e8ecovers this. Host textures fed from title memory are given up after 120 s and 300 presented frames unused, and past 90% of the card's budget the least recently used go until usage is back under 85%. Placed textures' host textures are included, and their heap slots are nulled and remade when read. Upstream measured that idle times as short as this PR's gave up textures that were read again within a minute. @Slay326, thanks for the 3070 run. It would be worth repeating it on currentmain.Pull request closed