Skip to main content

Module blit_semaphore

Module blit_semaphore 

Source
Expand description

The GPU semaphore an X server’s blit signals for the encoder, made through Vulkan. A GPU semaphore an X server’s renderer signals and the encoder’s CUDA stream waits on, so the encoder’s work on a frame is queued behind the server’s blit on the GPU itself instead of after the CPU has learnt the blit landed (crate::x11’s DRI3 path, through the SELKIES-SEMAPHORE extension of the images’ Xvfb).

Neither CUDA nor GL can make a semaphore another API imports, so Vulkan makes it, a binary one exported as an OPAQUE_FD, on the device whose UUID is the CUDA device’s. Two fds of it go out, one for CUDA’s import and one for the server’s GL, and the device and the semaphore are gone again once they are: the imports hold the payload between them. The instance the device is made from stays for the life of the process ([Vulkan]), since destroying one leaks descriptors in NVIDIA’s driver.

Structs§

ApplicationInfo 🔒
DeviceCreateInfo 🔒
DeviceQueueCreateInfo 🔒
ExportSemaphoreCreateInfo 🔒
InstanceCreateInfo 🔒
PhysicalDeviceIdProperties 🔒
PhysicalDeviceProperties2 🔒
VkPhysicalDeviceProperties2, with the core properties (824 bytes, 8-aligned) left opaque: only the ID properties chained after them are read.
SemaphoreCreateInfo 🔒
SemaphoreGetFdInfo 🔒
Vulkan 🔒
The Vulkan loader and the one instance every semaphore’s device is made from, kept for the life of the process. NVIDIA’s driver leaves a /dev/nvidiactl and a render-node descriptor open for every instance it destroys while DISPLAY names an X server without NV-GLX, as the images’ Xvfb is, so an instance per capture start runs a server that streams to reconnecting clients out of descriptors; the devices made from a kept instance are destroyed without leaking any.

Constants§

EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD 🔒
STRUCTURE_TYPE_APPLICATION_INFO 🔒
STRUCTURE_TYPE_DEVICE_CREATE_INFO 🔒
STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO 🔒
STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO 🔒
STRUCTURE_TYPE_INSTANCE_CREATE_INFO 🔒
STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES 🔒
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 🔒
STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO 🔒
STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR 🔒
VK_API_VERSION_1_1 🔒

Functions§

opaque_fd_pair 🔒
Two fds of one new binary semaphore exportable as OPAQUE_FD, made on the Vulkan device whose UUID is uuid (the CUDA device’s, as cuDeviceGetUuid reports it).

Type Aliases§

CreateDevice 🔒
CreateInstance 🔒
CreateSemaphore 🔒
DestroyDevice 🔒
DestroyInstance 🔒
DestroySemaphore 🔒
EnumeratePhysicalDevices 🔒
GetDeviceProcAddr 🔒
GetInstanceProcAddr 🔒
GetPhysicalDeviceProperties2 🔒
GetSemaphoreFd 🔒
VkDevice 🔒
VkInstance 🔒
VkPhysicalDevice 🔒
VkResult 🔒
VkSemaphore 🔒
VoidFn 🔒