AGC: on a Radeon 780M APU (Windows) the 3 GiB host heap is exhausted by heap mirrors and imports while the device-local heap stays half empty #7047

Open
opened 2026-10-17 08:16:40 +00:00 by keravyn-ops · 15 comments
keravyn-ops commented 2026-10-17 08:16:40 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T08:16:40Z.


Hardware / software

  • Lenovo Legion Go, AMD Ryzen Z1 Extreme, Radeon 780M (vendor 0x1002, device 0x15bf), 16 GiB shared (12.7 GiB visible to Windows, 3 GiB UMA frame buffer)
  • AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 26100
  • AnyPS5 main at 8ac10e7a0 (+ #6472, #6646 for the second set of runs), WinLibs GCC 15.2.0 r7
  • Title: SILENT HILL: Townfall (PPSA33286)

Heap layout the driver reports

Memory heap 0 size=6209.6 MiB flags=0x3   (device-local; types 0,4,8,12 — none host-visible)
Memory heap 1 size=3104.8 MiB flags=0x0   (host; types 1,3,5,7,9,11,13,15)
Memory heap 2 size=256.0 MiB  flags=0x3   (BAR)
VK_EXT_memory_budget: heap 0 5899 MiB, heap 1 2949 MiB, heap 2 243 MiB

The host heap is a quarter of the memory, not half: HostImportBudget (#6472) therefore still gives 3104 − 2048 = 1056 MiB, the same as before #6472.

What fills the host heap

With APS5_PROFILE_DRAW=1 (default settings, APS5_ADDRESS_COPY_MAX_MIB=8192), 45 s after start:

[buffers] image mirrors: 1839 ranges (2824.6 MiB, 1838 writable, 1837 heap 2823.0 MiB) ...
[gpu] host import budget: 1056 MiB live of 1056 MiB (APS5_HOST_IMPORT_MIB); 92874 imports (291117 MiB) refused so far
[gpu] sampled texture cache budget ...: device-local heap 0 ... uses 1326 MiB
terminate: AGC graphics: vkAllocateMemory buffer slab: allocation=4194304 memoryType=3 ... Vulkan result -2

Heap mirrors (host-cached, type 3) + imports ≈ 3.9 GiB on a 3.1 GiB heap; the device-local heap (system memory too on this device) holds 1.3 GiB. Raising APS5_HOST_IMPORT_MIB to 2560 only moves the crash (imports 2560 + mirrors 936 MiB).

Experiments on a local branch

  1. Device-local heap mirrors. A non-sparse heap mirror is made device-local when less than half of the host heap's reported budget would be left after it; refreshes copy the changed blocks into host staging and record vkCmdCopyBuffer into the open batch; write-backs read the written ranges through copies recorded before/after the work. Result: the memoryType-3 abort is gone (2.4 GiB of mirrors move to heap 0); the next limit is physical memory (below).
  2. Unwatched imports never return to the write watch. Small/read-only ranges are imported without their watch (entry.unwatched); with the import budget full they retire constantly, and their ranges then stay excluded for good: acquireMirror refuses them and every address-based build copies them — APS5_ADDRESS_COPY_MAX_MIB at its default reports an address-based build copies 443 MiB of 3200 registered ranges ... (0.9 MiB committed, outside the write-watched arena). Restoring the watch when such an import retires (no other unwatched import overlapping) brought "unwatched heaps" from ~29000 to ~500 in the same run length. #6678 adds a GuestMemory::Rewatch for settled small imports; I'll report how #6678 behaves on this device separately on that PR.
  3. Physical memory is the final limit on this device. Townfall takes half of the free direct memory until none is left (6912, 3456, 1728, 864, … MiB). Limiting what sceKernelAvailableDirectMemorySize/sceKernelGetDirectMemorySize report (local APS5_DIRECT_MEMORY_MIB) still boots at 4096 MiB, but the process reaches ~11 GiB private within 60–100 s and free physical memory hits 0 — the host copies (mirrors, textures, storage images) live in the same 16 GiB.

Questions

  • Is placing heap mirrors in device-local memory (staged refreshes) a direction you'd take for APUs whose host heap is small, or would you rather size the host budgets (HostImportBudget, heap mirror budget, the buffer pool's 512 MiB host tier) from VK_EXT_memory_budget?
  • Would a small PR that appends every heap's VK_EXT_memory_budget usage/budget to the vkAllocateMemory failure message be welcome? (Example: ...; heap 0 5327/5899 MiB, heap 1 2586/2949 MiB, heap 2 0/243 MiB: Vulkan result -2 — it is how the above was found.)

Related: #6045 (same device, same 1056 MiB budget), #6472, #6479 (import budget from VK_EXT_memory_budget — would help only if heap mirrors and host buffers are counted against the same 2949 MiB), #6553, #6174, #5987, #4472.

AI-assisted: yes (investigation and the local patches were written with Claude Code; I ran every measurement on the device above).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5896425409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-17T08:16:40Z. --- ### Hardware / software - Lenovo Legion Go, AMD Ryzen Z1 Extreme, Radeon 780M (vendor 0x1002, device 0x15bf), 16 GiB shared (12.7 GiB visible to Windows, 3 GiB UMA frame buffer) - AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 26100 - AnyPS5 `main` at 8ac10e7a0 (+ #6472, #6646 for the second set of runs), WinLibs GCC 15.2.0 r7 - Title: SILENT HILL: Townfall (PPSA33286) ### Heap layout the driver reports ``` Memory heap 0 size=6209.6 MiB flags=0x3 (device-local; types 0,4,8,12 — none host-visible) Memory heap 1 size=3104.8 MiB flags=0x0 (host; types 1,3,5,7,9,11,13,15) Memory heap 2 size=256.0 MiB flags=0x3 (BAR) VK_EXT_memory_budget: heap 0 5899 MiB, heap 1 2949 MiB, heap 2 243 MiB ``` The host heap is a quarter of the memory, not half: `HostImportBudget` (#6472) therefore still gives 3104 − 2048 = **1056 MiB**, the same as before #6472. ### What fills the host heap With `APS5_PROFILE_DRAW=1` (default settings, `APS5_ADDRESS_COPY_MAX_MIB=8192`), 45 s after start: ``` [buffers] image mirrors: 1839 ranges (2824.6 MiB, 1838 writable, 1837 heap 2823.0 MiB) ... [gpu] host import budget: 1056 MiB live of 1056 MiB (APS5_HOST_IMPORT_MIB); 92874 imports (291117 MiB) refused so far [gpu] sampled texture cache budget ...: device-local heap 0 ... uses 1326 MiB terminate: AGC graphics: vkAllocateMemory buffer slab: allocation=4194304 memoryType=3 ... Vulkan result -2 ``` Heap mirrors (host-cached, type 3) + imports ≈ 3.9 GiB on a 3.1 GiB heap; the device-local heap (system memory too on this device) holds 1.3 GiB. Raising `APS5_HOST_IMPORT_MIB` to 2560 only moves the crash (imports 2560 + mirrors 936 MiB). ### Experiments on a local branch 1. **Device-local heap mirrors.** A non-sparse heap mirror is made device-local when less than half of the host heap's reported budget would be left after it; refreshes copy the changed blocks into host staging and record `vkCmdCopyBuffer` into the open batch; write-backs read the written ranges through copies recorded before/after the work. Result: the memoryType-3 abort is gone (2.4 GiB of mirrors move to heap 0); the next limit is physical memory (below). 2. **Unwatched imports never return to the write watch.** Small/read-only ranges are imported without their watch (`entry.unwatched`); with the import budget full they retire constantly, and their ranges then stay excluded for good: `acquireMirror` refuses them and every address-based build copies them — `APS5_ADDRESS_COPY_MAX_MIB` at its default reports `an address-based build copies 443 MiB of 3200 registered ranges ... (0.9 MiB committed, outside the write-watched arena)`. Restoring the watch when such an import retires (no other unwatched import overlapping) brought "unwatched heaps" from ~29000 to ~500 in the same run length. #6678 adds a `GuestMemory::Rewatch` for settled small imports; I'll report how #6678 behaves on this device separately on that PR. 3. **Physical memory is the final limit on this device.** Townfall takes half of the free direct memory until none is left (6912, 3456, 1728, 864, … MiB). Limiting what `sceKernelAvailableDirectMemorySize`/`sceKernelGetDirectMemorySize` report (local `APS5_DIRECT_MEMORY_MIB`) still boots at 4096 MiB, but the process reaches ~11 GiB private within 60–100 s and free physical memory hits 0 — the host copies (mirrors, textures, storage images) live in the same 16 GiB. ### Questions - Is placing heap mirrors in device-local memory (staged refreshes) a direction you'd take for APUs whose host heap is small, or would you rather size the host budgets (`HostImportBudget`, heap mirror budget, the buffer pool's 512 MiB host tier) from `VK_EXT_memory_budget`? - Would a small PR that appends every heap's `VK_EXT_memory_budget` usage/budget to the `vkAllocateMemory` failure message be welcome? (Example: `...; heap 0 5327/5899 MiB, heap 1 2586/2949 MiB, heap 2 0/243 MiB: Vulkan result -2` — it is how the above was found.) Related: #6045 (same device, same 1056 MiB budget), #6472, #6479 (import budget from `VK_EXT_memory_budget` — would help only if heap mirrors and host buffers are counted against the same 2949 MiB), #6553, #6174, #5987, #4472. AI-assisted: yes (investigation and the local patches were written with Claude Code; I ran every measurement on the device above).
MarcZX10 commented 2026-10-17 12:18:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T12:18:09Z.


I opened #7119 for the focused diagnostic you asked about: when AGC buffer allocation fails, it appends per-heap VK_EXT_memory_budget usage/budget if that query is available, without changing allocation or retry policy.

I validated the changed translation units with Linux syntax-only compilation and ran a standalone harness against BufferPool.cpp for the two-heap output and missing-extension fallback. Full CMake/CTest could not run here because the SDL2 submodule has no CMakeLists.txt and no system SDL2 package config is installed; the PR describes this limitation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233789066 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6233789066). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T12:18:09Z. --- I opened [#7119](https://github.com/boykopovar/AnyPS5/pull/7119) for the focused diagnostic you asked about: when AGC buffer allocation fails, it appends per-heap `VK_EXT_memory_budget` usage/budget if that query is available, without changing allocation or retry policy. I validated the changed translation units with Linux syntax-only compilation and ran a standalone harness against `BufferPool.cpp` for the two-heap output and missing-extension fallback. Full CMake/CTest could not run here because the SDL2 submodule has no `CMakeLists.txt` and no system SDL2 package config is installed; the PR describes this limitation.
ultraacademy657-dot commented 2026-10-18 00:33:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ultraacademy657-dot on 2026-10-18T00:33:37Z.


<html> <html><head></head>

Additional reproduction: ASTRO's PLAYROOM (PPSA01325) aborts on Windows/NVIDIA RTX 3080 during a 6544 MiB heap-mirror allocation

This is an additional Windows/NVIDIA reproduction relevant to the host-heap and heap-mirror allocation problem described in #7047. The original report concerns an AMD APU; this reproduction uses a discrete NVIDIA GPU.

Environment

  • Game: ASTRO's PLAYROOM (PPSA01325)

  • OS: Windows 11 Pro, version 25H2, build 26200

  • GPU: NVIDIA GeForce RTX 3080, 10 GB VRAM

  • System RAM: 16 GB

  • Vulkan device ID: 0x2206

  • AnyPS5 repository HEAD when preparing this report: d8f36fd74986030e9997aeae965dd01591d90fd8

  • Build provenance: Local Windows Relinker and libraries. The working-tree cleanliness and exact correspondence between this HEAD and every binary used in the run have not been independently recorded.

Summary

The converted executable starts and reaches shader preparation, rendering and texture allocation. It then aborts when a 6544 MiB guest-memory import is refused and the fallback heap-mirror allocation also fails.

The failure has recurred across multiple testing attempts. This report records one captured reproduction.

Relevant runtime output

[gpu] host import budget: 2000 MiB live of 6063 MiB
(APS5_HOST_IMPORT_MIB); 1 imports (6544 MiB) refused so far

[gpu] sampled texture cache budget 5489 MiB:
device-local heap 0 has a VK_EXT_memory_budget
budget of 9283 MiB and uses 144 MiB

[gpu] driver failure: compute shader 0x500195100:
AGC graphics: heap mirror of 0x108a800000+0x199000000:
vkAllocateMemory buffer:
allocation=6861881344 memoryType=4 reclaimed=4194304
initialResult=-2 attempts=2: Vulkan result -2;
heap mirrors hold 0 MiB of 24576 MiB
(APS5_HEAP_MIRROR_MIB)

[videoout] presentation failed:
compute shader 0x500195100
...
terminate called after throwing an instance of
'std::runtime_error'
FATAL: abort() (SIGABRT) on thread 1988

The failed allocation is 6,861,881,344 bytes (6544 MiB). Vulkan result -2 is VK_ERROR_OUT_OF_DEVICE_MEMORY.

Vulkan memory properties

vulkaninfo.exe completed successfully and reported:

Property Value
Device-local heap 0 size 9.82 GiB
Device-local heap 0 budget 9.07 GiB
Host heap 1 size 7.92 GiB
Host heap 1 budget 7.28 GiB
memoryType=4 Host-visible, coherent and cached; heap 1
maxMemoryAllocationSize 0xffffffffffffffff

These are values from a separate vulkaninfo snapshot, not measurements taken at the precise moment of the crash. The runtime separately reported a device-local heap budget of 9283 MiB and usage of 144 MiB.

The runtime reports 2000 MiB of live imports against a 6063 MiB host-import budget, then refuses a 6544 MiB import. The fallback requests a 6544 MiB heap mirror using memoryType=4, which maps to the host heap, and the allocation fails.

This is consistent with host-heap allocation pressure, but the available evidence does not prove it is the only cause. The reported maxMemoryAllocationSize does not identify a smaller explicit Vulkan allocation limit.

Checks completed

  • Relinker conversion completed successfully and produced eboot.exe.

  • Two guest modules were converted.

  • Import audit: 3178 references, 2466 unique imports, zero absent imports, seven stub imports and 1549 module imports.

  • Required Windows .prx libraries and MinGW runtime DLLs were present.

  • The executable reached the graphics path before the failure.

  • vulkaninfo.exe exited successfully and identified the RTX 3080.

Questions for maintainers

  1. Is this the same underlying allocation issue as #7047, or does the NVIDIA host-heap layout indicate a separate failure mode?

  2. Could the runtime use a device-local heap-mirror path with staged refresh/write-back, or another fallback that considers the available heap budgets, when a large host-heap allocation fails?

  3. Could allocation-failure diagnostics report per-heap memory usage and budget at the time of failure, as discussed in #7047 and PR #7119?

Artifacts available

  • PPSA01325-first-run.log — full runtime output from the failed launch.

  • PPSA01325-vulkaninfo-full.txt — Vulkan device, memory-type and heap information.

  • PPSA01325-import-audit.txt — import audit results.

The immediate failure is reproducible at the graphics memory-allocation stage. The exact allocation-policy change needed remains to be determined.

AI-assisted report; conversion, preflight checks and runtime behavior were tested locally.

</html> </html>

PPSA01325-report-logs.zip

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243770100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6243770100). Originally posted by [ultraacademy657-dot](https://github.com/ultraacademy657-dot) on 2026-10-18T00:33:37Z. --- <html> <body> <!--StartFragment--><html><head></head><body><h2><span>Additional reproduction: ASTRO's PLAYROOM (PPSA01325) aborts on Windows/NVIDIA RTX 3080 during a 6544 MiB heap-mirror allocation</span></h2><p><span>This is an additional Windows/NVIDIA reproduction relevant to the host-heap and heap-mirror allocation problem described in #7047. The original report concerns an AMD APU; this reproduction uses a discrete NVIDIA GPU.</span></p><h3><span>Environment</span></h3><ul><li><p><strong><span>Game:</span></strong><span> ASTRO's PLAYROOM (PPSA01325)</span></p></li><li><p><strong><span>OS:</span></strong><span> Windows 11 Pro, version 25H2, build 26200</span></p></li><li><p><strong><span>GPU:</span></strong><span> NVIDIA GeForce RTX 3080, 10 GB VRAM</span></p></li><li><p><strong><span>System RAM:</span></strong><span> 16 GB</span></p></li><li><p><strong><span>Vulkan device ID:</span></strong><span> </span><code><span>0x2206</span></code></p></li><li><p><strong><span>AnyPS5 repository HEAD when preparing this report:</span></strong><span> </span><code><span>d8f36fd74986030e9997aeae965dd01591d90fd8</span></code></p></li><li><p><strong><span>Build provenance:</span></strong><span> Local Windows Relinker and libraries. The working-tree cleanliness and exact correspondence between this HEAD and every binary used in the run have not been independently recorded.</span></p></li></ul><h3><span>Summary</span></h3><p><span>The converted executable starts and reaches shader preparation, rendering and texture allocation. It then aborts when a 6544 MiB guest-memory import is refused and the fallback heap-mirror allocation also fails.</span></p><p><span>The failure has recurred across multiple testing attempts. This report records one captured reproduction.</span></p><h3><span>Relevant runtime output</span></h3><pre><code><span>[gpu] host import budget: 2000 MiB live of 6063 MiB (APS5_HOST_IMPORT_MIB); 1 imports (6544 MiB) refused so far [gpu] sampled texture cache budget 5489 MiB: device-local heap 0 has a VK_EXT_memory_budget budget of 9283 MiB and uses 144 MiB [gpu] driver failure: compute shader 0x500195100: AGC graphics: heap mirror of 0x108a800000+0x199000000: vkAllocateMemory buffer: allocation=6861881344 memoryType=4 reclaimed=4194304 initialResult=-2 attempts=2: Vulkan result -2; heap mirrors hold 0 MiB of 24576 MiB (APS5_HEAP_MIRROR_MIB) [videoout] presentation failed: compute shader 0x500195100 ... terminate called after throwing an instance of 'std::runtime_error' FATAL: abort() (SIGABRT) on thread 1988</span></code></pre><p><span>The failed allocation is </span><strong><span>6,861,881,344 bytes (6544 MiB)</span></strong><span>. Vulkan result </span><code><span>-2</span></code><span> is </span><code><span>VK_ERROR_OUT_OF_DEVICE_MEMORY</span></code><span>.</span></p><h3><span>Vulkan memory properties</span></h3><p><code><span>vulkaninfo.exe</span></code><span> completed successfully and reported:</span></p> Property | Value -- | -- Device-local heap 0 size | 9.82 GiB Device-local heap 0 budget | 9.07 GiB Host heap 1 size | 7.92 GiB Host heap 1 budget | 7.28 GiB memoryType=4 | Host-visible, coherent and cached; heap 1 maxMemoryAllocationSize | 0xffffffffffffffff <p><span>These are values from a separate </span><code><span>vulkaninfo</span></code><span> snapshot, not measurements taken at the precise moment of the crash. The runtime separately reported a device-local heap budget of 9283 MiB and usage of 144 MiB.</span></p><p><span>The runtime reports 2000 MiB of live imports against a 6063 MiB host-import budget, then refuses a 6544 MiB import. The fallback requests a 6544 MiB heap mirror using </span><code><span>memoryType=4</span></code><span>, which maps to the host heap, and the allocation fails.</span></p><p><span>This is consistent with host-heap allocation pressure, but the available evidence does not prove it is the only cause. The reported </span><code><span>maxMemoryAllocationSize</span></code><span> does not identify a smaller explicit Vulkan allocation limit.</span></p><h3><span>Checks completed</span></h3><ul><li><p><span>Relinker conversion completed successfully and produced </span><code><span>eboot.exe</span></code><span>.</span></p></li><li><p><span>Two guest modules were converted.</span></p></li><li><p><span>Import audit: 3178 references, 2466 unique imports, zero absent imports, seven stub imports and 1549 module imports.</span></p></li><li><p><span>Required Windows </span><code><span>.prx</span></code><span> libraries and MinGW runtime DLLs were present.</span></p></li><li><p><span>The executable reached the graphics path before the failure.</span></p></li><li><p><code><span>vulkaninfo.exe</span></code><span> exited successfully and identified the RTX 3080.</span></p></li></ul><h3><span>Questions for maintainers</span></h3><ol start="1"><li><p><span>Is this the same underlying allocation issue as #7047, or does the NVIDIA host-heap layout indicate a separate failure mode?</span></p></li><li><p><span>Could the runtime use a device-local heap-mirror path with staged refresh/write-back, or another fallback that considers the available heap budgets, when a large host-heap allocation fails?</span></p></li><li><p><span>Could allocation-failure diagnostics report per-heap memory usage and budget at the time of failure, as discussed in #7047 and PR #7119?</span></p></li></ol><h3><span>Artifacts available</span></h3><ul><li><p><code><span>PPSA01325-first-run.log</span></code><span> — full runtime output from the failed launch.</span></p></li><li><p><code><span>PPSA01325-vulkaninfo-full.txt</span></code><span> — Vulkan device, memory-type and heap information.</span></p></li><li><p><code><span>PPSA01325-import-audit.txt</span></code><span> — import audit results.</span></p></li></ul><p><span>The immediate failure is reproducible at the graphics memory-allocation stage. The exact allocation-policy change needed remains to be determined.</span></p><p><span>AI-assisted report; conversion, preflight checks and runtime behavior were tested locally.</span></p></body></html><!--EndFragment--> </body> </html> [PPSA01325-report-logs.zip](https://github.com/user-attachments/files/33614207/PPSA01325-report-logs.zip)
MarcZX10 commented 2026-10-18 00:41:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T00:41:39Z.


Thanks, this adds a useful discrete-GPU reproduction. It looks consistent with the same broad host-heap pressure path: the refused import is followed by a 6544 MiB mirror request on host heap 1 (memoryType 4). The separate vulkaninfo snapshot and the runtime import counters do not give heap 1 usage at the exact allocation failure, though, so they do not yet establish how much headroom remained or whether the APU and RTX 3080 failures need the same policy change. #7119 adds per-heap usage/budget to the allocation failure diagnostic; once available, a run with that diagnostic and an exact binary commit would help distinguish the cases.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243837320 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6243837320). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T00:41:39Z. --- Thanks, this adds a useful discrete-GPU reproduction. It looks consistent with the same broad host-heap pressure path: the refused import is followed by a 6544 MiB mirror request on host heap 1 (memoryType 4). The separate `vulkaninfo` snapshot and the runtime import counters do not give heap 1 usage at the exact allocation failure, though, so they do not yet establish how much headroom remained or whether the APU and RTX 3080 failures need the same policy change. #7119 adds per-heap usage/budget to the allocation failure diagnostic; once available, a run with that diagnostic and an exact binary commit would help distinguish the cases.
fma-rc commented 2026-10-18 03:56:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-18T03:56:51Z.


Same pattern on Linux with RADV: Astro's Playroom (PPSA01325) on a Radeon 680M iGPU (Mesa 26.2.4, 16.17 GB GTT), main 1e2d9b369b. Both runs stop in cpuplaza_mini_04 with AGC graphics: vkQueueSubmit recorder: Vulkan result -4 and the kernel's Not enough memory for command submission. With the default budget the 6544 MiB import at 0x108a800000+0x199000000 is refused and a 6544 MiB host-visible buffer appears instead; with a large budget the same memory is imported. Sizes are the app's buffers from amdgpu_gem_info, 30 s before the stop:

APS5_HOST_IMPORT_MIB stop imports large host-visible buffers other total
default (3432 MiB) 360 s 3072 MiB 10126 MiB (6544, 2216, 1366) 2748 MiB 15946 MiB
16384 299 s 12352 MiB 0 2547 MiB 14899 MiB

The three buffers are heap mirrors: a rerun with APS5_PROFILE_DRAW=1 on the same build reports [buffers] image mirrors: 4 ranges (10126.2 MiB, 3 writable, 3 heap 10126.0 MiB) before the same stop at 357 s. So the budget only moves this title's memory between imports and heap mirrors here. #6479 at 287dd14bf8 stopped the same way at 342 s.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245408484 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6245408484). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-18T03:56:51Z. --- Same pattern on Linux with RADV: Astro's Playroom (PPSA01325) on a Radeon 680M iGPU (Mesa 26.2.4, 16.17 GB GTT), main 1e2d9b369b. Both runs stop in `cpuplaza_mini_04` with `AGC graphics: vkQueueSubmit recorder: Vulkan result -4` and the kernel's `Not enough memory for command submission`. With the default budget the 6544 MiB import at 0x108a800000+0x199000000 is refused and a 6544 MiB host-visible buffer appears instead; with a large budget the same memory is imported. Sizes are the app's buffers from `amdgpu_gem_info`, 30 s before the stop: | `APS5_HOST_IMPORT_MIB` | stop | imports | large host-visible buffers | other | total | |---|---|---|---|---|---| | default (3432 MiB) | 360 s | 3072 MiB | 10126 MiB (6544, 2216, 1366) | 2748 MiB | 15946 MiB | | 16384 | 299 s | 12352 MiB | 0 | 2547 MiB | 14899 MiB | The three buffers are heap mirrors: a rerun with `APS5_PROFILE_DRAW=1` on the same build reports `[buffers] image mirrors: 4 ranges (10126.2 MiB, 3 writable, 3 heap 10126.0 MiB)` before the same stop at 357 s. So the budget only moves this title's memory between imports and heap mirrors here. #6479 at 287dd14bf8 stopped the same way at 342 s.
MarcZX10 commented 2026-10-18 04:33:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:33:05Z.


Thanks for the paired runs. The budget change moves roughly 9.3 GiB from heap mirrors to imports, while total reported memory falls by only about 1 GiB; both runs still fail. That points to aggregate host-memory pressure, but the current data does not identify a safe allocation-policy change. #7119 already has a pending diagnostics change for per-heap budgets on allocation failure. Could you capture, on the same failing build, each Vulkan heap’s usage/budget plus system available RAM and the import, mirror, buffer-pool and guest-backing totals immediately before failure? That would show whether there is a correctable accounting/selection issue or simply no remaining backing memory.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245686230 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6245686230). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T04:33:05Z. --- Thanks for the paired runs. The budget change moves roughly 9.3 GiB from heap mirrors to imports, while total reported memory falls by only about 1 GiB; both runs still fail. That points to aggregate host-memory pressure, but the current data does not identify a safe allocation-policy change. #7119 already has a pending diagnostics change for per-heap budgets on allocation failure. Could you capture, on the same failing build, each Vulkan heap’s usage/budget plus system available RAM and the import, mirror, buffer-pool and guest-backing totals immediately before failure? That would show whether there is a correctable accounting/selection issue or simply no remaining backing memory.
fma-rc commented 2026-10-18 05:56:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-18T05:56:32Z.


Here is the state before the stop on the same build (main 1e2d9b369b plus a 5 s sampler thread, no behaviour change), Playroom on the 680M at the default 3432 MiB import budget. It stopped at 318.6 s with the same vkQueueSubmit recorder: Vulkan result -4; that is a submit failure, so a vkAllocateMemory report would not print. Values in MiB, budget/usage from VK_EXT_memory_budget:

t heap0 host (5480) heap1 device-local (10961) MemAvailable imports heap mirrors registered GPU ranges
205 s 5329/4976 10961/10694 11925 2960 (15) 10126 12318
240 s 5297/5133 10961/10944 11597 2960 (15) 10126 12318
265 s (last sample) 5327/4974 10961/10921 10656 2960 (15) 10126 12318

Host RAM is not the limit; heap1 sits at its budget for the whole last minute. The title's resident shared memory is about 1.5 GiB, and a census run found 468 of the mirrored 10126 MiB resident when the mirrors were made, so most of the mirrors copy pages the guest never wrote. I don't have a reliable buffer-pool total.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246313136 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6246313136). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-18T05:56:32Z. --- Here is the state before the stop on the same build (main 1e2d9b369b plus a 5 s sampler thread, no behaviour change), Playroom on the 680M at the default 3432 MiB import budget. It stopped at 318.6 s with the same `vkQueueSubmit recorder: Vulkan result -4`; that is a submit failure, so a vkAllocateMemory report would not print. Values in MiB, budget/usage from `VK_EXT_memory_budget`: | t | heap0 host (5480) | heap1 device-local (10961) | MemAvailable | imports | heap mirrors | registered GPU ranges | |---|---|---|---|---|---|---| | 205 s | 5329/4976 | 10961/10694 | 11925 | 2960 (15) | 10126 | 12318 | | 240 s | 5297/5133 | 10961/10944 | 11597 | 2960 (15) | 10126 | 12318 | | 265 s (last sample) | 5327/4974 | 10961/10921 | 10656 | 2960 (15) | 10126 | 12318 | Host RAM is not the limit; heap1 sits at its budget for the whole last minute. The title's resident shared memory is about 1.5 GiB, and a census run found 468 of the mirrored 10126 MiB resident when the mirrors were made, so most of the mirrors copy pages the guest never wrote. I don't have a reliable buffer-pool total.
MarcZX10 commented 2026-10-18 21:47:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T21:47:18Z.


Follow-up: I opened #7647 for sparse, aliased heap mirrors that allocate device memory only for blocks containing nonzero guest bytes, with copy-in/write-back for changed blocks. On a Radeon 680M Linux run, it reduced mirror device memory from 10126 MiB to 5125 MiB and avoided the prior 359 s device-loss failure in 12/12 runs. This supports the mirror-overcommit direction, but it does not validate the 780M Windows reproduction or claim to solve the separate physical-memory limit you measured.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255547184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6255547184). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T21:47:18Z. --- Follow-up: I opened [#7647](https://github.com/boykopovar/AnyPS5/pull/7647) for sparse, aliased heap mirrors that allocate device memory only for blocks containing nonzero guest bytes, with copy-in/write-back for changed blocks. On a Radeon 680M Linux run, it reduced mirror device memory from 10126 MiB to 5125 MiB and avoided the prior 359 s device-loss failure in 12/12 runs. This supports the mirror-overcommit direction, but it does not validate the 780M Windows reproduction or claim to solve the separate physical-memory limit you measured.
keravyn-ops commented 2026-10-20 19:09:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-20T19:09:27Z.


Follow-up on the 780M with v0.1.3 and #7647: on this APU the default host import budget costs Townfall about a factor of ten in frame rate, and raising it runs into the heap-mirror/commit problem this issue is about.

Setup

  • Ryzen Z1 Extreme / Radeon 780M, 16 GiB shared (12.7 GiB visible), Windows 11 26100, AMD driver 32.0.23044.19; system-managed page file (commit limit 31.4 GiB, grows to ~39 GiB)
  • SILENT HILL: Townfall (PPSA33286). Disclosure: the eboot's PS5.DefaultBackBufferWidth/Height defaults are patched from 3840x2160 to 1280x720; -nothreadtimeout in uecommandline.txt
  • APS5_PROFILE_DRAW=1, APS5_ADDRESS_COPY_MAX_MIB=8192, warm shader cache, no input, process memory sampled every 5 s
  • v0.1.3 release (3fd1cc393b85) and #7647 at ed8f15bc1

Default budget: the frame is spent copying buffers

With the default (hostHeap 3104 MiB - reserve max(2048, heap/2) = 1056 MiB), 360 s at ~1.0 FPS:

[gpu] host import budget: 1056 MiB live of 1056 MiB (the default; host heap 1 reports a budget of 2949 MiB and a usage of 2946 MiB); 12681700 imports (55604210 MiB) refused so far
[buffers] 10325000 completed CPU-copy operations: logical spans 743538 MiB, ... 10324998 outside imports (743538 MiB)

About 99 % of the [guestmem] read samples come from GuestBufferMemory::copyRegion (read site buffer-upload, 10.08 M of 10.24 M), i.e. ~0.7 TiB of guest reads in 6 minutes.

APS5_HOST_IMPORT_MIB sweep

build / budget FPS (after 150 presents) CPU-copy operations commit peak end
v0.1.3 / default 1056 0.93–1.31 10.3 M (743538 MiB) 17.7 GiB ran 360 s
v0.1.3 / 1536 1.20–1.47 8.6 M (629347 MiB) 17.0 GiB ran 311 s (window closed)
v0.1.3 / 2048 3.96–6.17 49 k (2776 MiB) 33.6 GiB presents stop at 86 s; vkQueueSubmit recorder: Vulkan result -2 at 168 s
v0.1.3 / 2600 8.12–10.34 3 k (205 MiB) 33.6 GiB presents stop at 65 s; vkAllocateMemory device buffer ... memoryType=0 ... heap 0 1400/5899 MiB; heap 1 6064/2949 MiB at 105 s
#7647 / 2600 7.88–11.78 2 k (558 MiB) 31.3 GiB presents stop at 62 s; #7017 abort at 235 s

The working set of imports looks like 2–2.6 GiB: at 1536 the imports still thrash and the copies stay, past 2048 they mostly go.

What ends the fast runs

Only the runs that get fast reach a phase where two compute shaders (programs 0x1ac0984000, 68206 words, and one of 60151 words, 5357x1x1) bind a 4095 MiB buffer:

[resources] guest upload of 4 regions, 4103.1 MiB (largest 4095.0 MiB, copied 0.0 MiB, addressable 0) took 1181 ms to finish

It never appears in the 1–1.5 FPS runs (0 lines), and appears 15, 7 and 13 times in the 2048, 2600 and #7647+2600 runs. From that point private bytes jump (v0.1.3/2600: 7.1 → 12.9 GiB between 72 s and 87 s, free RAM 65 MiB) and the commit charge reaches the limit, after which the allocations above fail even though heap 0 is a quarter used. With #7647 the commit peak is lower (31.3 vs 33.6 GiB) and that run did not hit an allocation failure, but presents still stop at 62 s while the queue workers report 20–27 s of dispatch time per 10 s; audio keeps playing. It then aborts with the #7017 message:

compute shader 0x184055a400: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented; DISPATCH_INDIRECT on queue 0x0

(v0.1.3 hit the same abort once at the default budget, after ~40 s, in 1 of 2 profiled 720p runs.)

So on this machine the fixed 2048 MiB reserve keeps the title at 1 FPS, and a budget large enough to avoid the copies needs the 4 GiB mirror to stay sparse to fit. Logs and CSVs are available.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299013770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6299013770). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-20T19:09:27Z. --- Follow-up on the 780M with v0.1.3 and #7647: on this APU the default host import budget costs Townfall about a factor of ten in frame rate, and raising it runs into the heap-mirror/commit problem this issue is about. ### Setup - Ryzen Z1 Extreme / Radeon 780M, 16 GiB shared (12.7 GiB visible), Windows 11 26100, AMD driver 32.0.23044.19; system-managed page file (commit limit 31.4 GiB, grows to ~39 GiB) - SILENT HILL: Townfall (PPSA33286). Disclosure: the eboot's `PS5.DefaultBackBufferWidth/Height` defaults are patched from 3840x2160 to 1280x720; `-nothreadtimeout` in `uecommandline.txt` - `APS5_PROFILE_DRAW=1`, `APS5_ADDRESS_COPY_MAX_MIB=8192`, warm shader cache, no input, process memory sampled every 5 s - v0.1.3 release (`3fd1cc393b85`) and #7647 at `ed8f15bc1` ### Default budget: the frame is spent copying buffers With the default (`hostHeap 3104 MiB - reserve max(2048, heap/2)` = 1056 MiB), 360 s at ~1.0 FPS: ``` [gpu] host import budget: 1056 MiB live of 1056 MiB (the default; host heap 1 reports a budget of 2949 MiB and a usage of 2946 MiB); 12681700 imports (55604210 MiB) refused so far [buffers] 10325000 completed CPU-copy operations: logical spans 743538 MiB, ... 10324998 outside imports (743538 MiB) ``` About 99 % of the `[guestmem]` read samples come from `GuestBufferMemory::copyRegion` (read site `buffer-upload`, 10.08 M of 10.24 M), i.e. ~0.7 TiB of guest reads in 6 minutes. ### `APS5_HOST_IMPORT_MIB` sweep | build / budget | FPS (after 150 presents) | CPU-copy operations | commit peak | end | |---|---|---|---|---| | v0.1.3 / default 1056 | 0.93–1.31 | 10.3 M (743538 MiB) | 17.7 GiB | ran 360 s | | v0.1.3 / 1536 | 1.20–1.47 | 8.6 M (629347 MiB) | 17.0 GiB | ran 311 s (window closed) | | v0.1.3 / 2048 | 3.96–6.17 | 49 k (2776 MiB) | 33.6 GiB | presents stop at 86 s; `vkQueueSubmit recorder: Vulkan result -2` at 168 s | | v0.1.3 / 2600 | 8.12–10.34 | 3 k (205 MiB) | 33.6 GiB | presents stop at 65 s; `vkAllocateMemory device buffer ... memoryType=0 ... heap 0 1400/5899 MiB; heap 1 6064/2949 MiB` at 105 s | | #7647 / 2600 | 7.88–11.78 | 2 k (558 MiB) | 31.3 GiB | presents stop at 62 s; #7017 abort at 235 s | The working set of imports looks like 2–2.6 GiB: at 1536 the imports still thrash and the copies stay, past 2048 they mostly go. ### What ends the fast runs Only the runs that get fast reach a phase where two compute shaders (programs `0x1ac0984000`, 68206 words, and one of 60151 words, `5357x1x1`) bind a 4095 MiB buffer: ``` [resources] guest upload of 4 regions, 4103.1 MiB (largest 4095.0 MiB, copied 0.0 MiB, addressable 0) took 1181 ms to finish ``` It never appears in the 1–1.5 FPS runs (0 lines), and appears 15, 7 and 13 times in the 2048, 2600 and #7647+2600 runs. From that point private bytes jump (v0.1.3/2600: 7.1 → 12.9 GiB between 72 s and 87 s, free RAM 65 MiB) and the commit charge reaches the limit, after which the allocations above fail even though heap 0 is a quarter used. With #7647 the commit peak is lower (31.3 vs 33.6 GiB) and that run did not hit an allocation failure, but presents still stop at 62 s while the queue workers report 20–27 s of dispatch time per 10 s; audio keeps playing. It then aborts with the #7017 message: ``` compute shader 0x184055a400: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented; DISPATCH_INDIRECT on queue 0x0 ``` (v0.1.3 hit the same abort once at the default budget, after ~40 s, in 1 of 2 profiled 720p runs.) So on this machine the fixed 2048 MiB reserve keeps the title at 1 FPS, and a budget large enough to avoid the copies needs the 4 GiB mirror to stay sparse to fit. Logs and CSVs are available.
LeandroLP23 commented 2026-10-20 23:28:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-20T23:28:07Z.


Data from a second APU, with the other common carve-out: Ryzen AI 7 350 / Radeon 860M, 32 GiB, a 512 MiB UMA frame buffer, AMD driver 32.0.13058.8001, Windows 11 26300. The heaps come out the other way round from the Legion Go's:

heap 0 (host)          15933 MiB, budget ~15100 MiB
heap 1 (device-local)    512 MiB, budget 486 MiB

So the default host import budget is about 7.8 GiB here, and the import thrashing above doesn't happen at the default. The device-local heap, though, is full from the first menu screen on (device-local heap 1 uses 512 of its 486 MiB budget). Every device buffer then goes through DeviceMemoryType's host placement, and on release it was freed instead of pooled. SuperTuxKart's tutorial race made and freed 8192 such buffers per run, about 100 GiB, nearly all of them 8 MiB. #8748 keeps them for reuse, but only while a new buffer would be placed in host memory anyway: race FPS 2.38–2.43 → 2.73–2.92, frame p50 about 402 → 333 ms.

To check the Legion Go's budget on this machine I forced it with APS5_HOST_IMPORT_MIB=1056. The same race on main + #8538 + #6718 drops from 8.8–9.1 to 7.2–8.1 FPS, refusing about 170 imports (about 500 MiB). With #8622 on top it drops to 7.9–8.1 FPS and refuses 1. That change stops re-importing a range that is mapped again at map time. Most of the 1 GiB a small budget holds here went to map-time imports the GPU never reads. SuperTuxKart's working set is small, though, so this only shows how a small budget fills up. It doesn't reproduce Townfall's factor of ten.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304108616 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6304108616). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-20T23:28:07Z. --- Data from a second APU, with the other common carve-out: Ryzen AI 7 350 / Radeon 860M, 32 GiB, a **512 MiB** UMA frame buffer, AMD driver 32.0.13058.8001, Windows 11 26300. The heaps come out the other way round from the Legion Go's: ``` heap 0 (host) 15933 MiB, budget ~15100 MiB heap 1 (device-local) 512 MiB, budget 486 MiB ``` So the default host import budget is about 7.8 GiB here, and the import thrashing above doesn't happen at the default. The device-local heap, though, is full from the first menu screen on (`device-local heap 1 uses 512 of its 486 MiB budget`). Every device buffer then goes through `DeviceMemoryType`'s host placement, and on release it was freed instead of pooled. SuperTuxKart's tutorial race made and freed 8192 such buffers per run, about 100 GiB, nearly all of them 8 MiB. #8748 keeps them for reuse, but only while a new buffer would be placed in host memory anyway: race FPS 2.38–2.43 → 2.73–2.92, frame p50 about 402 → 333 ms. To check the Legion Go's budget on this machine I forced it with `APS5_HOST_IMPORT_MIB=1056`. The same race on `main` + #8538 + #6718 drops from 8.8–9.1 to 7.2–8.1 FPS, refusing about 170 imports (about 500 MiB). With #8622 on top it drops to 7.9–8.1 FPS and refuses 1. That change stops re-importing a range that is mapped again at map time. Most of the 1 GiB a small budget holds here went to map-time imports the GPU never reads. SuperTuxKart's working set is small, though, so this only shows how a small budget fills up. It doesn't reproduce Townfall's factor of ten. AI-assisted: yes (Claude Code)
EagleBearerYS commented 2026-10-21 06:30:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T06:30:57Z.


@keravyn-ops, the "unwatched imports never return to the write watch" case from your experiment 2 now also hits Resident Evil Village (PPSA01556) on a discrete GPU. Since #6457 (ours), a 64 KiB piece mapped on its own is imported, and its import retires as soon as its neighbour is registered and the run grows into a larger aligned block, before its settle has put it back in the watch. With the import budget full, every later address-based build copies those pieces. Village on main 6696def6e6 aborts in its intro with "an address-based build copies 185 MiB of 2960 registered ranges, past 64 MiB (APS5_ADDRESS_COPY_MAX_MIB) … (0.1 MiB committed, outside the write-watched arena)".

#8926 restores the watch when an unwatched import retires, in refreshImports and the budget eviction: only for ranges still registered as the same range, and not where another unwatched import or a live storage texture covers them. That's the restore you measured, and the PR's description credits your finding. If you have your branch for it, or would like to be listed as co-author, say so and I'll add you or take your commits. A run of #8926 on the 780M would also show whether it brings "unwatched heaps" down as your version did.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309650731 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6309650731). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T06:30:57Z. --- @keravyn-ops, the "unwatched imports never return to the write watch" case from your experiment 2 now also hits Resident Evil Village (PPSA01556) on a discrete GPU. Since #6457 (ours), a 64 KiB piece mapped on its own is imported, and its import retires as soon as its neighbour is registered and the run grows into a larger aligned block, before its settle has put it back in the watch. With the import budget full, every later address-based build copies those pieces. Village on main 6696def6e6 aborts in its intro with "an address-based build copies 185 MiB of 2960 registered ranges, past 64 MiB (APS5_ADDRESS_COPY_MAX_MIB) … (0.1 MiB committed, outside the write-watched arena)". #8926 restores the watch when an unwatched import retires, in `refreshImports` and the budget eviction: only for ranges still registered as the same range, and not where another unwatched import or a live storage texture covers them. That's the restore you measured, and the PR's description credits your finding. If you have your branch for it, or would like to be listed as co-author, say so and I'll add you or take your commits. A run of #8926 on the 780M would also show whether it brings "unwatched heaps" down as your version did.
keravyn-ops commented 2026-10-21 15:47:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-21T15:47:21Z.


@EagleBearerYS thanks for the credit. Yes, please add me as co-author:

Co-authored-by: keravyn-ops <[email protected]>

No need to take my commits: my local version (never pushed) also bundles two unrelated knobs (APS5_DIRECT_MEMORY_MIB, APS5_HOST_POOL_MIB), so your change is the cleaner one to keep.

I'm building main (cecb540a6) + #8622 + #8926 now and will post Townfall runs on the 780M here: the default budget and 1536 MiB, with the unwatched heaps counter, against v0.1.3.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6320134294 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6320134294). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-21T15:47:21Z. --- @EagleBearerYS thanks for the credit. Yes, please add me as co-author: ``` Co-authored-by: keravyn-ops <342686842+[email protected]> ``` No need to take my commits: my local version (never pushed) also bundles two unrelated knobs (`APS5_DIRECT_MEMORY_MIB`, `APS5_HOST_POOL_MIB`), so your change is the cleaner one to keep. I'm building `main` (`cecb540a6`) + #8622 + #8926 now and will post Townfall runs on the 780M here: the default budget and 1536 MiB, with the `unwatched heaps` counter, against v0.1.3.
EagleBearerYS commented 2026-10-21 15:56:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T15:56:31Z.


@keravyn-ops, thank you. The trailer is on #8926's commit, now a356b6a75a. Only the commit message changed, and the code is the same as before. Your runs on the 780M with main + #8622 + #8926 are very welcome here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6320342132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6320342132). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T15:56:31Z. --- @keravyn-ops, thank you. The trailer is on #8926's commit, now a356b6a75a. Only the commit message changed, and the code is the same as before. Your runs on the 780M with `main` + #8622 + #8926 are very welcome here.
keravyn-ops commented 2026-10-21 16:34:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-21T16:34:12Z.


Townfall runs of #8622 and #8926 on the 780M, as promised. Together they take the title from ~1.2 to 4–6 FPS at the default import budget; neither does it alone in these runs.

Setup

Same machine and title as above (Ryzen Z1 Extreme / 780M, 16 GiB, 3 GiB UMA frame buffer, Windows 11 26100, AMD driver 32.0.23044.19; 720p backbuffer patch, -nothreadtimeout). APS5_PROFILE_DRAW=1, APS5_ADDRESS_COPY_MAX_MIB=8192, no APS5_HOST_IMPORT_MIB (default budget 1056 MiB) unless stated, warm shader cache, no input, 360 s per run, one run per row. Title runs only; I didn't run the test suite. Builds: main cecb540a63, #8622 at bf66eeccfd, #8926 at acc7b1792e (before its update to a356b6a75a), each merged onto that main, WinLibs GCC 15.2.0, --target libs relinker, eboot relinked with each build's relinker.

Results

build FPS (after 30 presents) CPU-copy operations imports refused unwatched heaps end
v0.1.3 (from above) 0.93–1.31 10.3 M, 743538 MiB 12.7 M 830124 ran 360 s
main 1.11–1.34 6.19 M, 453058 MiB 7.88 M 504871 ran 360 s
main + #8622 1.17–1.32 5.53 M, 407243 MiB 9.45 M 1049010 ran 360 s
main + #8926 – (1 present) – 0.13 M 57 #7017 abort at 144 s, still in the start-up sequence
main + #8622 + #8926 3.96–6.13 12 k, 527 MiB 2.70 M 544 out of memory at 297 s, in the 4095 MiB phase
main + #8622 + #8926, APS5_HOST_IMPORT_MIB=1536 5.43–7.49 16 k, 1342 MiB 2.26 M 925 out of memory at 99 s, in the 4095 MiB phase

The copy volume is what limited the frame rate before: with both PRs the buffer copies drop from ~440 GiB to ~0.5 GiB per run and the count of unwatched heap refreshes from ~500k to ~550, in line with what my local version of the restore did on 2026-10-17 (~29,000 to ~500 there). With #8622 alone the copies and the refusals stay where they were (and the unwatched count roughly doubles). The main + #8926 row is a single run that hit the intermittent #7017 abort before the first frame, so it says nothing about #8926 alone; I can repeat it if that split matters.

What stops it now

Both fast runs end the same way as the APS5_HOST_IMPORT_MIB=2600 runs above, once the title reaches the phase with the 4095 MiB buffer:

vkAllocateMemory device buffer: allocation=268435456 memoryType=0 reclaimed=0 released=0 initialResult=-2 attempts=2; heap 0 1404/5899 MiB; heap 1 6221/2949 MiB; heap 2 219/243 MiB

(GPU shared usage peak 6215 and 6464 MiB, app private bytes peak 14.5 GiB in the default run.) At ~1 FPS, the earlier default-budget runs never got there within 6 minutes.

Logs and CSVs are available.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321147369 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6321147369). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-21T16:34:12Z. --- Townfall runs of #8622 and #8926 on the 780M, as promised. Together they take the title from ~1.2 to 4–6 FPS at the **default** import budget; neither does it alone in these runs. ### Setup Same machine and title as above (Ryzen Z1 Extreme / 780M, 16 GiB, 3 GiB UMA frame buffer, Windows 11 26100, AMD driver 32.0.23044.19; 720p backbuffer patch, `-nothreadtimeout`). `APS5_PROFILE_DRAW=1`, `APS5_ADDRESS_COPY_MAX_MIB=8192`, no `APS5_HOST_IMPORT_MIB` (default budget 1056 MiB) unless stated, warm shader cache, no input, 360 s per run, one run per row. Title runs only; I didn't run the test suite. Builds: `main` `cecb540a63`, #8622 at `bf66eeccfd`, #8926 at `acc7b1792e` (before its update to `a356b6a75a`), each merged onto that `main`, WinLibs GCC 15.2.0, `--target libs relinker`, eboot relinked with each build's relinker. ### Results | build | FPS (after 30 presents) | CPU-copy operations | imports refused | `unwatched heaps` | end | |---|---|---|---|---|---| | v0.1.3 (from above) | 0.93–1.31 | 10.3 M, 743538 MiB | 12.7 M | 830124 | ran 360 s | | `main` | 1.11–1.34 | 6.19 M, 453058 MiB | 7.88 M | 504871 | ran 360 s | | `main` + #8622 | 1.17–1.32 | 5.53 M, 407243 MiB | 9.45 M | 1049010 | ran 360 s | | `main` + #8926 | – (1 present) | – | 0.13 M | 57 | #7017 abort at 144 s, still in the start-up sequence | | `main` + #8622 + #8926 | **3.96–6.13** | **12 k, 527 MiB** | 2.70 M | 544 | out of memory at 297 s, in the 4095 MiB phase | | `main` + #8622 + #8926, `APS5_HOST_IMPORT_MIB=1536` | 5.43–7.49 | 16 k, 1342 MiB | 2.26 M | 925 | out of memory at 99 s, in the 4095 MiB phase | The copy volume is what limited the frame rate before: with both PRs the buffer copies drop from ~440 GiB to ~0.5 GiB per run and the count of unwatched heap refreshes from ~500k to ~550, in line with what my local version of the restore did on 2026-10-17 (~29,000 to ~500 there). With #8622 alone the copies and the refusals stay where they were (and the unwatched count roughly doubles). The `main` + #8926 row is a single run that hit the intermittent #7017 abort before the first frame, so it says nothing about #8926 alone; I can repeat it if that split matters. ### What stops it now Both fast runs end the same way as the `APS5_HOST_IMPORT_MIB=2600` runs above, once the title reaches the phase with the 4095 MiB buffer: ``` vkAllocateMemory device buffer: allocation=268435456 memoryType=0 reclaimed=0 released=0 initialResult=-2 attempts=2; heap 0 1404/5899 MiB; heap 1 6221/2949 MiB; heap 2 219/243 MiB ``` (GPU shared usage peak 6215 and 6464 MiB, app private bytes peak 14.5 GiB in the default run.) At ~1 FPS, the earlier default-budget runs never got there within 6 minutes. Logs and CSVs are available.
EagleBearerYS commented 2026-10-21 16:49:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T16:49:22Z.


@keravyn-ops, thank you for the full table and for keeping your caveats with it. The rows with #8926 are now in its Tested section, together with the #7017 note and the out-of-memory end. Since you offered: one more run of the main + #8926 row would only be worth it if it gets past the start-up abort, to show #8926 without #8622. If that's easy on your side, it's welcome, but nothing waits on it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321488092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6321488092). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T16:49:22Z. --- @keravyn-ops, thank you for the full table and for keeping your caveats with it. The rows with #8926 are now in its Tested section, together with the #7017 note and the out-of-memory end. Since you offered: one more run of the `main` + #8926 row would only be worth it if it gets past the start-up abort, to show #8926 without #8622. If that's easy on your side, it's welcome, but nothing waits on it.
keravyn-ops commented 2026-10-21 17:14:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-21T17:14:34Z.


One more data point, so nobody has to try it: moving the heap mirrors to device-local memory doesn't get Townfall past the 4095 MiB phase on the 780M. It moves the memory from heap 1 to heap 0, and the runs fail at the same total.

What I ran

main cecb540a63 + #8622 (bf66eeccfd) + #8926 (acc7b1792e) + my local commit from 2026-10-17 that places non-sparse heap mirrors in device-local memory (refreshes through host staging, write-backs through recorded copies; never pushed), forced on with its APS5_DEVICE_HEAP_MIRRORS=1. Same machine and settings as my previous comments (3 GiB UMA frame buffer, 720p backbuffer patch, -nothreadtimeout, APS5_PROFILE_DRAW=1, no input), one run per row. Title runs only, no test suite.

The 4095 MiB region is a sparse heap: an uploaded-region trace shows 0x8fc0000000+0xfff00000 sparseHeap=1 backed=1/0x21000000 served by a 528 MiB heap mirror, so it is not 4 GiB of mirror. Beside it, writable heap mirrors of 256 and 323 MiB appear in the same phase.

Results

heap mirrors budget FPS (after 30 presents) end heap 0 / heap 1 at the failure heap mirrors in heap 0
host (as in my last comment) default 3.96–6.13 297 s, device buffer ... memoryType=0 1404 / 6221 MiB –
host (as in my last comment) 1536 5.43–7.49 99 s, device buffer ... memoryType=0 1235 / 6270 MiB –
device-local default 3.98–5.98 121 s, device buffer ... memoryType=0 4892 / 2138 MiB 6464 (2138.6 MiB)
device-local 1536 3.18–4.05 335 s, buffer ... memoryType=3 4544 / 2361 MiB 7165 (2791.6 MiB)
device-local, APS5_TEXTURE_CACHE_MIB=512 1536 4.88–6.93 112 s, buffer ... memoryType=3 4618 / 2350 MiB 4952 (1111.1 MiB)

(Heap 0 is device-local, budget 5899 MiB; heap 1 is host, budget 2949 MiB.)

  • With the mirrors in heap 0, heap 1 stays under its budget, but the allocations still fail, now in heap 0 at 4544–4892 of 5899 MiB, or in heap 1 at 2350–2361 of 2949 MiB. Heap 0 + heap 1 at the failure is 6905–7030 MiB with device-local mirrors and 7505–7625 MiB without, and the GPU shared usage counter peaks at 6048–6206 MiB in all three device-local runs (5 s samples).
  • The mirror refreshes cost 23–29 GiB of staging copies per run, which takes the 1536 MiB runs from 5.4–7.5 down to 3.2–4.1 FPS when the texture cache isn't capped.
  • The 335 s run is the longest of all fast runs, but the two other device-local runs ended at 112 s and 121 s, so I don't read it as an improvement.

So on this APU the limit looks like the total the driver will back across both heaps, not either heap's budget, and the title needs less GPU memory overall in that phase rather than a different placement. I'm not proposing the device-local mirror change. Logs and CSVs are available.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6322010567 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7047#issuecomment-6322010567). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-21T17:14:34Z. --- One more data point, so nobody has to try it: moving the heap mirrors to device-local memory doesn't get Townfall past the 4095 MiB phase on the 780M. It moves the memory from heap 1 to heap 0, and the runs fail at the same total. ### What I ran `main` `cecb540a63` + #8622 (`bf66eeccfd`) + #8926 (`acc7b1792e`) + my local commit from 2026-10-17 that places non-sparse heap mirrors in device-local memory (refreshes through host staging, write-backs through recorded copies; never pushed), forced on with its `APS5_DEVICE_HEAP_MIRRORS=1`. Same machine and settings as my previous comments (3 GiB UMA frame buffer, 720p backbuffer patch, `-nothreadtimeout`, `APS5_PROFILE_DRAW=1`, no input), one run per row. Title runs only, no test suite. The 4095 MiB region is a sparse heap: an uploaded-region trace shows `0x8fc0000000+0xfff00000 sparseHeap=1 backed=1/0x21000000` served by a 528 MiB heap mirror, so it is not 4 GiB of mirror. Beside it, writable heap mirrors of 256 and 323 MiB appear in the same phase. ### Results | heap mirrors | budget | FPS (after 30 presents) | end | heap 0 / heap 1 at the failure | heap mirrors in heap 0 | |---|---|---|---|---|---| | host (as in my last comment) | default | 3.96–6.13 | 297 s, `device buffer ... memoryType=0` | 1404 / 6221 MiB | – | | host (as in my last comment) | 1536 | 5.43–7.49 | 99 s, `device buffer ... memoryType=0` | 1235 / 6270 MiB | – | | device-local | default | 3.98–5.98 | 121 s, `device buffer ... memoryType=0` | 4892 / 2138 MiB | 6464 (2138.6 MiB) | | device-local | 1536 | 3.18–4.05 | 335 s, `buffer ... memoryType=3` | 4544 / 2361 MiB | 7165 (2791.6 MiB) | | device-local, `APS5_TEXTURE_CACHE_MIB=512` | 1536 | 4.88–6.93 | 112 s, `buffer ... memoryType=3` | 4618 / 2350 MiB | 4952 (1111.1 MiB) | (Heap 0 is device-local, budget 5899 MiB; heap 1 is host, budget 2949 MiB.) - With the mirrors in heap 0, heap 1 stays under its budget, but the allocations still fail, now in heap 0 at 4544–4892 of 5899 MiB, or in heap 1 at 2350–2361 of 2949 MiB. Heap 0 + heap 1 at the failure is 6905–7030 MiB with device-local mirrors and 7505–7625 MiB without, and the GPU shared usage counter peaks at 6048–6206 MiB in all three device-local runs (5 s samples). - The mirror refreshes cost 23–29 GiB of staging copies per run, which takes the 1536 MiB runs from 5.4–7.5 down to 3.2–4.1 FPS when the texture cache isn't capped. - The 335 s run is the longest of all fast runs, but the two other device-local runs ended at 112 s and 121 s, so I don't read it as an improvement. So on this APU the limit looks like the total the driver will back across both heaps, not either heap's budget, and the title needs less GPU memory overall in that phase rather than a different placement. I'm not proposing the device-local mirror change. Logs and CSVs are available.
Sign in to join this conversation.
No labels
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.

Reference
boykopovar/AnyPS5#7047
No description provided.