Shared direct memory is never imported as dma-buf on drivers without VK_EXT_external_memory_host #16466

Closed
opened 2026-11-06 19:14:13 +00:00 by Rad0van · 0 comments
Rad0van commented 2026-11-06 19:14:13 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rad0van on 2026-11-06T19:14:13Z.


What happens

On a Linux driver with VK_KHR_external_memory_fd and VK_EXT_external_memory_dma_buf but without VK_EXT_external_memory_host, guest memory is never imported, so GPU stores through FLAT/GLOBAL addresses into direct memory fail with BDA access failed ... read-only in the BDA table.

Title, test or build step

DOOM homebrew PPSA99666 (AGC compute presentation): every frame's stores to the display buffer fail and the frame is not updated.

AnyPS5 commit

main 9f2b939 (also release v0.1.4).

System

Ubuntu 26.04 (Asahi Linux, kernel 7.2.0-1001-asahi-arm), Apple M2 Max, Honeykrisp (Mesa 26.0.8 aarch64; also Mesa 25.3 x86-64). x86-64 code run by Box64 0.4.5 on the host and by FEX 2610 in muvm 0.7. Libraries cross-compiled with GCC 15.2 (g++-15-x86-64-linux-gnu).

Host report

AnyPS5 host report (format 1)
commit: 9f2b93960604
[system]
os: Linux 7.2.0-1001-asahi-arm x86_64
cpu: Box64 v0.4.5 on Blizzard-M2-Max @3.26 GHz
cpu_threads: 12
memory_mib: 23685
cpu_gate: passed
[sdl]
linked: 2.33.0
compiled: 2.33.0
[gpu]
device: Apple M2 Max (G14C B1)
type: integrated
vendor_id: 0x10005
device_id: 0x0000
vulkan_api: 1.4.335
driver: Honeykrisp
driver_info: Mesa 26.0.8-1ubuntu0.3
driver_version_raw: 0x06800008
subgroup_size: 32
device_local_mib: 47371
candidates: Apple M2 Max (G14C B1)
present_modes: fifo, immediate, mailbox
present_mode_requested: default
[vulkan]
VK_EXT_external_memory_host: extension optional missing
VK_EXT_fragment_shader_interlock: extension optional missing
VK_EXT_hdr_metadata: extension optional present
VK_EXT_memory_budget: extension optional missing
VK_EXT_mesh_shader: extension optional missing
VK_EXT_present_mode_fifo_latest_ready: extension optional missing
VK_EXT_provoking_vertex: extension optional present
VK_EXT_sample_locations: extension optional present
VK_EXT_sampler_filter_minmax: extension optional missing
VK_EXT_shader_demote_to_helper_invocation: extension optional present
VK_EXT_shader_image_atomic_int64: extension optional missing
VK_KHR_draw_indirect_count: extension optional present
VK_KHR_driver_properties: extension optional present
VK_KHR_fragment_shader_barycentric: extension optional missing
VK_KHR_maintenance5: extension optional present
VK_KHR_present_mode_fifo_latest_ready: extension optional missing
VK_KHR_shader_atomic_int64: extension optional missing
VK_KHR_shader_clock: extension optional missing
VK_KHR_shader_terminate_invocation: extension optional present
VK_KHR_spirv_1_4: extension optional present
[shader_cache]
state: present
size_mib: 0
[environment]
ANYPS5_HOST_REPORT: 1
APS5_SINGLE_LANE: all
SDL_VIDEODRIVER: wayland
VK_DRIVER_FILES: <path>

Steps to reproduce

Run any title that draws or presents through AGC compute on Honeykrisp, with /dev/udmabuf readable and writable. DOOM: 30 s from start.

Log

[gpu] deferred write-back failed: BDA access failed: address=0x200c01100 instruction=0x260 bytes=4 stage=4 reason=2; the store hit 0x200c00000+0x2000000, read-only in the BDA table: stores through GPU-selected descriptors and FLAT/GLOBAL addresses reach only writable ranges imported in place, not ones served by a mirror or a copy (past APS5_HOST_IMPORT_MIB, or refused by the driver)

57 such lines in 30 s on main 9f2b939.

What was checked

VulkanDevice.cpp sets dmaBufImport, hostImportAlignment, the host import window and the import size limit only inside if (hasExtension(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME) ...), so without host pointer import nothing is imported, although the udmabuf backing import (createBackingImport) would work. With a Vulkan layer that advertises the extension and fails every vkGetMemoryHostPointerPropertiesEXT, createImport falls through to the udmabuf chunks and DOOM renders with no BDA failures. The udmabuf import itself works on Honeykrisp (standalone fill/copy check, both directions coherent). Same result every run.

Analysed with AI assistance (Claude); a fix follows as a pull request.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6249059270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/16466). Originally posted by [Rad0van](https://github.com/Rad0van) on 2026-11-06T19:14:13Z. --- ### What happens On a Linux driver with `VK_KHR_external_memory_fd` and `VK_EXT_external_memory_dma_buf` but without `VK_EXT_external_memory_host`, guest memory is never imported, so GPU stores through FLAT/GLOBAL addresses into direct memory fail with `BDA access failed ... read-only in the BDA table`. ### Title, test or build step DOOM homebrew PPSA99666 (AGC compute presentation): every frame's stores to the display buffer fail and the frame is not updated. ### AnyPS5 commit main 9f2b939 (also release v0.1.4). ### System Ubuntu 26.04 (Asahi Linux, kernel 7.2.0-1001-asahi-arm), Apple M2 Max, Honeykrisp (Mesa 26.0.8 aarch64; also Mesa 25.3 x86-64). x86-64 code run by Box64 0.4.5 on the host and by FEX 2610 in muvm 0.7. Libraries cross-compiled with GCC 15.2 (`g++-15-x86-64-linux-gnu`). ### Host report ```text AnyPS5 host report (format 1) commit: 9f2b93960604 [system] os: Linux 7.2.0-1001-asahi-arm x86_64 cpu: Box64 v0.4.5 on Blizzard-M2-Max @3.26 GHz cpu_threads: 12 memory_mib: 23685 cpu_gate: passed [sdl] linked: 2.33.0 compiled: 2.33.0 [gpu] device: Apple M2 Max (G14C B1) type: integrated vendor_id: 0x10005 device_id: 0x0000 vulkan_api: 1.4.335 driver: Honeykrisp driver_info: Mesa 26.0.8-1ubuntu0.3 driver_version_raw: 0x06800008 subgroup_size: 32 device_local_mib: 47371 candidates: Apple M2 Max (G14C B1) present_modes: fifo, immediate, mailbox present_mode_requested: default [vulkan] VK_EXT_external_memory_host: extension optional missing VK_EXT_fragment_shader_interlock: extension optional missing VK_EXT_hdr_metadata: extension optional present VK_EXT_memory_budget: extension optional missing VK_EXT_mesh_shader: extension optional missing VK_EXT_present_mode_fifo_latest_ready: extension optional missing VK_EXT_provoking_vertex: extension optional present VK_EXT_sample_locations: extension optional present VK_EXT_sampler_filter_minmax: extension optional missing VK_EXT_shader_demote_to_helper_invocation: extension optional present VK_EXT_shader_image_atomic_int64: extension optional missing VK_KHR_draw_indirect_count: extension optional present VK_KHR_driver_properties: extension optional present VK_KHR_fragment_shader_barycentric: extension optional missing VK_KHR_maintenance5: extension optional present VK_KHR_present_mode_fifo_latest_ready: extension optional missing VK_KHR_shader_atomic_int64: extension optional missing VK_KHR_shader_clock: extension optional missing VK_KHR_shader_terminate_invocation: extension optional present VK_KHR_spirv_1_4: extension optional present [shader_cache] state: present size_mib: 0 [environment] ANYPS5_HOST_REPORT: 1 APS5_SINGLE_LANE: all SDL_VIDEODRIVER: wayland VK_DRIVER_FILES: <path> ``` ### Steps to reproduce Run any title that draws or presents through AGC compute on Honeykrisp, with `/dev/udmabuf` readable and writable. DOOM: 30 s from start. ### Log ```text [gpu] deferred write-back failed: BDA access failed: address=0x200c01100 instruction=0x260 bytes=4 stage=4 reason=2; the store hit 0x200c00000+0x2000000, read-only in the BDA table: stores through GPU-selected descriptors and FLAT/GLOBAL addresses reach only writable ranges imported in place, not ones served by a mirror or a copy (past APS5_HOST_IMPORT_MIB, or refused by the driver) ``` 57 such lines in 30 s on main 9f2b939. ### What was checked `VulkanDevice.cpp` sets `dmaBufImport`, `hostImportAlignment`, the host import window and the import size limit only inside `if (hasExtension(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME) ...)`, so without host pointer import nothing is imported, although the udmabuf backing import (`createBackingImport`) would work. With a Vulkan layer that advertises the extension and fails every `vkGetMemoryHostPointerPropertiesEXT`, `createImport` falls through to the udmabuf chunks and DOOM renders with no BDA failures. The udmabuf import itself works on Honeykrisp (standalone fill/copy check, both directions coherent). Same result every run. Analysed with AI assistance (Claude); a fix follows as a pull request.
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#16466
No description provided.