Repository navigation
8 GB cards: no first uploads past the budget, render targets resident first - #1944
RomanFama592 wants to merge 7 commits into
Conversation
…r it On an 8 GB card (RTX 4060 Ti, budget 6.8 GB) the black-face fix's first-upload admission let the card grow past its budget for good: - texture objects of the title's, whose size the pass does not know, were weighed as one byte and always fit the free ranges: 6.0 to 8.3 GB in use in ten minutes, 34,108 first uploads allowed and 11 refused in five seconds; - past the budget, textures that fit free ranges of the texture blocks refilled what slot eviction had just given back: 125,675 in 18 minutes while the card rose from 7.7 to 9.9 GB. Windows then paged the card: 89 to 234 ms of GPU a frame, 3 to 5 fps, a Streamline budget warning every frame. While DXGI says the card is at or past its budget, neither is admitted now. Under it, and just past it with free ranges to spare, nothing changes. On the same card: no budget warnings in four runs of 8 to 11 minutes, 150 to 780 MB past the budget instead of 2 to 3 GB. The trustno1-coder#1496 test's free-range case is refused now: 2.3 GB past the budget with 16 MiB free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
…nt first Opt-in, off by default. Committed render targets, depth and unordered-access memory on the card get D3D12_RESIDENCY_PRIORITY_HIGH, so past the budget Windows pages textures out before memory every frame writes. A hint only: nothing reads or writes differently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
…settings that help, what is open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
f3f6706 to
6c05445
Compare
Measured on the RTX 4060 Ti 8 GB at the same places, 7 to 9 minutes a run: with every priority normal, the card a few hundred MB past its budget had Windows page render targets out too, 181 ms of GPU a frame and 3.4 fps; with them at high priority, 2.3 ms and 14.9 fps, the picture unchanged. A hint only, and a card under its budget pages nothing. VICTORY_RESIDENCY_PRIORITY=0 gives them normal priority, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
…nd left out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS
|
Tested on the same card you measured on: RTX 4060 Ti 8 GB.
|
|
Thank you for testing on the same card, and for the porting notes, they are useful. It is good to see a second RTX 4060 Ti 8 GB with a different CPU (i5-13400F) land on the same result. The frame generation result is new to me: in my runs frame generation was the first thing to push the card past its budget, so I had left it off. If you don't mind, I'd like to add your numbers, with credit, to the "How it was tested" section. One note: the build you tested still had the residency priority as opt-in ( |
|
Tested on an RTX 4060 Laptop 8 GB (7,188 MB DXGI budget, Ryzen 9 7945HX, 15.7 GB RAM, driver 621.24, Windows 11 build 26300). Built from What this PR fixed for usThe OOM loop is gone. Before it, What is left on our card, and it is not memoryThe runs now stop differently. The last one (Series X, DLSS balanced, So The residency priority A/B did not reproduce for usThis is the part I would most like your reading on. Your table has
The one that gave the expected 0 OOM is also the one that died with Two things that may be worth knowing
/// (`VICTORY_RESIDENCY_PRIORITY=1`; off by default: all of it normal, as
/// before). ... Off by default until runs on such a card have compared it
/// (docs/8gb-cards.md).
fn residency_priority_on() -> bool {
*ON.get_or_init(|| std::env::var_os("VICTORY_RESIDENCY_PRIORITY").is_some_and(|v| v == "1"))
}So anyone reading the PR and expecting the A/B by default will silently get The one-byte case looks like it is still reachable through a path this PR does not see. Our runs still log first-upload admissions while the card is at the line, up to
What we ran, for anyone reproducing
Logs are 3-7 MB each and I can attach any of them or put them in a gist. Log analysis done with an assistant; the runs and the numbers are mine. |
Sure, go ahead - credit is fine. On frame generation: with the first-upload guard in place it works at 72% texture room, One data point that may matter to you: on the official latest main (568c5e5) with the |
On a graphics card of 8 GB the black-face fix's first-upload admission lets the card grow past its DXGI budget for good, and past the budget Windows pages the card's memory: the frame rate then falls with how far over the card is. This keeps first uploads from doing that, keeps render targets resident first when Windows has to page, and documents what helps on these cards. On the test card the game ran at 3–5 fps before either and at 14.9 fps (median) with both. Measured on an RTX 4060 Ti 8 GB, which is still being tested; details in
docs/8gb-cards.md.What it changes
Past the budget, no first uploads that keep the card over it (
resource::first_upload_decision; on by default, acts only while DXGI says the card is at or past its budget). Two cases let the card grow without end:Windows then paged the card: 89–234 ms of GPU a frame, 3–5 fps, and a Streamline budget warning every frame (5,153 times). Now neither case is admitted past the budget. Under it, and just past it with free ranges to spare, nothing changes, so a card with memory to spare never reaches this. The #1496 test's free-range case is refused now (2.3 GB past the budget with 16 MiB free) and the test says so.
The cost: a refused slot shows the neutral texture until there is room, so walking into a new place, floors and walls can stay grey or black until eviction lets go of the old place's textures (about four seconds unsampled).
Render targets stay resident first (
host::prioritise; on by default,VICTORY_RESIDENCY_PRIORITY=0turns it off). Even with the change above the card stays a few hundred MB past its budget, and with every priority normal Windows paged out render targets too, which every frame reads and writes again. Committed render targets, depth and UAV memory on the card now getD3D12_RESIDENCY_PRIORITY_HIGHwhen they are made, so textures go first. A hint only: nothing reads or writes differently, and a card under its budget pages nothing.VICTORY_RESIDENCY_PRIORITY=0VICTORY_CARD_WINDOWS_MB=430instead (tried, left out)docs/8gb-cards.md: why the budget decides the frame rate on these cards (a table of GPU time and fps by how far past the budget the card was), the change and its cost, the residency A/B, title memory windows on the card tried and left out, settings that help (frame generation off, fewer target pixels, what F1 saved overrides, keep the wave-wide fallback on), and what is open. Linked fromdocs/windows-memory.md.How it was tested
cargo test -p victory-gpupassed: yes (591). Clippy: no new findings.Checked for overlap
View::Shadertextures in the first-upload admission, the better fix for the one-byte case; this only refuses them past the budget, so the two fit together, and with First-upload admission: size View::Shader textures and skip non-texture/placed-buffer slots #1771 that half of the rule rarely acts.🤖 Generated with Claude Code
https://claude.ai/code/session_01WiREjB6TQEQ2QzFVNzZKGS