Main Content

coder.checkGpuInstall

Verify GPU code generation environment

Description

results = coder.checkGpuInstall(cfg) performs checks to verify if your environment has all the third-party tools and libraries required for GPU code generation. cfg must be an coder.gpuEnvConfig object. This function verifies the GPU code generation environment based on the properties specified in the given configuration object.

You can also use the equivalent GUI-based application, GPU Environment Check that performs the same checks. To open this application, use the MATLAB® command, gpucoderSetup.

Before using this function, install and set up the required prerequisite third-party compilers, libraries, and tools. For more information, see Installing Prerequisite Products and Setting Up the Prerequisite Products.

example

Examples

collapse all

Perform a complete check of all third-party tools required for GPU code generation. The output shown here is representative. Your results might differ.

gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.GpuId = 1;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
results = coder.checkGpuInstall(gpuEnvObj)
Compatible GPU           : PASSED 
CUDA Environment         : PASSED 
	Runtime   : PASSED 
	cuFFT     : PASSED 
	cuSOLVER  : PASSED 
	cuBLAS    : PASSED 
Host Compiler            : PASSED 
Basic Code Generation    : PASSED 
Basic Code Execution     : PASSED 

results = 

  struct with fields:

                 gpu: 1
                cuda: 1
               cudnn: 0
            tensorrt: 0
        hostcompiler: 1
        basiccodegen: 1
       basiccodeexec: 1
         deepcodegen: 0
    tensorrtdatatype: 0
        deepcodeexec: 0

Input Arguments

collapse all

GPU code generation environment configuration, specified as a coder.gpuEnvConfig object.

Output Arguments

collapse all

GPU environment checking results, returned as a 1-by-1 structure of Boolean values that indicate the output of each check. This table shows what each field of the results structure represents.

FieldDescription
gpuThere is a supported GPU connected to MATLAB.
cudaThere is a supported CUDA® Toolkit installation on the development host and, if you specified a hardware object, on the hardware.
cudnnThere is a supported cuDNN installation on the development host and, if you specified a hardware object, on the hardware.
tensorrtThere is a supported TensorRT™ installation on the development host and, if you specified a hardware object, on the hardware.
hostcompilerThere is a supported compiler installed on the development host.
basiccodegenThe selected hardware passed the check to generate CUDA code.
basiccodeexecThe selected hardware passed the check to generate and execute CUDA code.
deepcodegenThe selected hardware passed the check to generate CUDA code for deep learning.
tensorrtdatatypeThe selected hardware has at least the minimum compute capability for the selected TensorRT data type.
deepcodeexecThe selected hardware passed the check to generate and execute CUDA code for deep learning.

Version History

Introduced in R2017b