# Load zone freezes forever: a failed host-memory import is retried on every use (~20k times) #218
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#218
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?
Summary
On a 16 GB PC, entering a certain load zone freezes the game for good (0.0–0.1 fps, never recovers). Each time, the same sequence shows up in the log:
vk: pool 0x7f6a46a000+0x2bf000 not imported. Sinceimport_pool()returns false atvkAllocateMemory, the driver most likely can't pin more pages.pool_lookup()imports the same range again on every later use, at 7–130 ms per attempt, on the Presentation Thread and on the game's worker threads.Measured: 19,712 imports and 435 s of import time in one session, ~40 attempts/s, with one thread at ~90 % for the whole time.
This happens with the default 16 MB chunks and also with
RX_VK_IMPORT_CHUNK_MB=0, so chunk rounding isn't the cause.Suggested fix: keep a list of ranges whose import failed and don't retry them right away (back off, or retry only when free memory changes), and fall back to a slower path for those ranges instead of failing every frame. Logging the
VkResultfromvkAllocateMemorywould also show whether the cause isOUT_OF_HOST_MEMORY,OUT_OF_DEVICE_MEMORYorINVALID_EXTERNAL_HANDLE.Code:
gpu/vk/vk_memory.cppat commit1c7c9c7:pool_lookup()(line 1072), theif (!ok)path (line 1156, which returnsnullptrwith no state kept), andimport_pool()→vkAllocateMemory(line 147).System
0x9b438000frame_pacing=1, no upscaling or frame generation1c7c9c7("Less stutter …, 8 GB mirrors restored"), with the shipped PGO profileEvidence
Run 4: default settings
The failures appear at the load zone (logging stops after 16 lines):
From then on, the same ranges are imported again and again (one log line per 256 imports):
The game process sat at ~109 % of one core, with one thread at 88 %.
Run 5:
RX_VK_IMPORT_CHUNK_MB=0The load got further, then a 213 MB pool failed, and the frame rate fell to 0.1 fps in the new area:
At that point: 1.0 GB free RAM, hookshot working set 5.9 GB, private 24.3 GB.
Run 6: default settings again
Same pattern:
vk: pool 0x7f5f5f5000+0x394000 not imported, then 256 imports in 5 s, and the frame rate fell from 45.7 to 7.5 to 0.1 fps. At that point: 0.4 GB free RAM, hookshot working set 8.1 GB, private 24.3 GB, Memory Compression 2.0 GB, and the next largest other process 0.45 GB.Probably related: recurring ~150 ms descriptor stalls
These appear even when the system isn't under memory pressure. A 64-byte storage buffer bind for compute program
612a27de13e44e79takes 140–176 ms each time, at a new address each time. The pipeline is ready at 0.0 ms:Successful imports take 57–86 ms each (
vk: import 71.5 ms: commit+properties 35.3, buffer 0.0, allocate 36.2), so these stalls look like synchronous imports on first use. The worst first-visit frame broke down like this:slow submit: 1813.1 ms: draw 1676.9 descriptors 1406.9 texture lookups 889.5 uploads 593.9.Not an issue: the pipeline cache works
Same route over three runs, restarting the game in between:
mkw_vk_pipelines.binat startLogs
The logs are attached:
run4_loadzone_log.txt: the freeze with default settingsrun6_loadzone_log.txt: the freeze again with default settingsrun1_log.txt–run3_log.txt: the pipeline cache runsRun 5's log was overwritten; its numbers above were read from the live log.
run1_log.txt
run2_log.txt
run3_log.txt
run4_loadzone_log.txt
run6_loadzone_log.txt
Fixed in #240 , try now.