Signal for an NvSciSyncFence#
VkFence (CPU only)#
Use the vkQueueSubmit
API to submit jobs enqueued on the Vulkan SC queue by providing a valid VkFence
to fence as a parameter. The fence tracks the completion of all the jobs submitted to the Vulkan SC queue on which the API was invoked.
Use vkGetFenceSciSyncFenceNV
to get the pending NvSciSyncFence
. The application must provide a valid VkFence
to VkFenceGetSciSyncInfoNV::fence
from which the NvSciSyncFence
is extracted.
Waiting on this NvSciSyncFence
is equivalent to waiting for the completion of all prior submissions on the queue, in submission order. Once all the submissions have completed, the NvSciSyncFence
is signaled and all the potential waiters on this NvSciSyncFence
are unblocked. This signal occurs asynchronously on the GPU.
VkSemaphore#
GPU Signal
Use the vkQueueSubmit
API to submit jobs enqueued on the Vulkan SC queue. This API takes VkSubmitInfo::pSignalSemaphores
as a parameter. In addition, application must chain a valid VkTimelineSemaphoreSubmitInfo
struct to the VkSubmitInfo::pNext
, where VkTimelineSemaphoreSubmitInfo::pSignalSemaphoreValues
should be tracked and maintained by application (The initial value is always 0
).
As applications must maintain the signal value by incrementing it for each submission, use the NvSciSync
API NvSciSyncFenceUpdateFence
to get the pending NvSciSyncFence
, where the id is always 0
because VkSemaphore
only supports one sysmem
semaphore as a signaler. This NvSciSyncFence
tracks prior batches to the queue, in signal operation order. Once it is signaled, all the potential waiters on this NvSciSyncFence
will be unblocked. This signal occurs asynchronously on the GPU.
CPU Signal
Use the vkSignalSemaphore
API to signal on the CPU. This API takes a validVkSemaphoreSignalInfo::semaphore
as a parameter. In addition, applications must track and maintain the signal value and provide it as a parameter to VkSemaphoreSignalInfo::value
.
Use the NvSciSync
API NvSciSyncFenceUpdateFence
to get the pending NvSciSyncFence
. The signal occurs asynchronously on the GPU. Once it is signaled, all the potential waiters on this NvSciSyncFence
will be unblocked.
Deterministic Fence
Vulkan SC supports Deterministic Fence in VkSemaphore
. When Deterministic Fence is enabled in NvSciSync
, Vulkan SC signaler doesn’t need to export NvSciSyncFence
to NvSciIPC
. When Vulkan SC applications pass a counter value to signal a VkSemaphore
, applications pass the value, which increments by +1 (exactly one), from the counter value of the previous semaphore signal operation on that VkSemaphore
, in signal operation order. The initial counter value is 0
.