GPU: scale texture pool spares() by remaining DXGI VRAM headroom (#94) #119
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!119
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-119"
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?
@ESAT586 on GitHub · 2026-11-26 04:40 UTC · original
ESAT586:avatarmanz/pool-headroom-spares→main· +26 −9 · 1 files · 1 commits · openFixes #94.
Problem
pool::spares()used a binary threshold (used < 85% * budget -> SPARE_KEPT = 64blocks = 4 GiB, elseSPARE = 2blocks = 128 MiB). On 8–16 GB GPUs operating below 85 % usage, retaining up to 4 GiB of empty blocks can push VRAM over the DXGI budget and trigger PCIe paging.Change
pool::spares()by half the remaining headroom below 85 % ofbudget, inBLOCK(64 MiB) units, clamped toSPARE..=SPARE_KEPT:SPARE_KEPT(64 blocks = 4 GiB) — unchanged.>= 85 %/keep == false/None/ zero budget:SPARE(2 blocks = 128 MiB) — unchanged.Pool::rested()andRipe::now()already readSPARESdynamically, so excess empty blocks trim automatically andaheadstays bounded.empty_blocks_stay_while_the_card_has_roomunit test to cover 24 GiB, 16 GiB, 8 GiB, tight headroom,>= 85 %,0budget,keep == false, andNone.Verification
cargo test -p victory-gpu --locked -- pool:: --test-threads=1on NVIDIA GeForce RTX 3060 Ti 8 GB: 6 passed, 0 failed.VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --locked -- pool:: --test-threads=1: 6 passed, 0 failed.cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings inpool.rs.cargo xtask policy --staged:asset policy: 1 files ok.github-bot referenced this pull request2026-11-26 06:46:47 +00:00
@avatarmanz on GitHub · 2026-11-26 07:36 UTC · original
Left open: under load the 7900 XTX keeps fewer empty blocks than now (16 instead of 64 at 18 GB used); needs an in-game check first.
@YaBulochka on GitHub · 2026-11-26 09:19 UTC · original
Tested on an 8 GB card under Wine/RADV: the VRAM cap is real, and the tail of the frame time improves.
Setup: Radeon RX 7600 XT 8 GB, RADV (Mesa 27.0.0), Wine 11.22, CachyOS kernel 7.3.5, your
main0ce46d5+ this branch,x86_64-pc-windows-gnu,--features diagnostics, retail 1.0.2.1, Series S, the launcher's profile (VICTORY_RELAY=2,TEXTURE_NO_WAIT=1,JOIN_COPIES=1,CARD_STEPS=2,AMBIENT=0.8,PORT_DESCRIPTORS=1),VICTORY_TEXTURE_BUDGET_MB=4608,VICTORY_CARD_BUFFERS_MB=1024. Adxcompiler.dllfallback forD3DCompileis the only local patch (Wine's compiler refuses the clamp/composer shaders).So on 8 GB the spare pool no longer holds VRAM it cannot afford, and the worst frames get shorter; the median is unchanged in these two samples (different scenes, so treat that as indicative).
Context that may matter for #94: with the texture budget at 4608 MB the title still has ~43,000 textures (16.4 GB) waiting for a host copy, and the card plateaus around 6.5 GB either way. The freed half gigabyte is what let me keep the budget that high without running out; at 85 % it was already tight.
No game files or dumps; numbers only.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.