Marvel's Wolverine runs out of device memory since #6454: kept descriptor sets keep evicted textures alive #7801
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?
Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-19T08:10:12Z.
Since #6454 was merged (
23629c284), Marvel's Wolverine (PPSA03671) runs out of device memory 30-90 s after launch, before its first frame, and aborts onvkAllocateMemory-2 in memory type 0. The merge just before it (72b0ab3e8, #6312) runs the same scene without trouble.APS5_KEPT_DESCRIPTOR_SETS=0avoids it on #6454 and onmain676d42396.@EagleBearerYS this looks like the kept descriptor sets from
1d66d852d: each kept set's record holds every texture of the resources that freed it, including textures the caches have already evicted.Setup: Windows 11 Pro 26300, RTX 4080 SUPER 16 GB (NVIDIA 617.42), Ryzen 7 5800X3D, 32 GB RAM, WinLibs GCC 15.2.0 r7, Release. Content 01.001.005;
eboot.binand its three modules unwrapped withtools/unwrap_self.pyand converted withrelinker --windows --registry --module-dir .. Each tested commit has #6901 (8cd400aa4) and #6308 (48a1d3453) merged on top: the title needs #6901 to load, and #6308 removes an unrelated abort at 419-620 s. Every run is the same scene, the "Sony Interactive Entertainment presents" card, with no input, a shader cache from earlier runs,APS5_PROFILE_DRAW=1, default budgets and a 120 s limit. Times include 10-40 s of loading.Bisected over the first-parent merges between
f3059421fand676d42396:72b0ab3e8(#6312)23629c284(#6454)23629c284APS5_KEPT_DESCRIPTOR_SETS=023629c284APS5_KEPT_DESCRIPTOR_SETS=123629c284APS5_NO_TABLE_REPLAY=123629c284APS5_NO_TABLE_SNAPSHOT_REUSE=1676d42396(main)676d42396APS5_KEPT_DESCRIPTOR_SETS=0fb0dc118f(mainnow)On #6454 heap 0 fills, allocations move to host memory type 0 (heap 1, system memory on this card) and then fail:
On
72b0ab3e8heap 0 stays near 10 GB with the sampled textures in the cache (uses 10110 MiB, 3459 MiB of it sampled textures (3444 MiB in the cache)), and no cache release is logged.What I think happens, from reading
676d42396(the code is the same onfb0dc118f):ShaderResources::keptTablefills the kept set'sTableDescriptorswithstd::move(textures): every sampled texture of the freed resources, not only the table's. Up to 8 such records stay inDescriptorCache::kept.ReleaseTextureCachescounts an evicted sampled entry as freed only whentexture.use_count() == 1. So the textures these records hold leave the cache but keep their memory ("released 0 MiB ... 969 sampled entries"), and the sampled textures outside the cache (5.3 GB with 2.6 GB in the cache above, 7.7 GB with 2.6 GB in the second run) push heap 0 past its budget.A pull request referencing this issue follows, with the record holding the textures weakly. With it,
676d42396ran two 120 s runs and a 300 s run without the abort, with heap 0 at most 10.6 GB, andfb0dc118fran 180 s with heap 0 at most 10.2 GB.On
fb0dc118fthe first runs spend 35 s and more on each new compute pipeline (0.8-0.9 M SPIR-V words) until the Vulkan pipeline cache holds them, and do not reach the scene in 120 s; thefb0dc118frows are runs after that.Separate from #7766 (the vouched-lookups test on RADV) and from #5961 / #6099 (storage-cache churn on 8 GB cards).
Not checked: Linux, other GPUs, anything past the splash card.
AI-assisted: yes