Cap the default render-target room reserve at 30% of the card budget #413
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/413"
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 TaynanGT/Vice-Tay. Originally posted by safesearch77 on 2026-11-28T13:26:18Z.
resource::targets_room_kept()defaulted to reserving3,072 MiBfor render targets regardless of the adapter's VRAM budget. On high-VRAM cards (>= 10 GiB (10,240 MiB)budgets), that matches observed target pools (2.8–3.1 GB), and the texture queue reclaims the reservation once targets are created.On an 8 GB card running Series S (measured under Proton +
vkd3d-protonon an RTX 4070 Laptop 8 GB with DLSS Quality, DXGI budget5,889 MiB, or4,865 MiBwithVICTORY_VRAM_HEADROOM_MB=1024), alive render targets settle around1,263–1,364 MB(~701–764textures). Subtracting~1.3 GBfrom a flat3,072 MiBconstant leaves~1.7–1.8 GBpermanently added toweighed_usagein bothresource::room()andresource::let_go_idle(), keeping eviction and texture-admission pressure artificially inflated.This caps the unconfigured default at
min(3,072 MiB, budget / 100 * 30):>= 10 GiB(10,240 MiB) keep the full3,072 MiBreserve unchanged.5,889 MiB) reserves up to1,766 MiB(~466 MiBheadroom once1,300 MiBof targets are live, instead of1,772 MiB).VICTORY_VRAM_HEADROOM_MB=1024(4,865 MiBclamped budget), it reserves up to1,459 MiB.VICTORY_CARD_ROOM_FOR_TARGETS_MBoverrides keep their exact prior behavior (0disables, up to8,192 MiB).Trade-off: An 8 GB desktop running 1440p/4K Series X targets (
~7.2 GBbudget) caps at~2.16 GB, below Series X's2.3–3.1 GBrender-target footprint unlessVICTORY_CARD_ROOM_FOR_TARGETS_MBis set; Series S (~1.3 GB) fits comfortably inside the 30% cap.Verification (Linux,
GE-Proton11-14Wine runner,x86_64-pc-windows-msvc)crate::host::host()isNone(no D3D12 host).resource::tests::targets_room_scales_with_vram_budget(1 passed; 0 failed) — coversNone,12 GiB(3,072 MiBcap),5,889 MiB,4,865 MiB,targets >= most(0), and explicit overrides (0,4096, clamping at8192).victory-gpu --lib(Wine):523 passed; 5 failed(default) and589 passed; 6 failed(--features diagnostics), matching untouchedmain(fe7c6e5).cargo +1.98.1 clippy -p victory-gpu --all-targets -- -D warnings: clean, both default and--features diagnostics.cargo +1.98.1 xtask policy:asset policy: 322 files ok.GE-Proton11-14-viewtree, Wayland,vkd3d-proton, Series S, DLSS Quality,VICTORY_VRAM_HEADROOM_MB=1024,VICTORY_POOL_STATS=1):3m 03s):12.7–23.1 fps,0NVKMSerrors, DXGI5,780 / 6,009 MB(4,985 MBclamped), clean shutdown. Standalone, it preserves the existing26-block (1,664 MB) pool footprint while removing the phantom~1.8 GBreserve fromweighed_usage.2m 51s): eliminating the~1.8 GBphantom reserve unblocked normal texture streaming (eliminating the337 MB/4,667-texture dark-world starvation seen with the floor change alone, a follow-up PR that is not inmain→697–717 MB/10,495alive textures lit normally), dropped DXGI usage-349 MB(5,780 -> 5,431 MB), shrank the texture pool26 -> 23blocks (-192 MB), cut evictions60,514 -> 24,808(3,205 -> 716 MB,-78%), and cut remakes8,492 -> 219(582 -> 2 MB,-99.7%), at14.8–20.0 fps(18.3–18.7 fpssteady) and0NVKMSerrors.Prior art and reports from other cards
I found these after opening this PR. The same default already exists in two other VIctory-family forks, both from 2026-11-26, and the credit for the idea is theirs:
55b3635asets the default tomin(3,072 MiB, budget / 5).7,189 MB, Series S targets1,355 MB.1,717 MBmore free, and textures were refused with the card at70 %of its budget.c8607b9fsets the default tomin(3,072 MiB, budget / 4)on budgets of 9 GiB or less.Two Windows forks report the same symptom on smaller cards. These are their reports and I have not reproduced them:
VICTORY_CARD_ROOM_FOR_TARGETS_MB=1024raised textures on the card from1.3to1.9 GB, and the black walls were textured.1,350 MBagainst the3,072 MBreserve.A different design releases the reserve once the targets stop growing: readmet3xt-lab
21b040da,VICTORY_CARD_ROOM_FOR_TARGETS_SETTLE_MS.Which factor to use (a fifth, a quarter or 30 %) is open. On this laptop's
5,889 MiBbudget, a fifth is1,178 MiB. That is below the~1.3 GBthe targets hold, so once they are live the reserve would be used up entirely.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:35:49Z.
Thanks for addressing the fixed reserve on smaller budgets. The cap should be checked on 6/8 GB cards under real pressure, with render-target allocation failures and texture admission tracked separately. I'd avoid claiming a performance improvement without a matched run.
Imported from TaynanGT/Vice-Tay. Originally posted by safesearch77 on 2026-11-29T13:17:38Z.
Follow-up from our 8 GB laptop runs (CachyOS,
GE-Proton11-14, RTX 4070 Laptop 8 GB,VICTORY_VRAM_HEADROOM_MB=1024, Series S), separating render-target allocations from texture admission (these runs were not matched-route FPS benchmarks, so no FPS gain is claimed):host copies the host renders to or writes):r1_warm(738 alive, 1,324 MB),r2(738 alive, 1,326 MB),r4(753 alive, 1,365 MB), andr6(747 alive, 1,329 MB), there were0no host texture/a host texture is not residentwarnings (while213,23,212, and75totalWARNlines were logged across those runs, confirming warning logging was active).shadow.rs):40(3 MB) inr1_warm,64(10 MB) inr4, and96(17 MB) inr6.host copies the title fills/textures picked by index):r4(#413alone) had15,499alive (725 MB),108,229uploaded,2,496waiting, and321texture-queue passes refused for lack of room (more passes refused thanr1_warm's233, so#413alone does not claim an admission improvement).r2(floor yield without#413) vsr6(floor yield paired with#413):r2's3,072 MiBreserve choked title-filled textures down to4,660alive (329 MB,26,859waiting), whereasr6restored admission to10,495alive (697 MB,24,592waiting).bolado-dev/mandy-port@55b3635a(2026-11-26) caps the default reserve atmin(3072 MiB, budget / 5)with Windows 8 GB numbers (7,189 MBbudget,1,355 MBtargets,1,717 MBreserve).Androtim/MiniVI@c8607b9f(2026-11-26) caps the default atbudget / 4on<= 9 GiBadapters (implementation without published 8 GB numbers).didgori-1121/VIctory-Lite(Windows, RTX 2060 Mobile 6 GB) reported thatVICTORY_CARD_ROOM_FOR_TARGETS_MB=1024raised card textures from1.3 GBto1.9 GBand textured previously black walls, while noting settle-based release (readmet3xt-lab@21b040da) never triggers at 720p because targets stay below half of3,072 MiB.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T14:39:04Z.
Thanks for separating target allocation failures from texture admission. The 30% cap is a reasonable candidate for the low-VRAM profile, particularly paired with the floor change. I will not infer FPS gains from unmatched routes, and explicit reserve overrides must remain unchanged.
Imported from TaynanGT/Vice-Tay. Originally posted by safesearch77 on 2026-11-30T10:56:53Z.
One more piece of prior art that I missed in the update above, plus Windows 8 GB numbers that this PR was lacking.
Earlier than this PR: edsuuu/VI-BR-PORT
7e818069(2026-11-27) lets the render-target room follow what the targets actually take once the world has drawn.VICTORY_CARD_ROOM_FOR_TARGETS_MBstill overrides it. Its commit and README report the following on an RTX 4060 Ti 8 GB under Windows (Series S, the title's upscaler at 720p):Later, related work (not prior art):
116f2230(2026-11-29) sets the Series S figure to 1,536 MB, following trustno1-coder/VIctory-NVIDIA#1911.c9c53541(EduardoMFOliveira, 2026-11-28, about 90 minutes after this PR was opened) lowers the settle threshold tomin(most / 4, 1 GiB), so that target footprints of 1,185–1,450 MB on 8 GB cards release the reserve.These are the authors' own numbers, not ours. VI-BR-PORT's were measured on Windows, and ours above under Proton.
Edited 2026-11-30: an earlier version of this comment listed all three commits as coming before this PR, and described all of their numbers as measured on Windows. Only
7e818069is earlier, and I haven't checked which systemc9c53541was measured on.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:08:31Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:18:40Z.
Thanks for the 8 GB runs and for digging up the earlier work. Keeping target allocations and texture admission apart made it easy to follow, and thanks for fixing the dates. The reserve code is different on the new
main(#468), so I'd check there first whether 3 GiB still starves admission on 8 GB cards. If it does, open it fresh againstmainand I'll review.Pull request closed