NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.0 Release
For Test and Development only
NvSciBuf Enumerations for Attribute Keys

Detailed Description

List of all NvSciBuf enumerations for attribute keys.

Enumerations

enum  NvSciBufAttrKey {
  NvSciBufAttrKey_LowerBound = NV_SCI_BUF_GENERAL_ATTR_KEY_START,
  NvSciBufGeneralAttrKey_Types,
  NvSciBufGeneralAttrKey_NeedCpuAccess,
  NvSciBufGeneralAttrKey_RequiredPerm,
  NvSciBufGeneralAttrKey_EnableCpuCache,
  NvSciBufGeneralAttrKey_GpuId,
  NvSciBufGeneralAttrKey_CpuNeedSwCacheCoherency,
  NvSciBufGeneralAttrKey_ActualPerm,
  NvSciBufGeneralAttrKey_VidMem_GpuId,
  NvSciBufRawBufferAttrKey_Size = NV_SCI_BUF_RAW_BUF_ATTR_KEY_START,
  NvSciBufRawBufferAttrKey_Align,
  NvSciBufImageAttrKey_Layout = NV_SCI_BUF_IMAGE_ATTR_KEY_START,
  NvSciBufImageAttrKey_TopPadding,
  NvSciBufImageAttrKey_BottomPadding,
  NvSciBufImageAttrKey_LeftPadding,
  NvSciBufImageAttrKey_RightPadding,
  NvSciBufImageAttrKey_VprFlag,
  NvSciBufImageAttrKey_Size,
  NvSciBufImageAttrKey_Alignment,
  NvSciBufImageAttrKey_PlaneCount,
  NvSciBufImageAttrKey_PlaneColorFormat,
  NvSciBufImageAttrKey_PlaneColorStd,
  NvSciBufImageAttrKey_PlaneBaseAddrAlign,
  NvSciBufImageAttrKey_PlaneWidth,
  NvSciBufImageAttrKey_PlaneHeight,
  NvSciBufImageAttrKey_PlaneScanType,
  NvSciBufImageAttrKey_ScanType = NvSciBufImageAttrKey_PlaneScanType,
  NvSciBufImageAttrKey_PlaneBitsPerPixel,
  NvSciBufImageAttrKey_PlaneOffset,
  NvSciBufImageAttrKey_PlaneDatatype,
  NvSciBufImageAttrKey_PlaneChannelCount,
  NvSciBufImageAttrKey_PlaneSecondFieldOffset,
  NvSciBufImageAttrKey_PlanePitch,
  NvSciBufImageAttrKey_PlaneAlignedHeight,
  NvSciBufImageAttrKey_PlaneAlignedSize,
  NvSciBufImageAttrKey_ImageCount,
  NvSciBufTensorAttrKey_DataType = NV_SCI_BUF_TENSOR_ATTR_KEY_START,
  NvSciBufTensorAttrKey_NumDims,
  NvSciBufTensorAttrKey_SizePerDim,
  NvSciBufTensorAttrKey_AlignmentPerDim,
  NvSciBufTensorAttrKey_StridesPerDim,
  NvSciBufTensorAttrKey_PixelFormat,
  NvSciBufTensorAttrKey_BaseAddrAlign,
  NvSciBufTensorAttrKey_Size,
  NvSciBufArrayAttrKey_DataType = NV_SCI_BUF_ARRAY_ATTR_KEY_START,
  NvSciBufArrayAttrKey_Stride,
  NvSciBufArrayAttrKey_Capacity,
  NvSciBufArrayAttrKey_Size,
  NvSciBufArrayAttrKey_Alignment,
  NvSciBufPyramidAttrKey_NumLevels = NV_SCI_BUF_PYRAMID_ATTR_KEY_START,
  NvSciBufPyramidAttrKey_Scale,
  NvSciBufPyramidAttrKey_LevelOffset,
  NvSciBufPyramidAttrKey_LevelSize,
  NvSciBufPyramidAttrKey_Alignment,
  NvSciBufAttrKey_UpperBound = 0x3ffffffU
}
 Describes the NvSciBuf public attribute keys holding corresponding values specifying buffer constraints. More...
 

Enumeration Type Documentation

◆ NvSciBufAttrKey

Describes the NvSciBuf public attribute keys holding corresponding values specifying buffer constraints.

Input attribute keys specify desired buffer constraints and can be set/retrieved from unreconciled NvSciBufAttrList using NvSciBufAttrListGetAttrs()/NvSciBufAttrListSetAttrs() respectively. Output attribute keys specify actual buffer constraints computed by NvSciBuf if reconciliation succeeds. Output attributes can be retrieved from reconciled NvSciBufAttrList using NvSciBufAttrListGetAttrs().

Enumerator
NvSciBufAttrKey_LowerBound 

Specifies the lower bound value to check for a valid NvSciBuf attribute key type.

NvSciBufGeneralAttrKey_Types 

An array of all types that the buffer is expected to have.

For each type the buffer has, the associated attributes are valid. In order to set NvSciBufAttrKeys corresponding to the NvSciBufType, NvSciBufType must be set first using this key. NOTE: A single buffer may have multiple types. For example, a buffer may simultaneously be:

  • an NvSciBufType_Image (for integration with NvMedia)
  • an NvSciBufType_RawBuffer (for integration with CUDA kernels that will directly access it)

an NvSciBufType_Tensor (for integration with TensorRT or NvMedia) During reconciliation, if all the NvSciBufTypes specified by all the unreconciled NvSciBufAttrLists are same, this key outputs the specified NvSciBufType. If all NvSciBufTypes are not same, reconciliation succeeds only if the set of NvSciBufTypes contains NvSciBufType_Image and NvSciBufType_Tensor only otherwise reconciliation fails.

Type: Input/Output attribute

Datatype: NvSciBufType[]

NvSciBufGeneralAttrKey_NeedCpuAccess 

Specifies if CPU access is required for the buffer.

If this attribute is set to true, then the CPU will be able to obtain a pointer to the buffer from NvSciBufObjGetConstCpuPtr() if atleast read permissions are granted or from NvSciBufObjGetCpuPtr() if read/write permissions are granted.

for every peer owning the unreconciled NvSciBufAttrList(s) involved in reconciliation, if any of the unreconciled NvSciBufAttrList(s) owned by the peer set the key to true then value of this key is true in the reconciled NvSciBufAttrList sent to the peer otherwise its false.

Type: Input/Output attribute

Datatype: bool

NvSciBufGeneralAttrKey_RequiredPerm 

Specifies buffer access permissions.

If reconciliation succeeds, granted buffer permissions are reflected in NvSciBufGeneralAttrKey_ActualPerm. If NvSciBufGeneralAttrKey_NeedCpuAccess is true and write permission are granted, then NvSciBufObjGetCpuPtr() can be used to obtain a non-const pointer to the buffer. NOTE: Whether this key is present in reconciled attribute lists is unspecified, as is its value if it is present.

Type: Input attribute

Datatype: NvSciBufAttrValAccessPerm

NvSciBufGeneralAttrKey_EnableCpuCache 

Specifies whether to enable/disable CPU caching.

If set to true:

The CPU must perform write-back caching of the buffer to the greatest extent possible considering all the CPUs that are sharing the buffer. Coherency is guaranteed with:

  • Other CPU accessors.
  • All I/O-Coherent accessors that do not have CPU-invisible caches.

If set to false:

The CPU must not access the caches at all on read or write accesses to the buffer from applications. Coherency is guaranteed with:

  • Other CPU accessors.
  • All I/O accessors (whether I/O-coherent or not) that do not have CPU-invisible caches.

During reconciliation, this key is set to true in reconciled NvSciBufAttrList if any of the unreconciled NvSciBufattrList owned by any peer set it to true.

Type: Input/Output attribute

Datatype: bool

NvSciBufGeneralAttrKey_GpuId 

GpuIDs of the GPUs in the system that will access the buffer.

In a multi GPU System, if multiple GPUs are supposed to access the buffer, then provide the GPU IDs of all the GPUs that need to access the buffer. The GPU which is not specified in the list of GPUIDs may not be able to access the buffer.

During reconciliation, the value of this key in reconciled NvSciBufAttrList is equivalent to the aggregate of all the values specified by all the unreconciled NvSciBufAttrLists involved in reconciliation.

Type: Input/Output attribute

Datatype: NvSciRmGpuId[]

NvSciBufGeneralAttrKey_CpuNeedSwCacheCoherency 

Indicates whether the CPU is required to flush before reads and after writes.

This can be accomplished using NvSciBufObjFlushCpuCacheRange(), or (if the application prefers) with OS-specific flushing functions. It is set to true in reconciled NvSciBufAttrList if both NvSciBufGeneralAttrKey_EnableCpuCache and NvSciBufGeneralAttrKey_NeedCpuAccess are requested by setting them to true in any of the unreconciled NvSciBufAttrLists from which reconciled NvSciBufAttrList is obtained.

Type: Output attribute

Datatype: bool

NvSciBufGeneralAttrKey_ActualPerm 

Specifies the buffer access permissions to the NvSciBufObj.

This key is only valid in reconciled NvSciBufAttrList and undefined in unreconciled NvSciBufAttrList. If NvSciBufObj is obtained by calling NvSciBufObjAlloc(), NvSciBufGeneralAttrKey_ActualPerm is set to NvSciBufAccessPerm_ReadWrite in the reconciled NvSciBufAttrList corresponding to it since allocated NvSciBufObj gets read-write permissions by default.

For any peer importing the NvSciBufObj, this key is set in the reconciled NvSciBufAttrList to atleast the permissions requested by the peer via NvSciBufGeneralAttrKey_RequiredPerm

Type: Output attribute

Datatype: NvSciBufAttrValAccessPerm

NvSciBufGeneralAttrKey_VidMem_GpuId 

GPU ID of dGPU from which vidmem allocation should come when multiple GPUs are sharing buffer.

This key should be empty if multiple GPUs access shared buffer from sysmem.

Type: Input/Output attribute

Datatype: NvSciRmGpuId

NvSciBufRawBufferAttrKey_Size 

Specifies the size of the buffer to be allocated for NvSciBufType_RawBuffer.

Input size specified in unreconciled NvSciBufAttrList should be greater than 0. If reconciliation succeeds, output size reflected in reconciled NvSciBufAttrList will be equal or greater than input size.

Type: Input/Output attribute

Datatype: uint64_t

NvSciBufRawBufferAttrKey_Align 

Specifies the alignment requirement of NvSciBufType_RawBuffer.

Input alignment should be power of 2, output alignment will be power of 2 which is greater than or equal to input alignment.

Type: Input/Output attribute

Datatype: uint64_t

NvSciBufImageAttrKey_Layout 

Specifies the layout of NvSciBufType_Image: Block-linear or Pitch-linear.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: NvSciBufAttrValImageLayoutType

NvSciBufImageAttrKey_TopPadding 

Specifies the top padding for the NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_BottomPadding 

Specifies the bottom padding for the NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_LeftPadding 

Specifies the left padding for the NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_RightPadding 

Specifies the right padding for the NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_VprFlag 

Specifies the VPR flag for the NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: bool

NvSciBufImageAttrKey_Size 

Output size of the NvSciBufType_Image after successful reconciliation.

Type: Output attribute

Datatype: uint64_t

NvSciBufImageAttrKey_Alignment 

Output alignment of the NvSciBufType_Image after successful reconciliation.

Type: Output attribute

Datatype: uint64_t

NvSciBufImageAttrKey_PlaneCount 

Specifies the number of planes for NvSciBufType_Image.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint32_t

NvSciBufImageAttrKey_PlaneColorFormat 

Specifies the color format of the NvSciBufType_Image plane.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Dataype: NvSciBufAttrValColorFmt[]

NvSciBufImageAttrKey_PlaneColorStd 

Specifies a set of plane color standards.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Dataype: NvSciBufAttrValColorStd[]

NvSciBufImageAttrKey_PlaneBaseAddrAlign 

Specifies the NvSciBufType_Image plane base address alignment.

Input alignment should be power of 2, output alignment will be power of 2 which is greater than or equal to input alignment.

Type: Input/Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneWidth 

Specifies the NvSciBufType_Image plane width in pixels.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneHeight 

Specifies the NvSciBufType_Image plane height in pixels.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneScanType 

Specifies the NvSciBufType_Image scan type: Progressive or Interlaced.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: NvSciBufAttrValImageScanType

NvSciBufImageAttrKey_ScanType 
NvSciBufImageAttrKey_PlaneBitsPerPixel 

Indicates the NvSciBufType_Image plane in bits per pixel.

Type: Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneOffset 

Indicates the starting offset of the NvSciBufType_Image plane.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_PlaneDatatype 

Indicates the data type of the NvSciBufType_Image plane.

Type: Output attribute

Datatype: NvSciBufAttrValDataType[]

NvSciBufImageAttrKey_PlaneChannelCount 

Indicates the channel count in the NvSciBufType_Image plane.

Type: Output attribute

Datatype: uint8_t[]

NvSciBufImageAttrKey_PlaneSecondFieldOffset 

Indicates the offset of the start of the second field, 0 for progressive valid for interlaced.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_PlanePitch 

Indicates the pitch of the NvSciBufType_Image plane.

Type: Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneAlignedHeight 

Indicates the aligned height of the NvSciBufType_Image plane.

The value is power of 2.

Type: Output attribute

Datatype: uint32_t[]

NvSciBufImageAttrKey_PlaneAlignedSize 

Indicates the aligned size of the NvSciBufType_Image plane.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufImageAttrKey_ImageCount 

Attribute to specify number of NvSciBufType_Image(s) for which buffer should be allocated.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.NvSciBuf supports allocating buffer for single image only and thus, this attribute should be set to 1. A single buffer cannot be allocated for multiple images. Allocating 'N' buffers corresponding to 'N' images is allowed

Type: Input/Output attribute Datatype: uint64_t

NvSciBufTensorAttrKey_DataType 

Specifies the tensor data type.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: NvSciBufAttrValDataType

NvSciBufTensorAttrKey_NumDims 

Specifies the number of tensor dimensions.

A maximum of 8 dimensions are allowed. If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match. If NvSciBufType_Image and NvSciBufType_Tensor NvSciBufTypes are used in reconciliation, reconciliation succeeds only if this key is set to 4, since NvSciBuf only supports reconciliation of NvSciBufType_Tensor of NHWC type with NvSciBufType_Image.

Type: Input/Output attribute

Datatype: uint32_t

NvSciBufTensorAttrKey_SizePerDim 

Specifies the size of each tensor dimension.

This attribute takes size value in terms of an array. If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Note
Array indices are not tied to the semantics of the dimension if NvSciBufType_Tensor is the only NvSciBufType involved in reconciliation. If NvSciBufType_Tensor and NvSciBufType_Image are involved in reconciliation, NvSciBuf only supports reconciliation of NvSciBufType_Image with NHWC NvSciBufType_Tensor where N=1 and thus reconciliation succeeds only if value of dimension 0 is 1 and it matches with value of NvSciBufImageAttrKey_ImageCount, value of dimension 1 matches with value of NvSciBufImageAttrKey_PlaneHeight, value of dimension 2 matches with value of NvSciBufImageAttrKey_PlaneWidth and dimension 3 specifies channel count for NvSciBufAttrValColorFmt specified in NvSciBufTensorAttrKey_PixelFormat key

Type: Input/Output attribute

Datatype: uint64_t[]

NvSciBufTensorAttrKey_AlignmentPerDim 

Specifies the alignment constraints per tensor dimension.

Type: Input/Output attribute

Datatype: uint32_t[]

NvSciBufTensorAttrKey_StridesPerDim 

Returns the stride value (in bytes) for each tensor dimension.

Note
The returned array contains stride values in decreasing order. In other words, the index 0 of the array will have the largest stride while [number-of-dims - 1] index will have the smallest stride.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufTensorAttrKey_PixelFormat 

Attribute providing pixel format of the tensor.

This key needs to be set only if NvSciBufType_Image and NvSciBufType_Tensor are involved in reconciliation. Reconciliation succeeds only if value of this key matches with value of NvSciBufImageAttrKey_PlaneColorFormat. Image/Tensor reconciliation only supports NvSciColor_A8B8G8R8 and NvSciColor_Float_A16B16G16R16 color formats as of now.

Type: Input/Output attribute Datattype: NvSciBufAttrValColorFmt

NvSciBufTensorAttrKey_BaseAddrAlign 

Attribute providing base address alignment requirements for tensor.

Type: Input/Output attribute Datatype: uint64_t

NvSciBufTensorAttrKey_Size 

Size of buffer allocated for 'N' tensors.

Type: Output attribute

Datatype: uint64_t

NvSciBufArrayAttrKey_DataType 

Specifies the data type of a NvSciBufType_Array.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: NvSciBufAttrValDataType

NvSciBufArrayAttrKey_Stride 

Specifies the stride of each element in the NvSciBufType_Array.

Stride must be greater than or equal to size of datatype specified by NvSciBufArrayAttrKey_DataType. If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t

NvSciBufArrayAttrKey_Capacity 

Specifies the NvSciBufType_Array capacity.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint64_t

NvSciBufArrayAttrKey_Size 

Indicates the total size of a NvSciBufType_Array.

Type: Output attribute

Datatype: uint64_t

NvSciBufArrayAttrKey_Alignment 

Indicates the base alignment of a NvSciBufType_Array.

Type: Output attribute

Datatype: uint64_t

NvSciBufPyramidAttrKey_NumLevels 

Specifies the number of levels of images in a pyramid.

If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: uint32_t

NvSciBufPyramidAttrKey_Scale 

Specifies the scaling factor by which each successive image in a pyramid must be scaled.

Value must be 0 < scale <= 1. If more than one unreconciled NvSciBufAttrLists specify this input attribute, reconciliation is successful if all the input attributes of this type match.

Type: Input/Output attribute

Datatype: float

NvSciBufPyramidAttrKey_LevelOffset 

NvSciBuf allocates the total buffer size considering all levels in an image pyramid and returns an array of buffer offsets for each level.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufPyramidAttrKey_LevelSize 

NvSciBuf allocates the total buffer size considering all levels in an image pyramid and returns an array of buffer sizes for each level.

Type: Output attribute

Datatype: uint64_t[]

NvSciBufPyramidAttrKey_Alignment 

Alignment attribute of pyramid.

Type: Output attribute Datatype: uint64_t

NvSciBufAttrKey_UpperBound 

Specifies the maximum number of NvSciBuf attribute keys.

The total space for keys is 32K.

Datatype: None

Definition at line 369 of file nvscibuf.h.