victory-gpu: start slot eviction when the card is over its budget #3454
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!3454
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3454"
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?
@Cooperos on GitHub · 2026-11-29 23:30 UTC · original
Cooperos:slot-evict-over-budget-v5→main· +33 −1 · 1 files · 1 commits · closed without mergingWhat it changes
The
slot_evictplan subtracted the free ranges of the placed blocks fromthe card's use whatever the budget said (
resource.rs). Theover_budgetbranch right below it (idle 3 s, cap 768 MB) was therefore dead code: with
enough block space free, the plan weighed the use under its high line while
the card sat past the driver's budget, and never turned on.
This change makes that branch reachable: at or over the budget the plan
weighs the card's use as it is; under the budget the subtraction stands (a
new placement reaches the free ranges without a new block, so evicting
there would only churn). It mirrors the direction
VICTORY_ROOM_REAL(v2026.11.29.05, foxhound 4349ab56) already takes on the placement side of
the same free-in-blocks accounting.
What it does not do
It is not a fix for the
0x80070057crash family:base, card at 7,805/7,148 MB,
VICTORY_SAMPLED_EVICT=0), the pass let go20 copies (4.8 MB, interval sums) - its candidates were
indexed-slot-blocked - and the run still ended on
0x80070057.VICTORY_SAMPLED_EVICT=1on main, the sweep keeps the card underbudget in an 8 GB city bench (@nick0451: 0 % samples over, ~1.2 GB less,
no fps loss), so the trigger rarely engages there.
inconclusive: main crashed with the card under its budget the whole run,
so the differing factor was not this trigger - that crash belongs to the
still-open invalid-command family (#3678 was closed "not the cause").
What it does change: in the state the v2026.11.29.03 run died in (card at
7,261/7,064 with 1,698 MB free in blocks, the plan weighed 5,563 MB against
a 6,004 MB line and read "not evicting" to the end), the plan now turns on.
Whether the pass then finds takeable candidates depends on
VICTORY_SAMPLED_EVICTand on what is evictable at that moment - this PRand that switch are the two halves of one gate.
How it was tested
cargo test -p victory-gpu --lib: 914+ passed + the newslot_plan_used_ignores_block_room_only_when_the_card_is_over_its_budget.cargo build --release --locked -p victory; the diag tree here also carried the copystat/timing fixesthat have since landed in
41adb551).scene 1280x720, DLSS quality, frame generation off; Ryzen 7 5700X,
64 GB, Windows 11 26H2.
interval logger (#3766 fixes it) - the numbers above come from summing
the "slot eviction since the last line" interval lines.
Checked for overlap
#2591 (sweep eviction under host RAM pressure) and #2549 (bounds the sweep,
backs off empty slot_evict passes) are complementary; #2778's analysis
(unmapped_only, slot keyspaces) does not cover this trigger;
VICTORY_ROOM_REAL(v2026.11.29.05) covers the placement side.The plan subtracted the free ranges of the placed blocks from the card's use whatever the budget said. The ranges are committed memory either way: the driver's budget is spent on them, and only letting a texture go - and, in time, its emptied block - gives memory back. With enough block space free, the plan could weigh the use under its high line while the card sat past the driver's budget, and the over_budget idle and cap right below never came into play. On an RTX 3070 Ti 8 GB (Series S, DLSS quality, no frame generation, 2026-11-29) the card sat at 7,261 MB of a 7,064 MB budget with 1,698 MB free in blocks, the plan weighed 5,563 MB against a 6,004 MB line ('not evicting') to the end, and the run ended on 'a host command list did not close (0x80070057)' (#2778). Under the budget the subtraction stands: a new placement reaches the free ranges without a new block, so evicting there would only churn.@nick0451 on GitHub · 2026-11-30 02:30 UTC · original · edited 2026-11-30 08:40 UTC
Test on an emulated 8 GB card. This change isn't reached in this scene, so these runs neither confirm nor rule it out. The numbers on main may still be useful.
Setup
VICTORY_VRAM_BUDGET_MB=6800, i9-14900K, 32 GB (corrected; I first wrote 64 GB) RAM.VICTORY_WINDOW_OFFSCREEN=1), andVICTORY_COMPILE_MEMORY=0because of the #1625 start stall.victory playdefaults, soVICTORY_SLOT_EVICT=1.41adb551) against this PR (a466fcb0), alternating, 2 runs each.In all four runs the slot eviction line reads
since the start: 0 textures (0 MB), and the queue of textures picked by index is empty ("0 slots"). This scene has no slot-picked textures for the pass to let go, so the plan's weighing never matters. The difference between the rows is run-to-run spread (main alone ranged from 44 to 68 %).What this does show, for #191's 8 GB case: main ends 1.0–1.5 GB over its 6,800 MB budget in the city, and nothing there gives the memory back. I'll follow up with
VICTORY_SAMPLED_EVICT=1(the sampled marks are on by default invictory play, the eviction isn't) on the same runs.🤖 Generated with Claude Code
@tyr0nsur on GitHub · 2026-11-30 03:34 UTC · original
Additional 8 GiB data point on v2026.11.29.05. Desktop RTX 4060 (621.14), Ryzen 7 5800X, 31.9 GiB RAM, Windows 11 26H2. Series X at 2560×1440, DLSS Ultra Performance, 2× frame generation with MFG Unlocker, RT off.
This is from the release build before applying this PR. It provides another case to test candidate eligibility once the budget trigger is active. The next comparison is sampled eviction off/on with the same save and route, tracking evicted bytes and how many pool blocks return to the driver.
@nick0451 on GitHub · 2026-11-30 05:53 UTC · original · edited 2026-11-30 08:40 UTC
A correction to my comment above, and a follow-up.
Correction. I wrote that this scene "has no slot-picked textures for the pass to let go". That was wrong: I read the upload queue's "0 slots" line. On main in this scene the sampled-marks line shows 31,924 textures shown by a slot that shaders pick by index, and 26,751 of them (1,969 MB) marked by no shader within the idle time. Slot eviction let go of 0 because
victory playsetsVICTORY_SAMPLED_MARKS=1butVICTORY_SAMPLED_EVICT=0, so marked-idle textures are never released. Not because there was nothing to let go. The conclusion for this PR still stands: it didn't change anything measurable in these runs. My reason for it was wrong.Follow-up, same setup as above: emulated 8 GB card (
VICTORY_VRAM_BUDGET_MB=6800), city save, 20 min per run, v2026.11.29.0541adb551, alternating.VICTORY_SAMPLED_EVICT=1, run 1VICTORY_SAMPLED_EVICT=1, run 2No crashes in any run. RTX 3090 with the budget capped, i9-14900K, 32 GB (corrected; I first wrote 64 GB), Series S, window off screen.
🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-30 06:30:06 +00:00
@tyr0nsur on GitHub · 2026-11-30 06:27 UTC · original
Follow-up on my earlier “zero textures” observation. The periodically reported “since the start” value was reading counters reset by the interval logger, so that line cannot establish how many evictions occurred in a session. In a later RTX 4060 Series S capture with sampled eviction enabled, summing the interval lines gave 175,338 host copies let go, 101,925 made again, and 9,738 made again within two seconds. These counts describe slot churn. The telemetry PR #3766 fixes the cumulative log and adds a measurement for whole heap blocks released by the texture pools.
@Cooperos on GitHub · 2026-11-30 06:35 UTC · original
confirmed on my side: summing the interval lines instead of the
cumulative one gives 194,814 let go / 119,774 made again in a 32-minute
fixed-build prologue run - the same order as your capture. Your telemetry
point stands, and it corrects my own earlier "0 let go" reading twice over.
@Cooperos on GitHub · 2026-11-30 06:44 UTC · original
Updated the description above. In short, per @nick0451's correction and
@tyr0nsur's telemetry finding:
0x80070057crashes. In the oneover-budget run where this trigger engaged, the pass let go 20 copies
(interval sums) - its candidates were indexed-slot-blocked - and the run
still ended in the crash; with
VICTORY_SAMPLED_EVICT=1on main, thesweep already keeps the card under budget in the 8 GB bench;
over_budgetbranch (idle 3 s, cap 768 MB) was unreachable while free block ranges
were subtracted from the card's use; now it is reachable at or over the
budget, mirroring what
VICTORY_ROOM_REALdoes on the placement side;the "since the start" cumulative one cannot be used to judge the pass
(#3766 fixes it).
github-bot referenced this pull request2026-11-30 09:06:05 +00:00
github-bot referenced this pull request2026-11-30 09:34:54 +00:00
@nick0451 on GitHub · 2026-11-30 11:29 UTC · original
Follow-up on
VICTORY_SAMPLED_EVICT=1: the picture check I said I'd do.Setup: same emulated 8 GB card (
VICTORY_VRAM_BUDGET_MB=6800), city street, v2026.11.29.05. 10 min per run, two runs each with and without, alternating. A window shot every minute from minute 3 to minute 9, after the card has filled and eviction is at work.Result:
Not covered: these are stills a minute apart while standing. A texture that reloads in under a second, or pop-in while turning the camera, wouldn't show. In the 20-minute runs above, 61,000–70,000 slots were queued again after being let go, so a check while moving would be the next step.
🤖 Generated with Claude Code
Pull request closed