GPU Enumeration and Selection
On NVIDIA DRIVE™ systems, multiple GPUs are present and available for the SDK.
- Integrated GPU (iGPU) is a GPU that shares the same die as the ARM CPU.
- Descrete GPU (dGPU) is a separate unit connected over a PCIEX bus with the main CPU.
At runtime, user applications can enumerate and select these GPUs. Most of the NVIDIA® DriveWorks modules use the currently selected GPU.
...
int32_t numGPUs = 0;
for (int32_t i=0; i < numGPUsl; i++)
{
switch (type)
{
printf("GPU %d is a dGPU, set it as current GPU\n", i);
break;
printf("GPU %d is an iGPU\n", i);
break;
default:
}
}
NVIDIA DriveWorks API: Core Methods
DW_API_PUBLIC dwStatus dwContext_getGPUCount(int32_t *const count, dwContextHandle_t const context)
Get the available GPU devices count.
DW_API_PUBLIC dwStatus dwContext_getGPUDeviceType(dwGPUDeviceType *const deviceType, int32_t const deviceNum, dwContextHandle_t const context)
Returns the device type of the input GPU number.
DW_API_PUBLIC dwStatus dwContext_selectGPUDevice(int32_t const deviceNumber, dwContextHandle_t const context)
Selects a GPU device, if available.
dwGPUDeviceType
GPU device type definitions Only applicable on Drive platforms.
@ DW_GPU_DEVICE_INTEGRATED
- Note
- For applications that require access to GPU memory, ensure that such applications use the correct GPU.
DLA Engine Selection (Xavier SoC)
NVIDIA DRIVE™ platforms with the NVIDIA Xavier SoC provide a hardware-accelerated deep learning accelerator (DLA). DLA accelerates inferencing of the networks, which frees up NVIDIA® CUDA® units to perform other tasks.
The following snippet shows how to activate a specific DLA engine for inferencing of DriveNet. For a full sample, see DriveNet Sample.
int32_t numDLAs = 0;
if (numDLAs == 0)
{
printf("The platform does not support DLA engine\n");
return 0;
}
dwDriveNetParams driveNetParams = {};
...
dwDriveNet_initialize(&driveNet, ..., &driveNetParams, sdkContext);
DW_API_PUBLIC dwStatus dwContext_getDLAEngineCount(int32_t *const count, dwContextHandle_t const context)
Get the available DLA engines count.
@ DW_PROCESSOR_TYPE_DLA_0
@ DW_PRECISION_FP16
FP16 precision.