Create configuration object containing the parameters passed to
coder.checkGpuInstall
for performing GPU code generation environment
checks
The coder.gpuEnvConfig
object contains the configuration
parameters that coder.checkGpuInstall
uses to verify the GPU code generation
environment.
gpuEnvObj = coder.gpuEnvConfig
creates a
gpuEnvConfig
configuration object for the host development
computer.
gpuEnvObj = coder.gpuEnvConfig(hw)
creates a
gpuEnvConfig
configuration object for the hardware type specified in
hw
. hw
can take the value of
'host'
, 'jetson'
, or 'drive'
.
The Jetson and DRIVE types require the GPU Coder™ Support Package for NVIDIA® GPUs.
Hardware
— Type of hardware'host'
(default) | 'jetson'
| 'drive'
This field is a read-only property set at the time of creating a
gpuEnvConfig
configuration object. This field can take the value of
'host'
, 'jetson'
, or 'drive'
.
The Jetson and DRIVE types require the GPU Coder Support Package for NVIDIA GPUs.
Example: gpuEnvObj.Hardware
GpuId
— Select GPU device0
(default) | integer
Select the GPU Device ID that must be used when the environment is checked. By
default, GpuId
is set to 0.
Example: gpuEnvObj.GpuId = 1;
BasicCodegen
— Enable code generation testfalse
(default) | true
When this field is set to true, basic GPU code generation check is performed. The generated code is not executed.
Example: gpuEnvObj.BasicCodegen = true;
BasicCodeexec
— Enable code generation and execution testfalse
(default) | true
When this field is set to true, basic GPU code generation and execution checks are performed on the selected GPU device.
Example: gpuEnvObj.BasicCodeexec = true;
DeepCodegen
— Enable deep learning code generation testfalse
(default) | true
When this field is set to true, deep learning GPU code generation check is performed
for the library target indicated by the DeepLibTarget
property. The
generated code is not executed.
Example: gpuEnvObj.DeepCodegen = true;
DeepCodeexec
— Enable deep learning code generation and execution testfalse
(default) | true
When this field is set to true, deep learning GPU code generation and execution
checks are performed for the library target indicated by the
DeepLibTarget
property on the selected GPU device.
Example: gpuEnvObj.DeepCodeexec = true;
DeepLibTarget
— Deep learning library''
(default) | 'cudnn'
| 'tensorrt'
This field indicates the library target for which deep learning code generation and execution checks are performed.
Example: gpuEnvObj.DeepLibTarget = 'cudnn';
DataType
— TensorRT data precision''
(default) | 'fp32'
| 'fp16'
| 'int8'
This field checks if the compute capability of the selected GPU device meets the minimum compute capability required for the selected TensorRT data precision.
Example: gpuEnvObj.DataType = 'fp32';
GenReport
— Enable HTML reportfalse
(default) | true
When this field is set to true, an HTML report of the results is generated in the current working folder. The current working folder must be write-enabled.
Example: gpuEnvObj.GenReport = true;
Quiet
— Suppress command-line outputfalse
(default) | true
When this field is set to true, the output printed on the command line is suppressed.
Example: gpuEnvObj.Quiet = true;
Profiling
— Check nvtx libraries for profilingfalse
(default) | true
Check for a properly configured NVTX library installation on the host machine. This library is used for profiling.
Example: gpuEnvObj.Profiling = true;
CudaPath
— Path to the CUDA librariescharacter vector
This field contains the path to the CUDA® libraries on the host. The default value is based on the current
nvcc
location found on the Linux OS and on the "CUDA_PATH"
environment variable in Windows OS. You can also modify this value to select a different
location.
Example: gpuEnvObj.CudaPath = '/usr/local/cuda';
CudnnPath
— Path to the cuDNN librariescharacter vector
This field contains the path to the cuDNN libraries on the host. The default value is based on the "NVIDIA_CUDNN" environment variable if set. You can also modify this value to select a different location.
Example: gpuEnvObj.CudnnPath =
'/usr/local/cuda/cudnn';
TensorrtPath
— Path to the TensorRT librariescharacter vector
This field contains the path to the TensorRT libraries on the host. The default value is based on the "NVIDIA_TENSORRT" environment variable if set. You can also modify this value to select a different location.
Example: gpuEnvObj.TensorrtPath =
'/usr/local/cuda/tensorrt';
NvtxPath
— Path to the NVTX librariescharacter vector
This field contains the path to the NVTX libraries on the host. The default value is based on the "NVTOOLSEXT_PATH" environment variable on Windows OS, if set. On Linux, it is obtained from the "LD_LIBRARY_PATH". You can also modify this value to select a different location.
Example: gpuEnvObj.NvtxPath = '/usr/local/cuda/';
HardwareObject
— Jetson or DRIVE objectobject
This field accepts a "jetson" or a "drive" hardware object. This field needs (for jetson/drive) to be set before running environment checks on the board.
Example: gpuEnvObj.Hardware = jetsonHwObj;
This example shows you how to verify that your development computer has all the tools and configuration needed for GPU code generation.
Create a coder.gpuEnvConfig
object that you can pass to the coder.checkGpuInstall
function.
In the MATLAB® Command Window, enter:
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'tensorrt';
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
results = coder.checkGpuInstall(gpuEnvObj)
The output shown here is representative. Your results might differ.
Compatible GPU : PASSED CUDA Environment : PASSED Runtime : PASSED cuFFT : PASSED cuSOLVER : PASSED cuBLAS : PASSED cuDNN Environment : PASSED TensorRT Environment : PASSED Basic Code Generation : PASSED Basic Code Execution : PASSED Deep Learning (TensorRT) Code Generation: PASSED Deep Learning (TensorRT) Code Execution: PASSED results = struct with fields: gpu: 1 cuda: 1 cudnn: 1 tensorrt: 1 basiccodegen: 1 basiccodeexec: 1 deepcodegen: 1 deepcodeexec: 1 tensorrtdatatype: 1 profiling: 0
codegen
| coder.CodeConfig
| coder.EmbeddedCodeConfig
| coder.MexCodeConfig