1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page core_usecase2 System and Platform Information
6 @section core_platforminfo_gpu GPU Enumeration and Selection
8 On NVIDIA DRIVE<sup>™</sup> systems, multiple GPUs are present and available for the SDK.
9 - Integrated GPU (iGPU) is a GPU that shares the same die as the
11 - Descrete GPU (dGPU) is a separate unit connected over a PCIEX bus with
14 At runtime, user applications can enumerate and select
15 these GPUs. Most of the NVIDIA<sup>®</sup> DriveWorks modules use the currently selected GPU.
18 #include <dw/core/context/Context.h>
22 // enumerate all available GPUs in the system and select first available dGPU
24 dwContext_getGPUCount(&numGPUs, sdkContext);
25 for (int32_t i=0; i < numGPUsl; i++)
28 dwContext_getGPUDeviceType(&type, i, sdkContext);
31 case DW_GPU_DEVICE_DISCRETE:
32 printf("GPU %d is a dGPU, set it as current GPU\n", i);
34 dwContext_selectGPUDevice(i, sdkContext);
38 case DW_GPU_DEVICE_INTEGRATED:
39 printf("GPU %d is an iGPU\n", i);
48 @note For applications that require access to GPU memory, ensure that such applications use the correct GPU.
50 @section core_platforminfo_dla DLA Engine Selection (Xavier SoC)
52 NVIDIA DRIVE<sup>™</sup> platforms with the NVIDIA Xavier SoC provide
53 a hardware-accelerated deep learning accelerator (DLA). DLA
54 accelerates inferencing of the networks, which frees up
55 NVIDIA<sup>®</sup> CUDA<sup>®</sup> units to perform
58 The following snippet shows how to activate a specific DLA engine for inferencing of DriveNet. For a full sample,
59 see @ref dwx_drivenet_sample.
63 // check if current platform supports DLA engine
65 dwContext_getDLAEngineCount(&numDLAs, sdkContext);
68 printf("The platform does not support DLA engine\n");
72 // setup DriveNet to use DLA engine for inferencing
73 dwDriveNetParams driveNetParams = {};
75 driveNetParams.processorType = DW_PROCESSOR_TYPE_DLA_0;
77 // DLA supports only FP16 precision
78 driveNetParams.networkPrecision = DW_PRECISION_FP16;
80 dwDriveNet_initialize(&driveNet, ..., &driveNetParams, sdkContext);