GPU: align VRAM eviction, PC promotion, and hole packing with VICTORY_ROOM_REAL #276
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!276
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-276"
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?
@leixner on GitHub · 2026-12-01 08:34 UTC · original
leixner:fix/vram-real-eviction-and-promotion→main· +18 −1 · 1 files · 68 commits · closed without mergingSummary
Aligns texture VRAM eviction (
let_go_idle), PC-to-VRAM promotion (back_to_card), and VRAM hole-filling (texture_in_holes) withVICTORY_ROOM_REAL(on by default since 2026-11-29). Addresses the long-session VRAM saturation and PC-memory spill loop reported in #214, #222, #227, and #212.1. Eviction stalled by fragmented pool holes (
crates/victory-gpu/src/resource.rs)room()refuses new VRAM allocations once realused + REAL_MARGIN > budget(VICTORY_ROOM_REAL), even when fragmented free space sits inside 64 MiB texture blocks.let_go_idle()only evaluatedvram_keep_below()against credited usage (used - pool::texture_room() + kept). When 1–4 GiB was fragmented inside texture blocks and real VRAM reached or exceededbudget, credited usage looked comfortably belowroom_line, causinglet_go_idle()to returnKEPT_MS(10 minutes) and stall eviction while VRAM stayed pinned over budget.sweep_budget()solet_go_idle()takes the stricter of credited VRAM pressure and (whenVICTORY_ROOM_REALis enabled) realusedagainstbudget - REAL_MARGIN.2. PC-to-VRAM promotion thrashing (
crates/victory-gpu/src/resource.rs)back_to_card()also evaluated only credited usage, so whenVICTORY_ROOM_REALwas refusing VRAM allocations due to fragmented blocks,back_to_card()kept evicting up to 64 MiB/s ofPC_TEXTURESthat immediately spilled back into PC memory on the next draw.back_room_with_real()to bound promotion by real VRAM headroom (budget - REAL_MARGIN - real_used) whenVICTORY_ROOM_REALis enabled.3. Hole-filling packing & growth-backoff poisoning (
crates/victory-gpu/src/pool.rs)texture_in_holes()(grow = false) places textures into existing block holes, it now packs into the fullest ripe block (pack_fullest = true) so nearly-empty blocks are left to drain back to D3D12 rather than being re-populated by first-fit.allow_grow = falsefrom callingPool::grow()(both on miss and during ripe-ahead replenishment), which previously triggered the 500 msretry_growth_atbackoff onTEXTURES.Verification
cargo test -p victory-gpu --lib resource: 23 passed (including newsweep_budget_evicts_when_real_vram_exceeds_budget_despite_fragmented_blocksandpromotion_room_stops_when_real_vram_at_budget)cargo test -p victory-gpu --lib pool: 16 passed (including newhole_packing_prefers_fullest_block_and_does_not_poison_growth_backoff)cargo xtask policy: 293 files okReal-world test (RTX 3070 8 GB, Ryzen 7 5700X, 32 GB RAM, Windows 11, Series X @ 1440p, DLSS Performance + FSR 3 FG)
out of VRAMwarnings, 0ERRORlines.7,458 / 6,936 MBwith1,234 MBfree inside blocks (VICTORY_ROOM_REALtriggered once),let_go_idle()immediately evicted idle textures (helddropped from2,491 MBto1,594 MB),back_to_card()did not thrash PC textures, and all 9,120 / 9,120 subsequent textures landed in VRAM block holes with 0 new PC-memory spills.@Aniseto on GitHub · 2026-12-01 08:48 UTC · original
Ran the
resourceandpooltest groups at8ea1a40on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.Both counts match the description's groups, including
sweep_budget_evicts_when_real_vram_exceeds_budget_despite_fragmented_blocks,promotion_room_stops_when_real_vram_at_budgetandhole_packing_prefers_fullest_block_and_does_not_poison_growth_backoff. This adapter has 16 GB of VRAM, but the long-session 8 GB spill described in the PR was not reproduced here.Not tested: the full workspace suite, a title run, an 8 GB card, a long session with fragmented texture blocks, AMD adapters, Wine, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@bannnned on GitHub · 2026-12-01 08:55 UTC · original · reviewed
I found two cases where the new memory limits can be spent on copies that do not fit the intent of the pass.
@ -2403,3 +2406,1 @@+ targets_room_kept();crate::host::vram_keep_below(budget, used, room_line(budget))}Some([budget, used, ..]) if keep => sweep_budget(@bannnned on GitHub · 2026-12-01 08:55 UTC · original
[P2] Count only local-memory copies toward the DXGI pressure sweep
When the new real-VRAM check tightens the sweep, the age-sorted candidates can still include PC-heap textures. The loop adds their full
host.bytestobytesand can stop atmostbefore reaching any VRAM-backed copy. If the oldest eligible copies are in PC heaps, the sweep can leave local DXGI usage unchanged and make those textures upload again on their next use. Could we filter or account for candidates by heap placement when applying the local-memory quota?@ -2536,2 +2546,2 @@let used = used.saturating_sub(crate::pool::texture_room()) + crate::shadow::card_room_kept() + targets_room_kept();let room = back_room(room_line(budget), used);let credited = used.saturating_sub(crate::pool::texture_room()) + crate::shadow::card_room_kept() + targets_room_kept();let room = back_room_with_real(room_line(budget), credited, budget, used, room_real());@bannnned on GitHub · 2026-12-01 08:55 UTC · original
[P3] Check the next copy against the remaining promotion allowance
If real headroom clamps this pass to 20 MiB and the first eligible PC copy is 32 MiB, the existing check still lets it go because it compares only the bytes already dropped. The cap can be exceeded by the last selected copy, and a later use may have to recreate it in PC memory. Could we skip candidates larger than the remaining allowance before unstaging them?
@leixner on GitHub · 2026-12-01 08:57 UTC · original
Thanks for the sharp review @bannnned! Addressed both in
1ada65c:Re-verified cargo test -p victory-gpu --lib resource (23 passed) and cargo xtask policy (293 files ok).
@bannnned on GitHub · 2026-12-01 09:37 UTC · original
Manual A/B on an RTX 5070 Ti (16 GiB), Ryzen 7 5700X3D, and 32 GiB RAM. I used Series X at native 2560×1440, frame generation off, and
VICTORY_ROOM_REAL=1. A was297f58a(base) and B was8ea1a40(PR). All four runs exited cleanly and predate the follow-up in1ada65c.Frame timing uses equal-length post-load windows within each pair (180 s at the default budget and 150 s with the cap). One manual pass per build gives mixed frame-time results. The capped run showed a lower VRAM hole miss rate on B.
With the cap, minimum sampled headroom was 440 MiB on A and 429 MiB on B. Four B samples met the new sweep's earlier pressure threshold. The logs do not identify the heap placement of each swept copy, and the sampled headroom stayed above the range where the new promotion cap would reduce the 64 MiB allowance. These runs give gameplay coverage for
8ea1a40. The two review edge cases still need a targeted check on the follow-up.@Aniseto on GitHub · 2026-12-01 09:38 UTC · original
This is a new response on the same thread as my report at
8ea1a40(#276); the head moved to1ada65cf(the bounded-sweep / promotion-room correction), so I am not editing that comment.Ran the
resourceandpooltest groups at1ada65cfon an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.Both groups still pass at the new head, with the same counts as at
8ea1a40. I did not repeat the manual A/B on the card.Not tested: the full workspace suite, a title run, a long session with fragmented texture blocks, an 8 GB card, AMD adapters, Wine, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@readmet3xt-lab on GitHub · 2026-12-01 11:38 UTC · original
Checked: nothing harmful in it, it merges and passes the lint check. Because it changes a run at default settings (or code on the submission path), it is not merged to main directly: it is on the batch being tested for the next release, as one commit with you as its author. Nothing is needed from you now; the result of the run will be posted here.
Pull request closed