victory-gpu: require >= 8 GiB dedicated VRAM budget for auto BAR defaults #3791
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3791"
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 superhero-520 on 2026-11-30T07:18:20Z.
Summary
Requires at least 8 GiB of dedicated VRAM budget (
residency::card_has_bar_headroom(local_budget)) before automatically routing submission send buffers (VICTORY_SEND_BAR=1) or host windows (VICTORY_WINDOWS_BAR_MB=4096/3072) into CPU-mapped BAR card memory on 16 GB RAM hosts, matchingshadow::default_window_card_mb()'s existing< 8 GiB -> 0 MiBfloor while preserving the issue #1520 fix on 12+ GiB desktop cards and keeping explicit environment overrides intact.Root Cause
f718ae47and158d3177addedresidency::shared_is_small()and updatedshadow::window_mapped_most()to auto-enableVICTORY_SEND_BAR=1andVICTORY_WINDOWS_BAR_MB=4096/3072whenever host RAM is 16 GB (shared_budget < 10 GiBorsmall_host_ram()), motivated by issue #1520 on a 12 GB desktop RTX 3060 + 16 GB RAM.shadow::default_window_card_mb()explicitly returns0 MiBwhen local VRAM budget is< 8 GiB.~4.6–5.2 GiB, ReBAR enabled, 16 GB RAM):VICTORY_SEND_BAR=1pushed per-frame submission send staging through PCIe BAR, slowingVICTORY_SEND_OWN3×–4× (6–8 ms->22–30 ms/frame), inflating submitting-thread card-copy time 2.5×–9× (10.9–19.1 ms->47.3–102.3 ms/frame), and triggering severe hitching (>500 ms spikes).VICTORY_WINDOWS_BAR_MB=4096placed~100–180 MBof BAR windows into already-overcommitted 6 GiB VRAM (5,427 MBvs5,248 MBin FSR 3 2X) and doubled heap-record sweep time (40.7 msvs18.7 msin FSR 3 2X), hurting 1% Low FPS (0.98vs1.94) while saving little shared RAM.Fix Design (
residency.rs,shadow.rs,host/send.rs)crates/victory-gpu/src/residency.rs:pub(crate) fn card_has_bar_headroom(local_budget: u64) -> bool { local_budget >= 8 * GIB }.shared_is_small()viashared_is_small_for(local_budget, shared_budget, mapped)so cards with< 8 GiBlocal VRAM budget (e.g. 6 GiB and 8 GiB cards with ~5.1–7.1 GiB DXGI budgets) do not auto-enableVICTORY_SEND_BAR=1orVICTORY_WINDOWS_BAR_MB=4096.crates/victory-gpu/src/shadow.rs:default_window_mapped_mb()'s3072 MiBsmall_host_ram()fallback oncard_has_bar_headroom(local_budget).resolve_window_mapped_mb()andwindow_mapped_fits_budget()so explicitVICTORY_WINDOWS_BAR_MBoverrides always win (including0on large cards or non-zero on small cards), while automatic BAR window allocations also respect dynamic mid-run DXGI budget drops below 8 GiB.crates/victory-gpu/src/host/send.rs:on_card_for(env_override, shared_small)so explicitVICTORY_SEND_BAR=0/1overrides are directly unit-tested alongsideshared_is_small().Verification & Interleaved A/B Hardware Results
Unit Tests
cargo test --locked -p victory-gpu --lib residency::tests— PASS (shared_is_small_requires_dedicated_vram_headroomcovers 6 / 8 / exact-8 GiB / 12 / 16 / 24 GiB tiers, unknown budget, unmapped card, and 32 GB host RAM).cargo test --locked -p victory-gpu --lib window_tests— PASS (bar_windows_default_stays_off_on_low_vram_cards_and_respects_overrides_and_budget_dropscovers all GPU tiers, explicit env overrides, invalid env fallback, and dynamic DXGI budget drop).cargo test --locked -p victory-gpu --lib host::send::tests— PASS (send_bar_respects_explicit_override_and_shared_small_default).cargo clippy --locked -p victory-gpu --all-targets,cargo check --profile diag --locked -p victory --features diagnostics,cargo run --locked -p xtask -- policy --staged— all PASS with 0 new warnings.Live Interleaved Single-Variable A/B Results
Hardware: RTX 3060 Laptop 6 GiB (ReBAR ON) + Ryzen 7 5800H + 16 GB RAM, Series S 540p -> 1080p DLSS Perf K, RT OFF, warm pipeline library (
slow_loads_in_world = 0except noted), identical scripted route, with GPU power/clock/temperature and DXGI budget logged per run. All arms below ran on the same binary withRemapQueuebackoff already applied (plus officialv2026.11.29.0541adb551as reference in FSR 3 2X):1. FG OFF — 2 Reversed-Order Interleaved Rounds (canceling thermal/drift bias)
SEND_OWN(ms)SEND_BAR=1, WINDOWS_BAR_MB=4096(upstream default)SEND_BAR=0, WINDOWS_BAR_MB=4096SEND_BAR=0, WINDOWS_BAR_MB=512SEND_BAR=0, WINDOWS_BAR_MB=0(this PR default)*Note:
ab1-bar0-r1experienced a lower WDDM DXGI budget (4,556 MB,+609 MBovercommit) and 1slow load(max 1,145 ms). Across all 6 non-BAR-send runs, disablingVICTORY_SEND_BAR=1cutSEND_OWN~3× and reduced submit time by 35–47 ms/frame; disablingWINDOWS_BAR_MBgave the lowest peak VRAM (5,195 MB) and lowest P99 (603.7 ms).2. FSR 3 2X — Same-Window Interleaved Comparison (steady DXGI budget
4,925–4,942 MB,58–59 °C,~2,011–2,040 MHz)SEND_OWN(ms)v2026.11.29.05(41adb551, BAR auto ON)SEND_BAR=0, WINDOWS_BAR_MB=4096SEND_BAR=0, WINDOWS_BAR_MB=512SEND_BAR=0, WINDOWS_BAR_MB=0(this PR default)fsr_fg_active = true) and audio unaffected.Limitations & Known Risks
< 8 GiBVRAM cards; it does not by itself close the broaderv2026.11.28.03vsv2026.11.29.05texture/render-target VRAM budget gap (~4.0 GBvs~5.2 GB), which is tracked separately.~7.1–7.3 GiBlocal budget, auto BAR defaults will now stay off (users who explicitly want BAR can still setVICTORY_WINDOWS_BAR_MB/VICTORY_SEND_BAR=1).AI Assistance Disclosure
AI-Assisted: Diagnosed, implemented, tested, and benchmarked with AI assistance (Antigravity / Gemini), with all unit tests, clippy/policy checks, and live RTX 3060 interleaved A/B measurements verified locally.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T07:31:53Z.
One edge case on
b7159a1: after auto BAR windows are enabled,window_mapped_forskips the live allocation guard ifhost.video_memory()returnsNone. A failed DXGI sample can therefore admit another auto BAR window without proving it fits. Main already bypasses the check on an unavailable sample. With the new policy, I'd make the automatic path wait for a valid sample and keep the existing explicit-override behavior.Cherry-pickable
31cb51eexercises the same admission logic with a good sample, then no sample, then recovery. The missing-sample assertion failed with the original semantics and passes with the fix. The patch also restores lazy evaluation of the automatic send default whenVICTORY_SEND_BARis set, matching main. Windows results were 22 window, 4 send and 8 residency unit tests passed, plus the staged asset policy check.Anonymized 8 GiB data point for the threshold: two existing
.05runs on RTX 4060 + 32 GB RAM had a DXGI local budget of 6,428–7,189 MiB across 2,168 memory samples, with zero occurrences of the auto-BAR activation message. This is evidence for the budget range only. The patch was unit-tested with Codex assistance and I have no in-game A/B result for it.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-11-30T13:43:38Z.
#3965's RTX 3070 trace pair gives an in-range test case for the new threshold. The two
.05replays reported local DXGI budgets of 7,167–7,249 MiB. I parsed both logs. The median across logged samples with at least 5,000 draws rose from 11.3 to 12.3 FPS when the tester changed only the send default in source. In the 8,000–8,999-draw bucket the median preparation time went from 57.0 to 46.0 ms and FPS from 11.7 to 12.6 (19 and 16 samples). Both logs have zero driver OOM refusal entries. The replays diverge in draw counts, so the measurements describe those two runs.I reapplied
b7159a1and @tyr0nsur's31cb51eto release41adb551, preserving both Git authors in this review branch. I fed the normal send and window configurations synthetic DXGI samples matching the observed budget range, with small shared memory and CPU-mappable card memory.VICTORY_SEND_BAR=0VICTORY_WINDOWS_BAR_MB=4096The same outcomes held at 7,249 MiB for defaults. The review branch turns both auto paths back on at 8,192 MiB and honors explicit send and window overrides below it. Its automatic window allocation also waits for the DXGI sample to recover if it is temporarily unavailable. All 34 send, window and residency unit tests passed, with one existing test ignored. All three outgoing source files passed the staged asset-policy check.
@danielvv88 the measured win in your traces isolates the send change. Could you compare the review branch with
VICTORY_WINDOWS_BAR_MB=4096and with that same setting unset, keeping the other settings and checkpoint matched? Both runs should use the automatic send policy. That compares the window behavior independently on your RTX 3070. Please preserve the original Git authors if taking these commits.Release update. v2026.11.30.01 now ships
1a4c66ca, which makes BAR sends opt-in. The review branch above captures the earlier .29.05 comparison. For a current-release window A/B, keepVICTORY_SEND_BARunset and compareVICTORY_WINDOWS_BAR_MB=4096and=0on stock .30.01. That isolates the windows with the shipped send default. Update in #3965.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by danielvv88 on 2026-11-30T14:04:27Z.
Data point from an 8 GB card that this threshold would catch: RTX 3070 8 GB (DXGI local budget ~7.0 GiB), ReBAR on, 16 GB RAM, Ryzen 5 5600, v2026.11.29.05, same controller tape replayed (VICTORY_INPUT_REPLAY), details in #3965.
So SEND_BAR off agrees with your results, but turning the BAR windows off costs about half the driving frame rate on this card (single run, but a large gap). WINDOWS_BAR_MB 3072 and 2048 were also worse than 4096. Could the window gate use a lower floor (e.g. ~6.5 GiB budget) or stay separate from the SEND_BAR gate?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T11:23:14Z.
I’d keep
VICTORY_SEND_BARandVICTORY_WINDOWS_BAR_MBindependent for now. With BAR sends off on the RTX 3070, the single run with windows disabled gave 6.6 FPS while driving, compared with 12.3 and 14.2 FPS with 4,096 MiB of windows. I’d repeat that comparison on the same route withVICTORY_SEND_BAR=0before choosing a new window threshold.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by danielvv88 on 2026-12-01T12:34:38Z.
Good point, and one correction first: the 6.6 fps row was already with VICTORY_SEND_BAR=0. The three rows were: default (SEND_BAR auto-on, WINDOWS_BAR_MB 4096), SEND_BAR=0 with WINDOWS_BAR_MB 4096, and SEND_BAR=0 with WINDOWS_BAR_MB=0. But it was a single run, on 16 GB RAM.
This PC now has 32 GB, where the automatic default gives 0 MB of windows on an 8 GB card, so the question matters here again. I'm running the windows comparison now (WINDOWS_BAR_MB 0 vs 4096, SEND_BAR off as in the current defaults, same driving route, ~10 minutes each) and will post both runs here with the numbers and logs.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by danielvv88 on 2026-12-01T13:12:54Z.
Repeated on the same PC with 32 GB RAM now (RTX 3070 8 GB, Ryzen 5 5600, Series S, DLSS Performance, own build of v2026.11.30.03 with SUBMIT_SPLIT=0, SEND_BAR off as in the defaults). Same driving route, ~10 minutes each, only VICTORY_WINDOWS_BAR_MB changed. Logs in victory-logs-windows-32gb.zip.
No frame under 6 fps and 0 memory errors in either run. The card's own memory was over its budget in 84 % of the samples with 4096 MB of windows and in 0 % without them (shared 5.7 vs 6.3 GB).
So on 32 GB the windows make no measurable difference, and the automatic default (none on an 8 GB card) is the safer one. The 6.6 fps run on 16 GB was most likely the full RAM, not the windows alone. For 16 GB hosts I would keep the current small-host default (4096); I have no new 16 GB runs to say more.
victory-logs-windows-32gb.zip
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:48:43Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed