1// Copyright (c) 2022 NVIDIA Corporation 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5include::{generated}/meta/{refprefix}VK_NV_external_sci_sync2.adoc[] 6 7=== Other Extension Metadata 8 9*Last Modified Date*:: 10 2022-09-07 11*Contributors*:: 12 - Kai Zhang, NVIDIA 13 - Jeff Bolz, NVIDIA 14 - Jonathan McCaffrey, NVIDIA 15 - Daniel Koch, NVIDIA 16 17[[NvSciSync2-extension-page]] 18=== Description 19 20An application using external memory may wish to synchronize access to that 21memory using semaphores and fences. 22This extension enables an application to import semaphore and import/export 23fence payloads to and from stext:NvSciSync objects. 24To import a stext:NvSciSyncObj to a slink:VkSemaphore or slink:VkFence, 25applications need to: 26 27 * Create an unreconciled stext:NvSciSyncAttrList via 28 stext:NvSciSyncAttrListCreate() 29 * Fill the private attribute list via 30 flink:vkGetPhysicalDeviceSciSyncAttributesNV() 31 * Fill the public attribute list via stext:NvSciSyncAttrListSetAttrs() 32 * Reconcile the stext:NvSciSyncAttrList via 33 stext:NvSciSyncAttrListReconcile() 34 * Create a stext:NvSciSyncObj via stext:NvSciSyncObjAlloc() 35 * To import a stext:NvSciSyncObj to a slink:VkSemaphore, create a 36 slink:VkSemaphoreSciSyncPoolNV for the stext:NvSciSyncObj and then 37 select the semaphore from slink:VkSemaphoreSciSyncPoolNV by passing the 38 slink:VkSemaphoreSciSyncCreateInfoNV structure to 39 flink:vkCreateSemaphore 40 * To import a stext:NvSciSyncObj to a slink:VkFence, pass the 41 slink:VkImportFenceSciSyncInfoNV structure to the 42 flink:vkImportFenceSciSyncObjNV command. 43 44To import/export a stext:NvSciSyncFence to a slink:VkFence object, that 45slink:VkFence object must: already have a stext:NvSciSyncObj previously 46imported. 47 48This extension does not support exporting semaphores from stext:NvSciSync 49objects. 50 51For details of the stext:NvSciSync APIs and data structures, see the 52https://developer.nvidia.com/docs/drive/drive-os/latest/linux/sdk/api%5Freference/group%5F%5Fnvsci%5F%5Ftop.html[`NvStreams 53Documentation`]. 54 55include::{generated}/interfaces/VK_NV_external_sci_sync2.adoc[] 56 57=== Issues 58 591) Does this extension extend or replace `apiext:VK_NV_external_sci_sync`? 60 61RESOLVED. 62Replaces - expect to deprecate it and eventually remove it. 63 642) What part of `apiext:VK_NV_external_sci_sync` is deprecated/removed in 65this extension? 66 67RESOLVED. 68The commands to import and export semaphores from 69`apiext:VK_NV_external_sci_sync` are removed and have been replaced with an 70alternate mechanism to import semaphores. 71Fence import and export functionality is unchanged. 72 73In particular: 74 75 * Removed Commands: 76 ** flink:vkImportSemaphoreSciSyncObjNV 77 ** flink:vkGetSemaphoreSciSyncObjNV 78 * Removed Structures: 79 ** slink:VkImportSemaphoreSciSyncInfoNV 80 ** slink:VkExportSemaphoreSciSyncInfoNV 81 ** slink:VkSemaphoreGetSciSyncInfoNV 82 833) Application migration guide from `apiext:VK_NV_external_sci_sync` to 84`apiext:VK_NV_external_sci_sync2` 85 86 * In `apiext:VK_NV_external_sci_sync`, to import a stext:NvSciSyncObj to 87 slink:VkSemaphore, applications need to: 88 89 ** Create a slink:VkSemaphore by command flink:vkCreateSemaphore. 90 ** Call flink:vkImportSemaphoreSciSyncObjNV command to import the 91 stext:NvSciSyncObj to slink:VkSemaphore created. 92 ** Call flink:vkDestroySemaphore to destroy the slink:VkSemaphore after 93 all submitted batches that refer to it have completed execution. 94 95 * In order to migrate to `apiext:VK_NV_external_sci_sync2`, applications 96 need to: 97 98ifdef::VKSC_VERSION_1_0[] 99 ** Chain slink:VkDeviceSemaphoreSciSyncPoolReservationCreateInfoNV to 100 slink:VkDeviceObjectReservationCreateInfo and specify the 101 pname:semaphoreSciSyncPoolRequestCount maximum number of semaphore 102 SciSync pools that will be used simultaneously. 103endif::VKSC_VERSION_1_0[] 104 ** Import the a stext:NvSciSyncObj to a slink:VkSemaphoreSciSyncPoolNV by 105 command flink:vkCreateSemaphoreSciSyncPoolNV. 106 ** Select the slink:VkSemaphore from slink:VkSemaphoreSciSyncPoolNV by 107 passing the slink:VkSemaphoreSciSyncCreateInfoNV structure to 108 flink:vkCreateSemaphore. 109 ** Can call flink:vkDestroySemaphore to destroy the slink:VkSemaphore 110 immediately after all the batches that refer to it are submitted. 111ifndef::VKSC_VERSION_1_0[] 112 ** Call flink:vkDestroySemaphoreSciSyncPoolNV to destroy the semaphore 113 SciSync pool after all submitted batches that refer to it have 114 completed execution. 115endif::VKSC_VERSION_1_0[] 116 117=== Version History 118 119 * Revision 1, 2022-09-07 (Kai Zhang, Daniel Koch) 120 ** Initial revision 121