Skip to content

fix(vk): slow resume and black HUD hearts on 4 GB cards: the texture squeeze waits while VMA's blocks have room - #1506

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
rakefire-impala:fix/slow-resume-black-hearts-texture-squeeze
Nov 10, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
rakefire-impala:fix/slow-resume-black-hearts-texture-squeeze

Conversation

@rakefire-impala

@rakefire-impala rakefire-impala commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

At the driver's VRAM limit, the 97% texture "squeeze" kept shrinking the budget every 10 frames, even while VMA's blocks had plenty of free room. On a 4 GB card a paused game lost 1.7 GB of textures in seconds. This makes the rule wait while the blocks hold room.

A VRAM policy change, as the review of #1023 noted, so it's split out on its own. Tested on a 4 GB card; reports from other low-VRAM cards are welcome. Part of splitting up #1023.

Problem

At the driver's limit, texture_frame's 97% rule set the texture budget below what the textures held, every 10 frames. Evicting a texture frees space inside VMA's blocks, but the driver still counts those blocks. So the count stayed at the limit, the rule fired again, and the budget shrank again: a ratchet.

On an RX 5500M (3337 of 3337 MB used, with 1224 MB free inside the blocks), a paused game, whose scene draws nothing:

  • lost 1700 MB of textures in seconds (2851 → 1137 MB);
  • made them all again on unpausing, a long wait after pause or alt-tab;
  • drew the HUD's GPU-drawn textures as black glyphs (hearts, the minimap's view cone) until an area change, because those were evicted too.

Change

  • The 97% rule waits while the blocks hold an eighth of the allowance free. New images take that space, so the driver's count doesn't grow. The other rule, which judges pressure net of the free block space, still evicts as before.
  • The VRAM log line says (at the driver's limit, room in the blocks: not squeezed) when the rule waits.
  • RX_VK_SQUEEZE_ALWAYS=1 brings the old behaviour back.

How to check

Pause the game for a minute on a low-VRAM card, or alt-tab away, then resume. Textures stay resident and resume is quick. The periodic vk: VRAM: log lines show the "not squeezed" note while the blocks have room.

Risk

The change only applies at the driver's limit with room in the blocks. Cards that never reach the limit behave as before, and the env var restores the old rule anywhere.

Tests

tests/test_texture_squeeze.py (new) checks the rule, its switch and the log line. It fails on main without this change.

Tested on

GPU AMD Radeon RX 5500M (RDNA1, 4 GB VRAM), laptop
Driver AMD Windows driver, Windows 11
Result Pausing and alt-tab no longer drain the textures; hearts and the minimap cone stay drawn (tested on an earlier base; rebased on current main, game-free tests pass)

The 97% rule set the budget below the textures held every 10 frames while
the driver's count was at its limit. Evicting frees space inside VMA's
blocks, which the driver still counts, so the count stayed there and the
budget shrank again: a ratchet. On a 4 GB RX 5500M (3337 of 3337 MB used,
1224 MB free in the blocks) a paused game, whose scene draws nothing, lost
1700 MB of textures in seconds and made them again on unpausing (a long
wait). The HUD's GPU-drawn pieces went too and came back as black glyphs
until an area change.

Now that rule waits while the blocks hold an eighth of the allowance free;
the rule that judges pressure net of that free space still evicts. The
VRAM log line says "not squeezed" then. RX_VK_SQUEEZE_ALWAYS=1: as before.

tests/test_texture_squeeze.py checks the rule, its switch and the log line.
@rakefire-impala
rakefire-impala force-pushed the fix/slow-resume-black-hearts-texture-squeeze branch from 9839a17 to b16fce6 Compare November 10, 2026 11:31
@hckrman101
hckrman101 merged commit 189287f into NotRexed:main Nov 10, 2026
10 checks passed
omgitsgela pushed a commit to omgitsgela/Hookshot-SteamDeck that referenced this pull request Nov 10, 2026
Records the baseline being developed from, the two problems kept separate
(P1 texture-loading lag, P2 rainbow+crash), the exact changes in the build
under test (PR NotRexed#1505 retry/system-memory scratch, PR NotRexed#1506 eviction gate)
with the runtime switch that A/Bs each, what we measure and from which log
lines, success criteria, three falsifiable hypotheses, the operating rules
learned the hard way, and current status.
omgitsgela pushed a commit to omgitsgela/Hookshot-SteamDeck that referenced this pull request Nov 11, 2026
Patched renderer (clang 20) ran 5280 frames then hung at mesh program 1a81
with a driver SIGSEGV; VRAM was 2275/6140 MB with 524 MB free in blocks, so
neither NotRexed#1505 nor NotRexed#1506 ever engaged. The 14:14 prebuilt-renderer log ends at
the same program with the same 16 'not made' views, so this is the baseline's
own hang, not a regression. Records that the prebuilt renderer is clang 23.1.5
while our builds use clang 20.1.8, that the AppImage sysroot has no C++
headers, and that libstdc++-13-dev supplies them for a clang-23 renderer build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant