Kakariko at night on a 4 GB GTX 1650 Ti: textures take twice their budget even as BC3, ~6 fps with black frames, then crash at hookshot.exe+0x87c2d0 #595
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#595
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Note: the "Game problem" template doesn't show in the New issue list (its link opens a blank issue), so I filled in its fields by hand below.
Hookshot version
fast-updates (source 4187feb5). The honest-eta changelog doesn't touch VRAM.
What kind of problem
Low fps or stutter, and a crash
What happened
Kakariko Village at night (outside, and inside the house with the bed) is unplayable on my 4 GB card. The rest of the game runs well (60–120 fps in Kokiri Forest, Hyrule Field and indoor areas).
low-vramrelease, when VRAM reached 4512 MB of 3277 MB allowed.RX_VK_KEEP_RETIRED=0, the Minimum (4GB) preset, 50 % resolution and frame generation Off, it no longer crashes. But it runs at ~6.5 fps with frequent black frames (most of the screen goes black for a moment).Texture compression is active (
all large ASTC textures kept as BC3). Even so, this scene's textures take about twice their budget, VRAM goes ~900 MB over what the driver allows, and the GPU spends 150 ms a frame with 0 shader/pipeline waits. This looks like the driver paging you found in #519 (Goron City, 4 GB RTX 3050), but here it happens with compression already on.RX_VK_KEEP_RETIRED=0, FG OffWith frame generation 2x it was the same: 157 ms GPU time, 6.3 fps.
Expected: Kakariko staying inside the VRAM budget like the rest of the game.
Where in the game
Kakariko Village at night: walking in from Hyrule Field, and inside the house with the bed
How often
Every time
Graphics card and driver version
GTX 1650 Ti Laptop 4 GB, NVIDIA 610.88
CPU, RAM and operating system
i5-10300H, 24 GB, Windows 11 (build 26300), ASUS TUF F15
Changes from the defaults
RX_VK_KEEP_RETIRED=0(environment variable, set in a .bat launcher)Other software hooked into the game
Yes: MSI Afterburner + RTSS overlay. The first crash (on
low-vram) happened before I installed them.hookshot_log.txt
crash = fast-updates with defaults; 6fps = fast-updates with
RX_VK_KEEP_RETIRED=0, frame generation Offhookshot_log_kakariko_crash.txt
hookshot_log_kakariko_6fps.txt
Same failure mode on a Steam Deck OLED (RADV VANGOGH, 14 GB unified, 6037 MB reported allowed), and I think the reason it takes twice the budget is that the eviction age is counted in presents.
In a first-party title's overworld at 4–6 fps:
Then Steam's UI restarted under the game (the OS itself did not reboot). No
Not enough memory, no device lost — the driver was paging, as in #519.texture_sweepevicts what has been unused for 60 presents over budget (RX_VK_EVICT_MIN_UNUSED) and 120 presents under it. That is 1–2 s at 60 fps, but 10–30 s at 4–6 fps, so the set grows far past the budget between sweeps. Counting the age in wall-clock milliseconds instead changes nothing at 60 fps and bounds it on a slow device:Texture::last_ms, set wherelast_frameis set (create,texture_touch,texture_touch_quick)last_msRX_VK_EVICT_MIN_MS(default 1000; sweep 2000; the rendered keep 10 s / 60 s instead of 600/3600 presents)I have the full patch (vk_texture.cpp/.h, ~10 lines of real change) and the before/after logs. I can open a PR against main with it if that is easier to review.
Update on v2.0.0 (same laptop, GTX 1650 Ti 4 GB, preset Minimum, 50%, FG 2x):
The same pattern on an 8 GB card, in case it helps: VRAM goes over what the driver allows while VMA's blocks hold more free space than the overage.
Hookshot version: v2.0.2 (
hookshot v2.0.2 (source 998ef8f9)); the same in v2.0.0 and v2.0.1What kind of problem: Low fps or stutter
Where in the game: Hyrule Castle Town, loaded from the autosave at the town gate
How often: Every run
Graphics card and driver: NVIDIA GeForce RTX 3070 8 GB (the driver allows 7.1-7.2 GB), driver 616.56
CPU, RAM and operating system: Intel Core i5-12600K, 32 GB DDR5-5600, Windows 11 (build 26100)
Changes from the defaults: Insert menu: Resolution 100%, Upscaling Catmull-Rom, Frame generation Off; fullscreen at 2560x1440.
hookshot_env.txt:RX_VK_ASTC_BC_ALL=1, plus the test-run switches listed in my comment on #574.Other software hooked into the game: None
In 8 runs of the same 4-minute route (v2.0.0 to v2.0.2), VRAM was over the allowed in about half of the
vk: VRAM:reports, by 0.6-1.0 GB on average per run. In those same reports, 1.3-1.8 GB on average per run (up to 2.6 GB) was free inside VMA's blocks. From the v2.0.2 run with default settings:Textures peaked at 3.3-4.3 GB while the budget shrank to 0.5-2.8 GB in those reports; up to 2.0-2.2 GB of the textures are images the GPU drew, which are kept on purpose. Lowering the texture budget (
RX_VK_VRAM_MB=2500, v2.0.1) cut the textures' peak to ~3.6 GB, but VRAM stayed over the allowed and fps did not change.Since the free space inside the blocks is about twice the overage, giving it back (defragmentation, or dedicated allocations for the large images) might keep 8 GB cards within the budget without evicting anything more.
The logs are available if you want them.
The runs were scripted and the numbers collected with Claude Code.
Yes — that is exactly the case the wall-clock eviction is for, and it applies cleanly to current
main(b234b43). Happy to have you test it on the 1650 Ti.What it changes (
gpu/vk/vk_texture.cpp,.h, 3 places):Texture::last_ms, set wherelast_frameis set (create,texture_touch,texture_touch_quick);last_msand its age test in milliseconds,RX_VK_EVICT_MIN_MS(default 1000; sweep 2000);At 60 fps the numbers are identical to today (60 presents = 1 s). At 4–6 fps the old rule waits 10–30 s before anything can be evicted, which is how the texture set gets to twice the budget between two sweeps.
On the Deck (RADV VANGOGH, 14 GB unified, 2200 MB budget): before, textures peaked at 4005 MB,
GPU timewent 26 → 69 ms and submissions to 100–183 ms as the driver paged; after, the set stays at the budget and the paging stops. No device lost in ~30 four-minute runs.Patch (git apply, against
b234b43)The same change is on branch
deck/steamdeckof https://github.com/RufflezAU/Hookshot together with the Deck settings, if a branch is easier than a patch. It is independent of the other Deck changes there (build toolchain, configs) — the texture diff is all of it.If you can build with it, the numbers to watch are
textures N MB (budget N MB)(should stop running away) andGPU time/slow submit(should stop climbing as VRAM goes over). Your Kakariko sample at 5046 of 3347 MB is the exact shape this is meant to remove.Tracked in #993, follow there. That issue collects every report of garbled or rainbow textures that get worse over play time, and this one is linked from it with its GPU, version and log details. It is a known issue in v2.0.6 and not fixed yet. The eviction patch posted here is linked from the tracker. If it still happens on v2.0.6 (https://github.com/NotRexed/Hookshot/releases/tag/v2.0.6; Update next to Play in the launcher), please add a comment there with your
hookshot_log.txt.