8 GB cards: target reserve settles, no black textures from levels on demand, card use past the vkd3d cap #3602

Closed
github-bot wants to merge 2 commits from github-bot/gh-3602 into main AGit
Owner

@⁠ErRusso on GitHub · 2026-11-30 01:36 UTC · original
ErRusso:perf/8gb-memory → main · +212 −7 · 3 files · 2 commits · closed without merging

Three fixes for 8 GB cards, found in logs from an RTX 4060 (8 GB) with 32 GB of RAM under Proton. Not yet play-verified: that PC's normal build crashes with a GPU fault (see below), so a clean run was not possible with or without these changes.

What it changes

1. The render-target reserve is given back once the targets settle.

  • targets_room_kept sizes the reserve by the targets' peak (targets_kept_from_peak: half as much again as the peak).
  • Its 20 s settle rule only ran with VICTORY_CARD_ROOM_FOR_TARGETS_MB set, so on the default path the reserve was held for the whole run: 465 to 535 MB in every run on that PC.
  • The texture queue was refused by about that much: "no room, new textures wait", with 11,000 to 38,000 textures waiting.
  • The settle now applies to the default path too (targets_kept_settled). The reserve comes back when the targets grow by 64 MiB, as with the switch.

2. With levels on demand, a full card shows a blurred texture, not a black one.

  • A held level got tiles only while room() said yes. A texture with no level both held and given reads zeros, so it drew black.
  • One run with VICTORY_LEVELS_ON_DEMAND=auto counted 3,542 uploads that left a held level without memory, and faces and bodies were black.
  • Now the smallest held levels get their tiles regardless: from the packed tail up, at most VICTORY_LEVELS_SMALL_TILES (8 tiles, 512 KiB; 0 restores the old rule).
  • Only victory play keeps levels on demand off (VICTORY_LEVELS_ON_DEMAND=0), so this matters to the auto default and to anyone who turns it on.

3. Card use at its budget is estimated, because vkd3d-proton never reports it past the budget.

  • Under vkd3d-proton, QueryVideoMemoryInfo gave "6491 MB in use of a budget of 6491 MB" for two minutes. In the same time the layer's own texture copies grew from 3.1 to 4.3 GB, because every room test compared against the capped figure.
  • That run ended in an NVIDIA Xid 31 GPU fault.
  • video_memory() now uses use_past_the_cap. Within 32 MiB of the budget, use is taken as the last reading under the budget plus what the layer has made on the card since: host textures, alias and tile heaps, card sides of copies, and free texture blocks.
  • Where the report is higher, it is used as is. That is the Windows case, where usage can read past the budget.

How it was tested

  • Unit tests under Wine (cargo xwin test -p victory-gpu --lib, Windows target), with logged numbers pinned in source:
    • New: without_room_the_smallest_held_levels_still_get_tiles, room_for_targets_by_their_peak_is_given_up_once_they_settle, use_at_the_budget_counts_what_the_layer_made_since.
    • Existing: room_for_targets_*, first_upload_*, settled_targets_* and tiles:: pass (17 passed, 1 ignored as it needs the card).
  • Clippy: no warnings in the lines changed. main itself fails -D warnings on three lints in victory-shader/src/emit/lower{,/analysis}.rs, which this does not touch.
  • In the game, on Linux with Proton Experimental, an RTX 4060 8 GB and 32 GB of RAM (Series S, 1440 output, DLSS Ultra Performance, DLSS frame generation 2x):
    • With fix 1: the log shows "0 MB kept for render targets" once targets settle.
    • With fix 2: uploads that left a held level without memory fell from 3,542 to 384–685 a run.
    • With fix 3: the run before it showed the capped readings described above.
  • Not run on Windows.

Not fixed here: the GPU fault on that PC

That PC's runs end in Xid 31 ... FAULT_PDE ACCESS_TYPE_VIRT_READ at nearly the same GPU address every time (0x5_8d24xxxx), with and without this PR. 13 faults since 2026-11-29, on the unchanged build as well.

The same address in every run points to one resource read after it is freed, or before it is bound. That is being looked at separately.

Separately, the NVIDIA driver logs intermapRegisterDmaMapping: Failed to insert new mapping node with gpu_vaspace.c assertion failures. This happens while the card's use is reported at its budget, which fix 3 is meant to prevent. Most of the faults have no such failure before them, though, so the two are not taken to be the same problem. It matches NVIDIA/open-gpu-kernel-modules#1453.

🤖 Generated with Claude Code

**@⁠ErRusso** on GitHub · 2026-11-30 01:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3602) `ErRusso:perf/8gb-memory` → `main` · +212 −7 · 3 files · 2 commits · closed without merging <!-- Labels: pr-fix --> Three fixes for 8 GB cards, found in logs from an RTX 4060 (8 GB) with 32 GB of RAM under Proton. Not yet play-verified: that PC's normal build crashes with a GPU fault (see below), so a clean run was not possible with or without these changes. ## What it changes **1. The render-target reserve is given back once the targets settle.** - `targets_room_kept` sizes the reserve by the targets' peak (`targets_kept_from_peak`: half as much again as the peak). - Its 20 s settle rule only ran with `VICTORY_CARD_ROOM_FOR_TARGETS_MB` set, so on the default path the reserve was held for the whole run: 465 to 535 MB in every run on that PC. - The texture queue was refused by about that much: "no room, new textures wait", with 11,000 to 38,000 textures waiting. - The settle now applies to the default path too (`targets_kept_settled`). The reserve comes back when the targets grow by 64 MiB, as with the switch. **2. With levels on demand, a full card shows a blurred texture, not a black one.** - A held level got tiles only while `room()` said yes. A texture with no level both held and given reads zeros, so it drew black. - One run with `VICTORY_LEVELS_ON_DEMAND=auto` counted 3,542 uploads that left a held level without memory, and faces and bodies were black. - Now the smallest held levels get their tiles regardless: from the packed tail up, at most `VICTORY_LEVELS_SMALL_TILES` (8 tiles, 512 KiB; 0 restores the old rule). - Only `victory play` keeps levels on demand off (`VICTORY_LEVELS_ON_DEMAND=0`), so this matters to the `auto` default and to anyone who turns it on. **3. Card use at its budget is estimated, because vkd3d-proton never reports it past the budget.** - Under vkd3d-proton, `QueryVideoMemoryInfo` gave "6491 MB in use of a budget of 6491 MB" for two minutes. In the same time the layer's own texture copies grew from 3.1 to 4.3 GB, because every room test compared against the capped figure. - That run ended in an NVIDIA `Xid 31` GPU fault. - `video_memory()` now uses `use_past_the_cap`. Within 32 MiB of the budget, use is taken as the last reading under the budget plus what the layer has made on the card since: host textures, alias and tile heaps, card sides of copies, and free texture blocks. - Where the report is higher, it is used as is. That is the Windows case, where usage can read past the budget. ## How it was tested - **Unit tests** under Wine (`cargo xwin test -p victory-gpu --lib`, Windows target), with logged numbers pinned in source: - New: `without_room_the_smallest_held_levels_still_get_tiles`, `room_for_targets_by_their_peak_is_given_up_once_they_settle`, `use_at_the_budget_counts_what_the_layer_made_since`. - Existing: `room_for_targets_*`, `first_upload_*`, `settled_targets_*` and `tiles::` pass (17 passed, 1 ignored as it needs the card). - **Clippy:** no warnings in the lines changed. `main` itself fails `-D warnings` on three lints in `victory-shader/src/emit/lower{,/analysis}.rs`, which this does not touch. - **In the game**, on Linux with Proton Experimental, an RTX 4060 8 GB and 32 GB of RAM (Series S, 1440 output, DLSS Ultra Performance, DLSS frame generation 2x): - **With fix 1:** the log shows "0 MB kept for render targets" once targets settle. - **With fix 2:** uploads that left a held level without memory fell from 3,542 to 384–685 a run. - **With fix 3:** the run before it showed the capped readings described above. - **Not run on Windows.** ## Not fixed here: the GPU fault on that PC That PC's runs end in `Xid 31 ... FAULT_PDE ACCESS_TYPE_VIRT_READ` at nearly the same GPU address every time (`0x5_8d24xxxx`), with and without this PR. 13 faults since 2026-11-29, on the unchanged build as well. The same address in every run points to one resource read after it is freed, or before it is bound. That is being looked at separately. Separately, the NVIDIA driver logs `intermapRegisterDmaMapping: Failed to insert new mapping node` with `gpu_vaspace.c` assertion failures. This happens while the card's use is reported at its budget, which fix 3 is meant to prevent. Most of the faults have no such failure before them, though, so the two are not taken to be the same problem. It matches NVIDIA/open-gpu-kernel-modules#1453. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On an RTX 4060 (8 GB, Series S, DLSS frame generation at 1440p) the
texture queue stood "no room, new textures wait" for whole runs while
465-535 MB stayed kept for render targets that had stopped growing:
sized by their peak, the reserve was never given up (the settle rule
applied only with VICTORY_CARD_ROOM_FOR_TARGETS_MB set). It now settles
on the default path too, and comes back when the targets grow.

With levels on demand, a held level got tiles only with room, so a
texture with none drew black (3,542 such uploads in one run; faces and
bodies). The smallest held levels now get theirs regardless, up to
VICTORY_LEVELS_SMALL_TILES (8 tiles, 512 KiB): blurred, not black.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under vkd3d-proton the card's memory in use is never reported past the
budget. On an RTX 4060 (8 GB, 2026-11-30) it read 6,491 of 6,491 MB for
two minutes while the layer's texture copies grew from 3.1 to 4.3 GB:
every room test passed, and the run ended in a GPU page fault after the
NVIDIA driver failed to map memory (Xid 31). Within 32 MiB of the budget
the use is now taken as the last one under it plus what the layer made
since (the report where that is more, as on Windows), so the texture
queue, first uploads and card copies stop at the budget again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:37:24 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:50 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3602#issuecomment-7321656346) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
github-bot closed this pull request 2026-12-01 18:58:12 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3602
No description provided.