KhronosGroup / KhronosGroup/Vulkan-Docs

Cross adapter memory and synchronization

Open
#2,443 4 comments 0 reactions 1 assignee Claimed by @linyaa-kiwi View on GitHub
System Integration
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

Hello,

I would like to bring something new to Vulkan and create a new extension. However I would like to get some validation first, before diving in the paperwork.

I would like to introduce a cross device memory and semaphore handles. The mechanism on user side would be the same as creating shared handle. However, since it is cross device there are some significant considerations to be made. Let me present the rough outline.

Memory:
1) memory could be device local and host visible (ReBAR), that ensures best performance on write. The idea is the same as cross-adapter swapchain implementation, that copies images to the adapter that has output monitor plugged.
2) it may create only linear buffers, since tiling between devices may differ. Maybe tiling compatibility could be checked, in that case textures may also be created.
3) the memory is rw on producer adapter and read only from other devices, that map the memory as their local, that will benefit the security.
4) handle is just VkDeviceMemory, but it can be reexported with win32/fd (is it possible?)

Semaphore:
1) can be imported cross adapter
2) use system memory, like syncfd handles
3) timeline semaphore will also be available, the value will be shared across devices

Of course this is not entirely complete, and I would like to work on details. I am aware of external_memory, but it requires readback memory (host visible, host coherent, host cached) and wild amount of hacks. And I know only about syncfd semaphores that are capable of cross-adapter support. The proposal would optimize the data paths and make sync easier.

I would like to hear your feedback!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.