Wait for an NvSciSyncFence
VkFence (CPU Wait Only)
Use vkImportFenceSciSyncFenceNV to import an
NvSciSyncFence to the VkFence. This API takes a valid
NvSciSyncFence as a parameter to
VkImportFenceSciSyncInfoNV::handle. The applications must specify
VkImportFenceSciSyncInfoNV::handleType to
VK_EXTERNAL_FENCE_HANDLE_TYPE_SCI_SYNC_FENCE_BIT_NV. On completion, use
the vkWaitForFences API to perform the CPU wait until the imported
NvSciSyncFence is signaled by the relevant signaler or timeout
occurs.
VkSemaphore
Use the vkCreateSemaphore API to retrieve a VkSemaphore
object from the VkSemaphoreSciSyncPoolNV object according to the input
NvSciSyncFence. This API takes a valid
VkSemaphoreCreateInfo struct as a parameter. Application must chain a
VkSemaphoreSciSyncCreateInfoNV struct to the
VkSemaphoreCreateInfo::pNext with
VkSemaphoreSciSyncCreateInfoNV::semaphorePool of a valid
VkSemaphoreSciSyncPoolNV object and
VkSemaphoreSciSyncCreateInfoNV::pFence of a valid
NvSciSyncFence. In addition, application must chain
VkSemaphoreTypeCreateInfo struct with
VkSemaphoreTypeCreateInfo::semaphoreType of
VK_SEMAPHORE_TYPE_TIMELINE to the VkSemaphoreCreateInfo::pNext.
- GPU Wait
Use the
vkQueueSubmitAPI to submit jobs enqueued on the Vulkan SC queue. This API takesVkSubmitInfo::pWaitSemaphoresas a parameter. In addition, application must chain a validVkTimelineSemaphoreSubmitInfostruct to theVkSubmitInfo::pNext, whereVkTimelineSemaphoreSubmitInfo::pWaitSemaphoreValuescan be retrieved using theNvSciSyncAPINvSciSyncFenceExtractFence. The jobs submitted to the Vulkan SC queue wait until theNvSciSyncFenceis signaled by the relevant signaler. The wait occurs asynchronously on the GPU. - CPU Wait
Use the
vkWaitSemaphoresAPI to waitNvSciSyncFenceon the CPU. The application must provide a validVkSemaphoreas a parameter toVkSemaphoreWaitInfo::pSemaphoresand a semaphore value extracted fromNvSciSyncFenceExtractFencetoVkSemaphoreWaitInfo::pValues. The wait is blocked on the CPU until theNvSciSyncFenceis signaled by the relevant signaler or timeout occurs. - Deterministic Fence
Vulkan SC supports Deterministic Fence in VkSemaphore. When Deterministic Fence is enabled in
NvSciSyncviaNvSciSyncAttrKey_RequireDeterministicFences, Vulkan SC waiter does not need to importNvSciSyncFencefromNvSciIPC. Instead, applications must always construct a newNvSciSyncFenceby using0as the fence id. Increment the counter value by one from the previous semaphore wait operation at each semaphore wait operation. The initial counter value is0.