gpu: opt-in reaction to shared (NON_LOCAL) memory pressure #103
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/ReTerryDavis--ReVIctory!103
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-102"
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?
@SovietBearz0r on GitHub · 2026-12-05 12:19 UTC · original
SovietBearz0r:razda-segment-tight→main· +75 −1 · 1 files · 1 commits · closed without mergingOpt-in reaction to shared-memory (NON_LOCAL) pressure:
VICTORY_SEGMENT_TIGHT=<percent>(default 92,0disables).Why
When a card's own VRAM is oversubscribed, the driver spills into the shared (NON_LOCAL) aperture. Submissions sent ahead then hold command allocators and intermediate allocations that the title's own allocations need, and the title can fail an allocation or stall under the pressure. We already sample the adapter's shared budget/usage (it is in the F3 VRAM panel), but we only react to commit pressure, not to the shared aperture being nearly full.
What
Host::shared_tight: samples[own budget, own used, shared budget, shared used]at most every 100 ms; tight when shared used is aboveVICTORY_SEGMENT_TIGHTpercent of the shared budget (default 92). Hysteresis: once tight, it must fall belowpct - 10before it says recovered, so a single sample either way cannot flap it. Crossing either way is logged once with the shared MB/budget.send_late:crate::list::trim_idle) and preludes (preludes::trim),late_most(), so the title's next allocations are not held up behind command allocators of work sent ahead.0disables the reaction entirely; unset gives the 92 / 82 hysteresis. On a 16 GB card the line may never be crossed — the target is 8–12 GB cards, where the shared aperture actually gets used.Verification
cargo test -p victory-gpu --lib shared_memory: the hysteresis unit test passes (919/921 at 92%, 829/819 recovery at 82%, zero budget not tight).cargo check -p victory-gpuclean.Source: crossducking/RAZDA4A-ENGINE (
dev@0e4b3782),crates/victory-gpu/src/host.rsshared_tight, used fromsend_late(Wave 14 changelog "16 GB RAM pool protection").@ReTerryDavis on GitHub · 2026-12-05 17:37 UTC · original
Closing this one — although titled opt-in,
VICTORY_SEGMENT_TIGHTactually defaults ON at 92% (host.rs:6393) and hasn't been soaked in-game on a card that spills toNON_LOCAL.More importantly, once shared usage crosses 92% (staying latched down to 82%), calling
self.settle(&mut submitted, WHY_MOST)on everyHost::send_latesubmission forces synchronous GPU drains on every submit and will tank pipelining on 8–12 GB GPUs / 16 GB RAM hosts, alongside polling DXGIvideo_memory()on the hot submit path. (It also strips the UTF-8 BOM fromhost.rs.) If revisited later, it should be strictly off by default and verified with real frame-time data on a spilling GPU.@SovietBearz0r on GitHub · 2026-12-05 18:07 UTC · original
Addendum pushed: README now documents \VICTORY_SEGMENT_TIGHT\ (92% armed, recovered below 82%, sampled every 100 ms, \
@SovietBearz0r on GitHub · 2026-12-05 18:21 UTC · original
Reopened with the review addressed. Branch force-pushed to a single clean commit on current
main(6096c21):VICTORY_SEGMENT_TIGHTarms only when explicitly set to1..=100; unset/0/anything else is off, and when off the function returns before any clock read or DXGIvideo_memory()query (unwrap_or(92)is gone). README says off by default, 92 as the design point, 85 for the 8 GB safe preset,0disables.settleon everysend_late. The reaction is rate-limited while latched tight: at most once per 250 ms and never twice for the same submission; other submissions trim idle lists/preludes (no GPU wait) and pipeline normally. The one-per-crossing log line stays.pct,sample,react).host.rs(no reformat otherwise).victory-gpu --lib719 passed / 0 failed / 21 ignored (+3 new: default-off, hysteresis, rate-limit incl. 10 submissions in one window → 1 settle); clippy-D warningsgreen (default + all-features);cargo xtask policy442 files;cargo test -p xtask9/9.Still the gate you named: no in-game soak on a spilling 8–12 GB card. I cannot run the title here; the request is to A/B frame times unset vs
=92vs=85on such a card and watch the two crossing lines and settle counts. If you would rather keep the code out of tree until someone with that hardware can soak it, that's fair — the branch is ready when that run exists.@SovietBearz0r on GitHub · 2026-12-05 18:27 UTC · original
Review addressed and resubmitted as #161 (I can't reopen this one: GitHub doesn't let the author reopen a PR closed by the maintainer). The new PR is rebased on current main and its body lists point-by-point what changed; closed this thread is fine, please use the new one.
Pull request closed