Keep VRAM texture eviction active when host memory pressure sweep is active #1772
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1772"
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 Luca121 on 2026-11-29T00:01:58Z.
What it changes
Fixes a bug in
let_go_idle()(crates/victory-gpu/src/resource.rs, introduced in91cd117) where host memory pressure completely short-circuits VRAM texture eviction:residency::host_texture_idle_ms()returnsSome(1_000)orSome(5_000)whenever host RAM/commit headroom is belowmin(RAM/4, 16 GiB)— which is almost continuously true on 16 GB and 32 GB PCs running GTA VI.match host_idle { Some(ms) => (ms, u64::MAX), None => ... }bypassedvram_keep_below(...)andvram_idle_ms(...)wheneverhost_idle.is_some(), forcingmost = u64::MAX(never buildingby_age), scanning onlyPART = 8192textures, and skipping every mapped texture (if !unmapped { continue; }) — even though the comment at line 2740 explicitly states that mapped textures should still follow the card's rule.host_idle(1_000 ms) intoslot_evict(memory, idle_ms, IDLE_FRAMES)instead of the card'sidle_ms.idle_sweep_policy(host_idle, card_rule) -> (idle_ms, most, unmapped_only)so that:card_most != u64::MAX || card_idle < 60_000), VRAM eviction stays active (unmapped_only = false) usingcard_rule.host_idleas intended.slot_evictalways receivescard_rule.0rather thanhost_idle.How it was tested
626Balanced &720Quality) and Series X (1440Performance), DLSS 2x Frame Generation.host_texture_idle_ms()stayedSome(...)throughout gameplay, disabling mapped VRAM texture eviction once VRAM crossed the room line and pushing usage to10.6/10.7 GBVRAM +9–10 GBshared spill.8.5–8.9 / 10.8 GBacross extended open-world + driving sessions.cargo testpassed for the crates it touches: yes (cargo test --locked -p victory-gpu --lib -- --test-threads=4— 551 passed, 0 failed, including new unit testidle_sweep_policy_keeps_vram_eviction_active_under_host_pressure).Checked for overlap
match host_idleshort-circuit inlet_go_idle; in particular,#1562's eviction changes inside theNone =>arm are also silently bypassed without this fix).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KyleS98 on 2026-11-29T03:07:51Z.
Tested in game, and it does what it says. I had found the same fault from the other end and was about to send the same change when I found this one, which was here first. So here is the evidence instead.
Where I met it. A report in a fork of this tree (KyleS98/VIctory-Neo#7): RX 6900 XT 16 GB beside 32 GB of RAM, 3.8 GB of commit left when the world loaded.
no room, new textures waitin 169 of the session's 243 five-second lines, from the ninth minute to the end, with 15,000 to 32,000 textures waiting; black walls in the player's clip, and trees that come and go.How it was tried here. RTX 3090 Ti 24 GB (616.92), Ryzen 9 9950X3D, 64 GB, Windows 11 26200. A PC like that does not get into the state on its own, so it was made to:
VICTORY_VRAM_BUDGET_MB=11000for the card, and for the PC's memory a small test switch inresidency::headroom()that caps what it reports (VICTORY_HOST_ROOM_MB=3700). Series S, DLSS off, no frame generation, builder off; a new game through the opening into the prologue's cell, hands off, 300 s, after one run to make the route's shaders. (VICTORY_CACHE_CORES=0 VICTORY_SUBMIT_CORE=0too: the placement of #1093 stalls on this processor, which is another matter.)the texture queue's roomd4b5d517, this pull request's base, with the test switch3246d252) with the test switchNo error line and no device loss in either.
The same on today's
main(568c5e5d), with the change done as two passes (the PC's pass, then the card's own; a flush stays the card's pass alone): no room in 34 of 57 lines before; after, room in 56 of 58 (the other two at the line itself), with 48,134 copies (5,110 MB) let go where 18,359 (2,629 MB) went before. That version is on KyleS98/VIctory-NVIDIA, branchpr/sweep-card-rule(bf4ce318), in case it saves a rebase: this pull request conflicts withmainsince the flush (F7 and F8) went intolet_go_idle. It is not a competing pull request and I will not open one.One difference between the two, for whoever merges. Here, while the card is pressured the unmapped-only pass does not run (the card's rule takes those copies too, once they are idle 1.5 or 5 s), and while it is not, the PC's rule runs alone, so the card's ten-minute rule is not asked meanwhile. With two passes both always run. I saw nothing between them in these runs.
Who else may have it: #1580 (an 8 GB card with 16 GB of RAM, "no room" for good) reads like this state.
VICTORY_HOST_TEXTURE_SWEEP=0on a current build turns the PC's rule off, and would tell.AI-assisted (Claude Code, Claude Fable 5.2).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by chaseb64 on 2026-11-29T03:18:48Z.
I tested #1772 on an RTX 4070 at the cell-window checkpoint using its parent
d4b5d51and its submitted head3246d25. Both diagnostics builds included one log line per texture sweep. Each completed run used an isolated copy of the same save and cache, Series X at 1440p, DLSS Performance, the 80% texture-room setting, and a 120-second stationary interval. Both runs had 2× frame generation selected. Streamline reported it off for every present in both measured intervals. The host and VRAM pressure occurred with the system-reported memory budgets, without the test caps used in the earlier RTX 3090 Ti run.All 93 baseline sweeps used the host-pressure policy. All 101 sweeps on the PR head selected GPU eviction while host pressure was active, releasing 418 texture copies during that interval. Both captures showed the character at the cell window. One startup attempt on each build hit the same null-write crash before the checkpoint and was excluded. The PR's focused policy test passed.
This is one completed run per build at a stationary checkpoint. It measures memory pressure and frame times in that scene. Longer-session growth and texture recreation during movement still need testing. Both builds also predate the upstream change that recognizes Streamline's over-budget return as a recorded upscale.
I used OpenAI Codex to build and instrument both revisions, run the comparison, and write this report.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by amazedturnip on 2026-11-29T05:38:49Z.
Tested on RTX 5070 Ti 16 GB / 32 GB RAM under real host-RAM pressure (pressured=true). Keeping VRAM eviction active alongside host pressure sweeps worked cleanly without hangs or stale texture views.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by eleboucher on 2026-11-29T06:07:53Z.
PC result: RTX 4070 Ti SUPER 16 GB, Ryzen 7 9800X3D, 16 GB RAM (the PC-RAM sweep is on all the time here: "the PC has 400-700 MB free"), Windows 11, native 1440p,
VICTORY_BVH_BUILDER=1 VICTORY_ACTIVATE_RAYS=1 VICTORY_CARD_CPU_HEAP=1 VICTORY_WINDOW_GROW=1, diagnostics build of main568c5e5dplus this PR (merged over a few others; one conflict inlet_go_idlewith a flush branch, resolved by making the flush an arm ofcard_rule), 10-minute runs, medians after 200 s.texture queue's room ... no room, new textures waitVICTORY_SLOT_EVICT=1VICTORY_SLOT_EVICT=1 VICTORY_SAMPLED_MARKS=1 VICTORY_SAMPLED_EVICT=1Without the PR the texture copy passes that "made none for lack of room" grew by about 4000 every 2 minutes; with it, 58 in the whole run. In screen captures of the same scenes, a high-frequency detail measure (Laplacian variance per 128x128 tile) is 1.7x the run without the PR, i.e. the textures that used to wait now arrive. No crash or device loss in these runs. The sampled-eviction combination is clearly worse on this machine.