19 #ifndef INCLUDED_NVSCIBUF_H
20 #define INCLUDED_NVSCIBUF_H
28 #if defined(__cplusplus)
83 #if defined(__cplusplus)
174 #define NV_SCI_BUF_TENSOR_MAX_DIMS 8u
179 #define NV_SCI_BUF_IMAGE_MAX_PLANES 3u
184 #define NV_SCI_BUF_PYRAMID_MAX_LEVELS 10u
189 #define NVSCIBUF_EXPORT_DESC_SIZE 32u
195 #define NV_SCI_BUF_ATTRKEY_BIT_COUNT 16u
201 #define NV_SCI_BUF_DATATYPE_BIT_COUNT 10u
206 #define NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC 0
211 #define NV_SCI_BUF_KEYTYPE_BIT_START \
212 (NV_SCI_BUF_DATATYPE_BIT_COUNT + NV_SCI_BUF_ATTRKEY_BIT_COUNT)
217 #define NV_SCI_BUF_GENERAL_ATTR_KEY_START \
218 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
219 (NvSciBufType_General << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
224 #define NV_SCI_BUF_RAW_BUF_ATTR_KEY_START \
225 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
226 (NvSciBufType_RawBuffer << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
231 #define NV_SCI_BUF_IMAGE_ATTR_KEY_START \
232 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
233 (NvSciBufType_Image << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
238 #define NV_SCI_BUF_PYRAMID_ATTR_KEY_START \
239 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
240 (NvSciBufType_Pyramid << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
245 #define NV_SCI_BUF_ARRAY_ATTR_KEY_START \
246 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
247 (NvSciBufType_Array << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
252 #define NV_SCI_BUF_TENSOR_ATTR_KEY_START \
253 (NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC << NV_SCI_BUF_KEYTYPE_BIT_START) | \
254 (NvSciBufType_Tensor << NV_SCI_BUF_ATTRKEY_BIT_COUNT)
1057 NvSciBufAttrList* newAttrList);
1187 size_t inputCount, NvSciBufAttrList* newReconciledAttrList,
1188 NvSciBufAttrList* newConflictList);
1206 NvSciBufAttrList* newAttrList);
1227 const NvSciBufAttrList inputUnreconciledAttrListArray[],
1228 size_t inputUnreconciledAttrListCount,
1229 NvSciBufAttrList* newUnreconciledAttrList);
1244 bool* isReconciled);
1265 NvSciBufAttrList reconciledAttrList,
1266 const NvSciBufAttrList unreconciledAttrListArray[],
1267 size_t unreconciledAttrListCount,
bool* isReconcileListValid);
1314 NvSciBufAttrList attrListArray[],
size_t attrListCount,
1315 NvSciBufObj* bufObj, NvSciBufAttrList* newConflictList);
1345 NvSciBufAttrList* bufAttrList);
1387 uint64_t offset, uint64_t len);
1405 NvSciBufObj* bufObj);
1424 NvSciBufObj* newBufObj);
1458 void** attrListAndObjDesc,
size_t* attrListAndObjDescSize);
1487 size_t attrListAndObjDescSize, const NvSciBufAttrList attrList[],
1489 int64_t timeoutUs, NvSciBufObj* bufObj);
1520 NvSciBufObjIpcExportDescriptor* exportData);
1547 const NvSciBufObjIpcExportDescriptor* desc,
1548 NvSciBufAttrList reconciledAttrList,
1550 NvSciBufObj* bufObj);
1575 NvSciBufAttrList unreconciledAttrListArray[],
1577 void** descBuf,
size_t* descLen);
1601 void** descBuf,
size_t* descLen);
1632 NvSciBufAttrList* importedUnreconciledAttrList);
1667 NvSciBufAttrList inputUnreconciledAttrListArray[],
1668 size_t inputUnreconciledAttrListCount,
1669 NvSciBufAttrList* importedReconciledAttrList);
1740 bool* isCompatible);
1748 #if defined(__cplusplus)
1750 #endif // __cplusplus
Defines the export data (blob) for NvSciBufObj.
NvSciError NvSciBufAttrListCreate(NvSciBufModule module, NvSciBufAttrList *newAttrList)
Creates an attribute list holding the attributes of the NvSciBufObj to be allocated.
NvSciError NvSciBufAttrListGetAttrs(NvSciBufAttrList attrList, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
Returns an array of attribute key/value pairs for a given set of keys.
NvSciError NvSciBufAttrListValidateReconciled(NvSciBufAttrList reconciledAttrList, const NvSciBufAttrList unreconciledAttrListArray[], size_t unreconciledAttrListCount, bool *isReconcileListValid)
Validates a reconciled attribute list against a set of unreconciled attribute lists.
NvSciError NvSciBufObjGetConstCpuPtr(NvSciBufObj bufObj, const void **ptr)
Gets the CPU virtual address (VA) of the NvSciBufObj.
Specifies the maximum number of NvSciBuf attribute keys.
Indicates the channel count in the image plane.
#define NVSCIBUF_EXPORT_DESC_SIZE
Indicates the size of export descriptor.
Indicates the pitch of the image plane.
NvSciError NvSciBufAttrListReconcile(NvSciBufAttrList inputArray[], size_t inputCount, NvSciBufAttrList *newReconciledAttrList, NvSciBufAttrList *newConflictList)
Reconciles the given unreconciled attribute list(s) into a new reconciled attribute list...
NvSciBufAttrValColorStd
Defines the image color standard for NvSciBuf.
NvSciBufAttrValDataType
Defines various numeric datatypes for NvSciBuf.
NvSciBuf allocates the total buffer size considering all levels in an image pyramid and returns an ar...
Attribute providing pixel format of the tensor.
Defines GPU ID structure.
Specifies the access permissions that are provided.
Specifies the buffer array capacity.
Indicates the size of the image.
Indicates the aligned height of the image plane.
NVIDIA Software Communications Interface (SCI): Error Handling
void NvSciBufObjFree(NvSciBufObj bufObj)
Destroys the NvSciBuf object, which frees any memory allocated for it.
Specifies which access permissions are required.
uint64_t NvSciIpcEndpoint
Handle to the IPC endpoint.
Specifies the bottom padding for the image.
void NvSciBufAttrListFreeDesc(void *descBuf)
Frees the NvSciBuf exported attribute list descriptor.
void NvSciBufAttrListAndObjFreeDesc(void *attrListAndObjDescBuf)
Frees the descriptor used for exporting/importing both attrlist and NvSciBuf Object together...
Specifies the VPR flag for the image.
NvSciBufAttrValImageLayoutType
Defines the image layout type for NvSciBuf.
NvSciError NvSciBufAttrListReconcileAndObjAlloc(NvSciBufAttrList attrListArray[], size_t attrListCount, NvSciBufObj *bufObj, NvSciBufAttrList *newConflictList)
Reconcile the input unreconciled attribute list(s) into a new reconciled attribute list and allocate ...
NvSciError NvSciBufAttrListAppendUnreconciled(const NvSciBufAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciBufAttrList *newUnreconciledAttrList)
Append multiple unreconciled attribute lists together, forming a single new unreconciled attribute li...
Specifies the number of tensor dimensions.
Indicates whether the CPU is required to flush before reads and after writes.
Specifies the size of each tensor dimension.
Indicates the offset of the start of the second field, 0 for progressive valid for interlaced...
Indicates the base alignment of a buffer array.
Specifies a set of plane color standards.
Specifies the data type of a buffer array.
static const uint32_t NvSciBufMajorVersion
API Major version number.
#define NV_SCI_BUF_TENSOR_ATTR_KEY_START
Macro to specify the start of Tensor Datatype keys.
#define NV_SCI_BUF_IMAGE_ATTR_KEY_START
Indicates the start of Image Datatype keys.
#define NV_SCI_BUF_ATTR_KEY_TYPE_PUBLIC
Indicates the attribute key is a public key type.
size_t NvSciBufAttrListGetSlotCount(NvSciBufAttrList attrList)
Returns the slot count per key in an attribute list.
Indicates the color format of the image plane.
Indicates the starting offset of the image plane.
struct NvSciBufObjRefRec * NvSciBufObj
Holds a pointer to NvSciBufObjRefRec.
Specifies the image plane width in pixels.
Specifies the stride of each element in the buffer array.
#define NV_SCI_BUF_ARRAY_ATTR_KEY_START
Indicates the start of NvSciBuf Array Datatype keys.
#define NV_SCI_BUF_TENSOR_MAX_DIMS
Maximum number of dimensions supported by tensor datatype.
NvSciError NvSciBufAttrListDebugDump(NvSciBufAttrList attrList, void **buf, size_t *len)
Allocates a buffer and then dumps the contents of the specified attribute list into the buffer...
Indicates the image plane in bits per pixel.
Specifies the alignment requirement of raw buffer.
void NvSciBufAttrListFree(NvSciBufAttrList attrList)
Frees the memory of an attribute list.
Reserved for General keys.
NvSciError NvSciBufAttrListSetAttrs(NvSciBufAttrList attrList, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
Sets the attribute values in the attribute list.
Specifies the layout: Block-linear or Pitch-linear.
Specifies the tensor data type.
Specifies the scaling factor by which each successive image in a pyramid must be scaled.
Alignment attribute of pyramid.
NvSciError NvSciBufIpcExportAttrListAndObj(NvSciBufObj bufObj, NvSciBufAttrValAccessPerm permissions, NvSciIpcEndpoint ipcEndpoint, void **attrListAndObjDesc, size_t *attrListAndObjDescSize)
Exports an NvSciBuf attribute list and object into an NvSciIpc-transferable object binary descriptor...
Specifies the number of levels of images in a pyramid.
Usage of Auto permissions is restricted only for export, ! import APIs and shouldn't be used to set v...
NvSciError NvSciBufObjGetCpuPtr(NvSciBufObj bufObj, void **ptr)
Gets the CPU virtual address (VA) of the NvSciBufObj.
NvSciError NvSciBufIpcImportAttrListAndObj(NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *attrListAndObjDesc, size_t attrListAndObjDescSize, const NvSciBufAttrList attrList[], size_t count, NvSciBufAttrValAccessPerm minPermissions, int64_t timeoutUs, NvSciBufObj *bufObj)
This API is invoked by importing process after it receives the binary blob sent by the other process ...
NvSciBufAttrValImageScanType
Defines the image scan type for NvSciBuf.
Specifies the size of the buffer to allocate.
Specifies the right padding for the image.
#define NV_SCI_BUF_PYRAMID_MAX_LEVELS
Maximum number of levels supported by pyramid datatype.
NvSciError NvSciBufAttrListClone(NvSciBufAttrList origAttrList, NvSciBufAttrList *newAttrList)
Clones an unreconciled/reconciled attribute list.
NvSciError NvSciBufCheckVersionCompatibility(uint32_t majorVer, uint32_t minorVer, bool *isCompatible)
API to check if loaded library version is compatible with passed library build version.
struct NvSciBufAttrListRec * NvSciBufAttrList
Holds a pointer to NvSciBufAttrListRec.
NVIDIA Software Communications Interface (SCI) : NvSci Inter-Process Communication ...
NvSciError NvSciBufAttrListIpcExportUnreconciled(NvSciBufAttrList unreconciledAttrListArray[], size_t unreconciledAttrListCount, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
Transforms the input attribute list(s) to an exported attribute list descriptor that can be transport...
Specifies the image scan type: Progressive or Interlaced.
#define NV_SCI_BUF_PYRAMID_ATTR_KEY_START
Indicates the start of ImagePyramid Datatype keys.
#define NV_SCI_BUF_IMAGE_MAX_PLANES
Maximum number of planes supported by image datatype.
NvSciError NvSciBufAttrListIpcExportReconciled(NvSciBufAttrList reconciledAttrList, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
Transforms the input attribute list(s) to an exported attribute list descriptor that can be transport...
NvSciError NvSciBufObjFlushCpuCacheRange(NvSciBufObj bufObj, uint64_t offset, uint64_t len)
Flushes the given len bytes at starting offset offset in NvSciBufObj from all CPU-managed caches...
NvSciError NvSciBufObjDupWithReducePerm(NvSciBufObj bufObj, NvSciBufAttrValAccessPerm reducedPerm, NvSciBufObj *newBufObj)
Creates a Duplicate NvSciBufObj with reduced access permissions.
NvSciError NvSciBufAttrListIpcImportUnreconciled(NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, NvSciBufAttrList *importedUnreconciledAttrList)
Retrieves the attribute list from the attribute descriptor received over IPC channel.
NvSciError NvSciBufObjAlloc(NvSciBufAttrList reconciledAttrList, NvSciBufObj *bufObj)
Allocates an NvSciBuf object that meets all the constraints in the specified reconciled attribute lis...
struct NvSciBufModuleRec * NvSciBufModule
Holds a pointer to NvSciBufModuleRec.
NvSciBufAttrKey
Describes the public attribute keys.
enum NvSciErrorRec NvSciError
Return/error codes for all NvSci functions.
#define NV_SCI_BUF_DATATYPE_BIT_COUNT
Indicates number of bits used for defining datatype of a key.
NvSciError NvSciBufAttrListSlotGetAttrs(NvSciBufAttrList attrList, size_t slotIndex, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
Returns an array of attribute key/value pairs from a multi-slot unreconciled attribute list at the gi...
NvSciError NvSciBufAttrListIpcImportReconciled(NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, NvSciBufAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciBufAttrList *importedReconciledAttrList)
Retrieves the attribute list from the attribute descriptor received over IPC channel.
Specifies the number of image planes.
Specifies the left padding for the image.
NvSciBufAttrValColorFmt
Defines the image color formats for NvSciBuf.
GPU ID of dGPU from which vidmem allocation should come when multiple GPUs are sharing buffer and all...
GpuIDs of the GPUs in the system that will access the buffer.
NvSciBufType
Enum definitions of NvSciBuf Buffer datatype.
NvSciBuf allocates the total buffer size considering all levels in an image pyramid and returns an ar...
#define NV_SCI_BUF_GENERAL_ATTR_KEY_START
Indicates starting value of General attribute keys.
NvSciError NvSciBufObjIpcExport(NvSciBufObj bufObj, NvSciBufAttrValAccessPerm accPerm, NvSciIpcEndpoint ipcEndpoint, NvSciBufObjIpcExportDescriptor *exportData)
Exports a NvSciBuf object into an NvSciIpc-transferable object binary descriptor. ...
Specifies the alignment constraints per tensor dimension.
Attribute to specify number of images for which buffer should be allocated Type: Input attribute Data...
NvSciError NvSciBufModuleOpen(NvSciBufModule *newModule)
Initializes an instance of the NvSciBuf module within the calling process and provides an NvSciBufMod...
#define NV_SCI_BUF_ATTRKEY_BIT_COUNT
Indicates number of bits used for defining an attribute key.
Specifies the color format of the image plane.
void NvSciBufModuleClose(NvSciBufModule module)
Releases an instance of the NvSciBuf module obtained through an earlier call to NvSciBufModuleOpen()...
Specifies the image plane base address alignment.
#define NV_SCI_BUF_KEYTYPE_BIT_START
Global constant to specify the start-bit of attribute Keytype.
Specifies whether to enable/disable CPU caching.
Specifies if CPU access is required.
Indicates the alignment for the image.
Indicates the aligned size of the image plane.
An array of all types that the buffer is expected to have.
Specifies the image plane height in pixels.
NvSciError NvSciBufAttrListIsReconciled(NvSciBufAttrList attrList, bool *isReconciled)
Checks if an attribute list is reconciled.
NvSciBufAttrValAccessPerm
Defines access permissions for NvSciBuf.
NvSciError NvSciBufObjIpcImport(NvSciIpcEndpoint ipcEndpoint, const NvSciBufObjIpcExportDescriptor *desc, NvSciBufAttrList reconciledAttrList, NvSciBufAttrValAccessPerm minPermissions, int64_t timeoutUs, NvSciBufObj *bufObj)
Creates a NvSciBuf object based on supplied binary descriptor and returns the NvSciBuf object...
#define NV_SCI_BUF_RAW_BUF_ATTR_KEY_START
Indicates the start of Raw-buffer Datatype keys.
Defines a key/value pair of attribute to be set.
NvSciError NvSciBufObjGetAttrList(NvSciBufObj bufObj, NvSciBufAttrList *bufAttrList)
Retrieves the attribute list from an NvSciBuf object.
static const uint32_t NvSciBufMinorVersion
API Minor version number.
Attribute providing base address alignment requirements for tensor.
Specifies the top padding for the image.
Indicates the total size of a buffer array.
Specifies the lower bound value to check for a valid NvSciBuf attribute key type. ...
Returns the stride value (in bytes) for each tensor dimension.
NvSciError NvSciBufObjDup(NvSciBufObj bufObj, NvSciBufObj *dupObj)
Clones a NvSciBuf object.
Size of buffer allocated for 'N' tensors.