victory-gpu: reduce held VRAM on small cards #327

Closed
github-bot wants to merge 0 commits from github-bot/gh-327 into main AGit
Owner

@⁠Pr-Leonida on GitHub · 2026-12-01 13:46 UTC · original
Pr-Leonida:prleonida/vram-small-card-opts → main · +22 −14 · 2 files · 67 commits · closed without merging

Three small, independent changes in victory-gpu that release VRAM the layer
holds structurally on cards under ~12 GiB:

  1. pool.rs spares(): the empty texture-block hoard was a fixed SPARE_KEPT
    (4 GiB of 64 MiB blocks), tuned for 12 GiB+ cards. Cap it at a quarter of
    the reported budget so a small card keeps the rest for textures.
  2. resource.rs texture_floor_bytes(): the unconditional host-texture floor
    was budget/4 (2 GiB on an 8 GiB card). Scale it to budget/8.
  3. resource.rs targets_kept(): the render-target reserve was only released
    once targets cleared most/2, unreachable on sub-12 GiB cards, so ~1.7 GiB
    stayed held "for targets that never came". Release it at most/4.

Together these free several GiB of structurally-held VRAM on small cards,
reducing the spill into shared system memory. Tests updated accordingly.

**@⁠Pr-Leonida** on GitHub · 2026-12-01 13:46 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/327) `Pr-Leonida:prleonida/vram-small-card-opts` → `main` · +22 −14 · 2 files · 67 commits · closed without merging Three small, independent changes in victory-gpu that release VRAM the layer holds structurally on cards under ~12 GiB: 1. pool.rs spares(): the empty texture-block hoard was a fixed SPARE_KEPT (4 GiB of 64 MiB blocks), tuned for 12 GiB+ cards. Cap it at a quarter of the reported budget so a small card keeps the rest for textures. 2. resource.rs texture_floor_bytes(): the unconditional host-texture floor was budget/4 (2 GiB on an 8 GiB card). Scale it to budget/8. 3. resource.rs targets_kept(): the render-target reserve was only released once targets cleared most/2, unreachable on sub-12 GiB cards, so ~1.7 GiB stayed held "for targets that never came". Release it at most/4. Together these free several GiB of structurally-held VRAM on small cards, reducing the spill into shared system memory. Tests updated accordingly.
- Cap the empty texture-block hoard at a quarter of the reported budget
  instead of a fixed 4 GiB, so a small card keeps the rest for textures.
- Scale the unconditional host-texture floor from budget/4 to budget/8.
- Release the render-target reserve once targets clear most/4 (was most/2,
  unreachable on sub-12 GiB cards, holding ~1.7 GiB for targets that
  never came).

Frees several GiB of structurally-held VRAM on 8 GiB cards, reducing the
spill into shared system memory.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:49:08 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-12-01 13:50 UTC · original

Ran the pool and resource test groups at 251b7ab on an NVIDIA Blackwell desktop part with 16 GB of VRAM. The PR's target is cards under about 12 GiB, so this is a no-regression check on a larger card, not a test of the new small-card thresholds.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q -p victory-gpu --lib pool -- --test-threads=1
15 passed; 0 failed; 0 ignored; 496 filtered out      (exit 0)

cargo test -q -p victory-gpu --lib resource -- --test-threads=1
21 passed; 0 failed; 0 ignored; 490 filtered out      (exit 0)

Both groups pass here. The description does not name the updated tests, so these counts are the whole pool and resource groups at this head; no small-card budget was simulated.

Not tested: the full workspace suite, an 8 GB or 12 GB card, a retail title, VRAM spill measurements, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-12-01 13:50 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/327#issuecomment-7313253055) Ran the `pool` and `resource` test groups at `251b7ab` on an NVIDIA Blackwell desktop part with 16 GB of VRAM. The PR's target is cards under about 12 GiB, so this is a no-regression check on a larger card, not a test of the new small-card thresholds. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q -p victory-gpu --lib pool -- --test-threads=1 15 passed; 0 failed; 0 ignored; 496 filtered out (exit 0) cargo test -q -p victory-gpu --lib resource -- --test-threads=1 21 passed; 0 failed; 0 ignored; 490 filtered out (exit 0) ``` Both groups pass here. The description does not name the updated tests, so these counts are the whole `pool` and `resource` groups at this head; no small-card budget was simulated. Not tested: the full workspace suite, an 8 GB or 12 GB card, a retail title, VRAM spill measurements, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Author
Owner

@⁠Pr-Leonida on GitHub · 2026-12-01 14:59 UTC · original

Thanks for the no-regression run on the 16 GB card — good to see the full
pool and resource groups pass at the head.

To answer the note on the updated tests, the three are:

  • pool::tests::empty_blocks_stay_while_the_card_has_room — now asserts the
    hoard is capped at a quarter of the budget (a 12 GiB+ card still keeps the
    full SPARE_KEPT; a smaller one caps lower).
  • resource::tests::texture_floor_scales_with_vram_budget — updated for the
    budget/8 floor.
  • resource::tests::room_for_targets_is_given_up_once_they_settle — updated
    for the most/4 release gate (the 3,072 MB case that stayed kept under
    most/2 is now released).

The small-card thresholds are the intended behavior change; the spill
reduction was observed on an 8 GiB card, and I agree a real 8/12 GiB run
plus the full workspace suite are the remaining gaps. Happy to add anything
that helps land it.

**@⁠Pr-Leonida** on GitHub · 2026-12-01 14:59 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/327#issuecomment-7315148777) Thanks for the no-regression run on the 16 GB card — good to see the full pool and resource groups pass at the head. To answer the note on the updated tests, the three are: - pool::tests::empty_blocks_stay_while_the_card_has_room — now asserts the hoard is capped at a quarter of the budget (a 12 GiB+ card still keeps the full SPARE_KEPT; a smaller one caps lower). - resource::tests::texture_floor_scales_with_vram_budget — updated for the budget/8 floor. - resource::tests::room_for_targets_is_given_up_once_they_settle — updated for the most/4 release gate (the 3,072 MB case that stayed kept under most/2 is now released). The small-card thresholds are the intended behavior change; the spill reduction was observed on an 8 GiB card, and I agree a real 8/12 GiB run plus the full workspace suite are the remaining gaps. Happy to add anything that helps land it.
Author
Owner

@⁠Fernando-Laydner on GitHub · 2026-12-01 21:41 UTC · original

One related data point for the targets_kept() change, from an RTX 4050 Laptop with 6 GB VRAM, i7-13620H and 32 GB RAM. On our custom fork we tested a fixed 1,024 MiB render-target reserve in the Series S prologue, DLSS Performance, FG off.

Metric Reference 1,024 MiB reserve
Base FPS 13.02 11.44
Frames over 150 ms 2.3% 4.6%
Median textures waiting 14,518 15,524

This was one run per configuration. Your PR changes the threshold for releasing the reserve; our experiment changed its size. For testing the threshold on 6 GB cards, it would be useful to log when it actually releases memory, then check whether the texture queue drains and whether long frames become less frequent. In our run, nominally making more room for textures coincided with a longer queue.

**@⁠Fernando-Laydner** on GitHub · 2026-12-01 21:41 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/327#issuecomment-7326644772) One related data point for the `targets_kept()` change, from an RTX 4050 Laptop with 6 GB VRAM, i7-13620H and 32 GB RAM. On our custom fork we tested a fixed 1,024 MiB render-target reserve in the Series S prologue, DLSS Performance, FG off. | Metric | Reference | 1,024 MiB reserve | |---|---:|---:| | Base FPS | 13.02 | 11.44 | | Frames over 150 ms | 2.3% | 4.6% | | Median textures waiting | 14,518 | 15,524 | This was one run per configuration. Your PR changes the threshold for releasing the reserve; our experiment changed its size. For testing the threshold on 6 GB cards, it would be useful to log when it actually releases memory, then check whether the texture queue drains and whether long frames become less frequent. In our run, nominally making more room for textures coincided with a longer queue. <!-- foxhound-4050-rt-reserve -->
github-bot closed this pull request 2026-12-02 07:54:40 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.