DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

System and Platform Information
Note
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

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.

...
// enumerate all available GPUs in the system and select first available dGPU
int32_t numGPUs = 0;
dwContext_getGPUCount(&numGPUs, sdkContext);
for (int32_t i=0; i < numGPUsl; i++)
{
dwContext_getGPUDeviceType(&type, i, sdkContext);
switch (type)
{
printf("GPU %d is a dGPU, set it as current GPU\n", i);
dwContext_selectGPUDevice(i, sdkContext);
break;
printf("GPU %d is an iGPU\n", i);
break;
default:
}
}
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 Obstacle Detection Sample (DriveNet).

// check if current platform supports DLA engine
int32_t numDLAs = 0;
dwContext_getDLAEngineCount(&numDLAs, sdkContext);
if (numDLAs == 0)
{
printf("The platform does not support DLA engine\n");
return 0;
}
// setup DriveNet to use DLA engine for inferencing
dwDriveNetParams driveNetParams = {};
...
// DLA supports only FP16 precision
dwDriveNet_initialize(&driveNet, ..., &driveNetParams, sdkContext);