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
vkQueueSubmit
API to submit jobs enqueued on the Vulkan SC queue. This API takesVkSubmitInfo::pWaitSemaphores
as a parameter. In addition, application must chain a validVkTimelineSemaphoreSubmitInfo
struct to theVkSubmitInfo::pNext
, whereVkTimelineSemaphoreSubmitInfo::pWaitSemaphoreValues
can be retrieved using theNvSciSync
APINvSciSyncFenceExtractFence
. The jobs submitted to the Vulkan SC queue wait until theNvSciSyncFence
is signaled by the relevant signaler. The wait occurs asynchronously on the GPU. - CPU Wait
Use the
vkWaitSemaphores
API to waitNvSciSyncFence
on the CPU. The application must provide a validVkSemaphore
as a parameter toVkSemaphoreWaitInfo::pSemaphores
and a semaphore value extracted fromNvSciSyncFenceExtractFence
toVkSemaphoreWaitInfo::pValues
. The wait is blocked on the CPU until theNvSciSyncFence
is signaled by the relevant signaler or timeout occurs. - Deterministic Fence
Vulkan SC supports Deterministic Fence in VkSemaphore. When Deterministic Fence is enabled in
NvSciSync
viaNvSciSyncAttrKey_RequireDeterministicFences
, Vulkan SC waiter does not need to importNvSciSyncFence
fromNvSciIPC
. Instead, applications must always construct a newNvSciSyncFence
by using0
as 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
.