Main Content

coder.gpuEnvConfig

Create configuration object containing the parameters passed to coder.checkGpuInstall for performing GPU code generation environment checks

Since R2019a

Description

The coder.gpuEnvConfig object contains the configuration parameters that coder.checkGpuInstall uses to verify the GPU code generation environment.

Creation

Description

gpuEnvObj = coder.gpuEnvConfig creates a gpuEnvConfig configuration object for the host development computer.

example

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 MATLAB® Coder™ Support Package for NVIDIA® Jetson™ and NVIDIA DRIVE™ Platforms.

Properties

expand all

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 MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE® Platforms.

Example: gpuEnvObj.Hardware

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;

When this field is set to true, basic GPU code generation check is performed. The generated code is not executed.

Example: gpuEnvObj.BasicCodegen = 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;

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;

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;

This field indicates the library target for which deep learning code generation and execution checks are performed.

Example: gpuEnvObj.DeepLibTarget = 'cudnn';

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';

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;

When this field is set to true, the output printed on the command line is suppressed.

Example: gpuEnvObj.Quiet = true;

Check for a properly configured NVTX library installation on the host machine. This library is used for profiling.

Example: gpuEnvObj.Profiling = true;

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';

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';

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';

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/';

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;

Specify the time in seconds that the software waits before validating the execution tests on the target.

Example: gpuEnvObj.ExecTimeout = 25;

Examples

collapse all

This example shows you how to verify that your development computer has all the tools and configuration required 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

Version History

Introduced in R2019a