victory-gpu: over budget, admit a first upload only into a free range that exists now #1544
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!1544
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1544"
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?
@oVolkra on GitHub · 2026-11-28 21:27 UTC · original
oVolkra:fix-1496-first-upload-wholecard→main· +68 −7 · 2 files · 1 commits · merged 2026-11-29 00:24 UTCFixes #1496
What was wrong
first_upload_decisiononly charged the card for the bytes of an upload pastpool::texture_room(). That number isblocks * 64 MiB - HELD, andHELDdrops as soon as a texture is released, while its piece still rests for 2.5 s (REST) before it can be reused. It also adds up free space spread over many small ranges. So a small first upload (4–256 KiB) always "fit" it (new_card_bytes == 0), and the whole-card guard never fired, even far over budget. A texture that then finds no usable range makes the pool create a new 64 MiB block.The issue's T+16 min line shows this state: 17,043 MiB in use against a 14,767 MiB budget, 16 MiB "free" in texture blocks, 71,820 first uploads allowed, 0 refused at the whole card.
Change
pool::texture_widest_free(): the widest free range in the texture blocks right now. Resting pieces are not counted.first_upload_decisiontakes it as an extra input. Whenused >= budget, an upload that does not fit in that range is refused withWholeCard. Under the budget, behaviour is unchanged.room_for_first_uploadonly scans the ranges when the card is at or over budget.The issue suggests refusing every first upload once
used >= budget. This PR doesn't do that, because it would breaka_full_card_with_free_texture_blocks_still_admits_faces: that case had 893 MiB free and faces drawing black, and a placed texture there does not grow the card. With this PR, that case still passes when a free range exists.Testing
an_over_budget_card_refuses_faces_with_no_free_range_for_themreplays the issue's numbers. It fails onmain(Allow) and passes with this change (WholeCard). It still allows the upload when a range of its size is free.cargo test -p victory-gpu --release: 551 passed, 0 failed.cargo clippy -p victory-gpu --release --all-targets: no new warnings.too_many_argumentsonfirst_upload_decisionwas already reported before (8 args, now 9).nvwgf2umx.dllcrash are gone.Not in this PR
first_upload_headroom_fromstill addsfree_blocksto the window cap (item 2 of the issue comment). Each upload is still checked by the fixed guard.draw.rsitems 3 and 4 of the issue comment, and blocks made ahead by the pool while the card is over budget.🤖 Generated with Claude Code
[pr-fix][memory] victory-gpu: over budget, admit a first upload only into a free range that exists nowto victory-gpu: over budget, admit a first upload only into a free range that exists now@oVolkra on GitHub · 2026-11-28 22:02 UTC · original
Title-only update: GitHub would not let me set labels on this PR, so I put pr-fix and memory in the title as the README asks; the label workflow has applied them. No code change.
@oVolkra on GitHub · 2026-11-28 23:50 UTC · original
In-game test of this branch (
a38716d): RTX 3060 12 GB, 16 GB RAM, Windows 11, Series S profile, DLSS Quality, FSR 3 frame generation 2X (DLSS-G isn't supported on this card),VICTORY_TEXTURE_ROOM_PERCENT=80. First run after a full-Preload. The card's budget is 11,332 MB.The new guard fires. Room lines from the log:
Once in-use memory passed the budget, first uploads with no free range were refused at the whole card. On
mainthat counter stayed at 0 in the issue's logs. Peak overshoot here was 161 MB, against 737 MB in the 3060 report on the issue. That's one run in a different scene, not a controlled comparison, so it doesn't prove the overshoot is fixed.It still crashed, for a reason this PR doesn't address.
0x8007000Estarted at 23:46:38 with about 10.9 GB in use, below the budget (first failure:no shared buffer ... size=6291456). About 18,800 followed, thena host command list did not close (0x8007000E)ended the run at 23:47:48. The allocations failed before the guard had anything to do, so the card ran out before DXGI's budget was reached. Other processes' VRAM use (a desktop wallpaper app was running) or frame-generation resources may account for the gap; I haven't checked which.So: the guard now holds the over-budget path shut as intended, but the
0x8007000Ecrash on 12 GB cards with frame generation also happens below the budget, and that needs separate work. I haven't run a comparison withmainon this machine yet.@DoubleD17 on GitHub · 2026-11-28 23:54 UTC · original · edited 2026-11-29 00:49 UTC
A/B test run of this branch against
mainon an RTX 5070 12 GB with DLSS Frame Generation (complements the 3060 test above). Short version: the new guard fires a lot, but in this scenario it does not keep the process under its DXGI budget, and DLSS still stops upscaling at the same point as onmain.Builds
victory.exeSHA-256main923e38cc8c92cd1c42090076382138538f2bb487DBD5D11DC330002C29C0E3AF8D357500A1CCFF2529180AA5A2EF3FD29DBDD7D9caedb55:a38716dmerged onto77df871(docs-only difference from A)C55813ECFC88C5B4452DA473152777BC0C257060FC9D4478B6C2314EE142E01DBoth built with
cargo build --release --locked -p victory.Setup
VICTORY_TEXTURE_ROOM_PERCENT=80, ray-tracing structure builder off,VICTORY_LOG=info. The 65 effectiveVICTORY_*switches on the first log line are identical in both runs.video memory as the system counts itlines.nvidia-smiis adapter-wide and is only used for the free-memory floor.Results (1,060 s each)
mainout of VRAM (39)after DLSS startout of VRAM (39)/Exceeded VRAM budget0x8007000EReading
main.free_blocksstill counted in the cap, a stale memory snapshot indraw.rs, and the pool creating blocks while over budget.slEvaluateFeature: warning: out of VRAM (39)for the rest of the run.0x8007000Estorm or crash like the 3060's, either below or above the budget: one start-up pipeline refusal in each run, nothing more.Limits of this measurement
Related: #1496 (reproduction on
mainwith the same profile).github-bot referenced this pull request2026-11-30 16:51:58 +00:00