Expand description
External memory / semaphore interop — import buffers and sync primitives from Vulkan, D3D11, D3D12, NvSci, and OpaqueFd sources.
A typical pipeline is:
- A graphics API (Vulkan, D3D12) exports a buffer or image and a timeline fence as OS-level handles (file descriptor on Linux, NT HANDLE on Windows).
- CUDA imports those handles via
ExternalMemory::importandExternalSemaphore::import. - CUDA obtains a device pointer into the shared buffer with
ExternalMemory::mapped_buffer. - Each frame, CUDA
ExternalSemaphore::wait_fence_asyncs on the graphics-API fence, does compute, thenExternalSemaphore::signal_fence_asyncs a fence value the graphics API is waiting on.
Testing note: the baracuda crate ships these APIs but cannot end-to-end test them without a live Vulkan/D3D12 context. Layout and symbol-resolution are verified via unit tests in this module; a matching external-memory/-semaphore example belongs in an examples/external_interop crate (not yet present).
Structs§
- External
Memory - An imported external-memory handle (Vulkan VkDeviceMemory, D3D12 heap, NvSciBuf, …). Destroyed on drop.
- External
Semaphore - An imported external-semaphore handle (Vulkan VkSemaphore / timeline, D3D12 fence, NvSciSync, keyed mutex). Destroyed on drop.