Hi,
We are developers of an unreleased virtual machine app for Android, that allows translating foreign GPU architectures into Vulkan, a very large point of contention and slowdown in the app is copying data from buffers mapped by the guest GPU into host Vulkan buffers, as we don't control the code being ran inside the VM we are unable to have it write to existing Vulkan buffers forcing us to use an intermediary buffer together with a complex combination of signal handlers in order to synchronise the buffers when they are written by the VM guest; at the moment there is no way to avoid these expensive operations on Adreno GPUs.
However, the VK_EXT_external_memory_host, which is already supported on many GPU platforms would make this a non-issue, with it we can directly import pointers from the guest into a host VkBuffer to allow rapid data sharing with very low overhead. We have done some research into the viability of this on Adreno platforms and it seems to be possible to implement without needing significant modifications, KGSL provides a simple function - IOCTL_KGSL_MAP_USER_MEM - which allows mapping a user supplied address to a GPU buffer. The extension can simply call out to this IOCTL for support.
I hope you can consider this request, it would really help us in developing a viable application across a wide range of Qualcomm devices and potentially serve as a testament to the power of Adreno GPUs.
We are developers of an unreleased virtual machine app for Android, that allows translating foreign GPU architectures into Vulkan, a very large point of contention and slowdown in the app is copying data from buffers mapped by the guest GPU into host Vulkan buffers, as we don't control the code being ran inside the VM we are unable to have it write to existing Vulkan buffers forcing us to use an intermediary buffer together with a complex combination of signal handlers in order to synchronise the buffers when they are written by the VM guest; at the moment there is no way to avoid these expensive operations on Adreno GPUs.
However, the VK_EXT_external_memory_host, which is already supported on many GPU platforms would make this a non-issue, with it we can directly import pointers from the guest into a host VkBuffer to allow rapid data sharing with very low overhead. We have done some research into the viability of this on Adreno platforms and it seems to be possible to implement without needing significant modifications, KGSL provides a simple function - IOCTL_KGSL_MAP_USER_MEM - which allows mapping a user supplied address to a GPU buffer. The extension can simply call out to this IOCTL for support.
I hope you can consider this request, it would really help us in developing a viable application across a wide range of Qualcomm devices and potentially serve as a testament to the power of Adreno GPUs.