Setup#
Allocate, configure, and set up all resources before attempting any runtime calls. Due to safety requirements, NVIDIA does not recommend calling these setup APIs during runtime.
Check if the DLA software stack and hardware are up and running by using
NvMediaDlaPingById()
. This will send a ping to the DLA instance of the specified DLA hardware engine.
Note
The user should have a timeout for NvMediaDlaPingById()
and should ensure the return value is NVMEDIA_STATUS_OK
before calling any other NvMediaDLA
APIs.
Create an instance.
Configure and create an instance of a specified DLA hardware engine using NvMediaDlaCreate()
.
Note
A maximum of sixteen (16) NvMedia DLA instances can be created.
Initialize the instance.
Initialize the instance with the instance ID and number of tasks with API NvMediaDlaInit()
.
Create the loadable.
Create a loadable opaque handle with NvMediaDlaLoadableCreate()
. The handle is populated when the loadable is loaded into the instance.
Load the loadable.
Load a binary loadable into a DLA instance with the provided APIs in the following order:
NvMediaDlaAppendLoadable
NvMediaDlaLoadLoadable
Only one loadable can be appended to the instance. Clients must call NvMediaSetCurrentLoadable
to specify which loadable to work on. TensorRT builder creates the binary loadable.
Note
DLA has access to all of the available DRAM system memory. Please refer to TensorRT documentation herefor further details on configuring the size of the memory pools allocated to each DLA loadable.
Note
Upon successfully compiling loadables from the given network, the TensorRT Builder reports the number of subnetwork candidates that were successfully compiled into loadables, as well as the total amount of memory used per pool by those loadables. Please refer to TensorRT documentation here for further details
Note
The user must invoke the DLA Initialization APIs in the following order for proper setup of the NvMediaDla
and NvMediaDlaLoadable
contexts:
1. NvMediaDlaCreate()
2. NvMediaDlaInit()
3. NvMediaDlaLoadableCreate()
4. NvMediaDlaAppendLoadable()
5. NvMediaDlaSetCurrentLoadable()
6. NvMediaDlaLoadLoadable()
Register buffers.
Register all buffers that will be used with the instance. Registration API is NvMediaDlaDataRegister
.
Fill the NvSciSync attribute list.
The DLA instance fills in the NvSciSync attributes to provided memory with NvMediaDlaFillNvSciSyncAttrList
.
Register NvSciSync.
Register all NvSciSync objects that will be used with the instance. Registration API is NvMediaDlaRegisterNvSciSyncObj
.
Set the NvSciSync object.
Set end-of-frame (EOF) NvSciSync object or start-of-frame (SOF) NvSciSync object to the instance, if needed. The related APIs are NvMediaSetNvSciSyncObjforSOF
and NvMediaSetNvSciSyncObjforEOF
.