To use GPU Coder™ for CUDA® C/C++ code generation, you must install the following products:
MATLAB Coder™ (required).
Parallel Computing Toolbox™ (required).
Deep Learning Toolbox™ (required for deep learning).
GPU Coder Interface for Deep Learning Libraries (required for deep learning).
Image Processing Toolbox™ (recommended).
Computer Vision Toolbox™ (recommended).
Embedded Coder® (recommended).
If MATLAB is installed on a path that contains non 7-bit ASCII characters, such as Japanese characters, MATLAB Coder does not work because it cannot locate code generation library functions.
For instructions on installing MathWorks® products, see the MATLAB installation documentation for your platform. If you have
installed MATLAB and want to check which other MathWorks products are installed, enter
ver in the MATLAB Command Window.
NVIDIA® GPU enabled for CUDA with compute capability 3.2 or higher (Is my GPU supported?).
CUDA toolkit and driver. It is recommended to select
the default installation options that includes
Thrust libraries, and other tools. GPU Coder has been tested with CUDA toolkit v10.1 (Get the CUDA toolkit).
GCC C/C++ compiler 6.3.x
Microsoft® Visual Studio® 2013
Microsoft Visual Studio 2015
Microsoft Visual Studio 2017
Microsoft Visual Studio 2019
On Windows, a space or special character in the path to the tools, compilers, and libraries can create issues during the build process. You must install third-party software in locations that does not contain spaces or change Windows settings to enable creation of short names for files, folders, and paths. For more information, see Using Windows short names solution in MATLAB Answers.
nvcc compiler relies on tight
integration with the host development environment,
including the host compiler and runtime libraries.
It is recommended that you follow the CUDA toolkit documentation for
detailed information on compiler, libraries, and
other platform specific requirements.
nvcc compiler supports
multiple versions of GCC and therefore you can
generate CUDA code with other versions of GCC.
However, there may be compatibility issues when
executing the generated code from MATLAB as the C/C++ run-time libraries that
are included with the MATLAB installation are compiled for GCC 6.3.
The Analyze Execution Profiles of the Generated Code workflow depends on the
tool from NVIDIA. In CUDA toolkit v10.1, NVIDIA restricts access to performance
counters to only admin users. To enable GPU
performance counters to be used by all users, see
the instructions provided in https://developer.nvidia.com/nvidia-development-tools-solutions-ERR_NVGPUCTRPERM-permission-issue-performance-counters.
GPU Coder does not support generating CUDA code by using CUDA toolkit version 8.
The code generation requirements for deep learning networks depends on the platform you are targeting.
|NVIDIA GPUs||ARM® Mali GPU|
CUDA enabled GPU with compute capability 3.2 or higher.
TensorRT™ libraries with
TensorRT libraries with
|ARM Mali graphics processor.|
CUDA Deep Neural Network library (cuDNN) v7 or higher.
NVIDIA TensorRT – high performance deep learning inference optimizer and runtime library, v5 or higher.
ARM Compute Library for computer vision and machine learning, v19.02. This library must be installed on the ARM target hardware.
Do not use a prebuilt library because it might be incompatible with the compiler on the ARM hardware. Instead, build the library from the source code. Build the library on either your host machine or directly on the target hardware. See instructions for building the library on GitHub®. You can also find information on building the library for CPUs in this post on MATLAB answers.
When building the Compute Library, enable OpenCL support in the build options. See the ARM Compute Library documentation for instructions.
OpenCL library (v1.2 or higher) on the ARM target hardware. See the ARM Compute Library documentation for version requirements.
After the build
is complete, rename the
|Operating System Support|
Windows and Linux.
Windows and Linux.
Open Source Computer Vision Library (OpenCV), v3.1.0 is required for deep learning examples.
Note: The examples require
separate libs such as,
information, refer to the
Open Source Computer Vision Library (OpenCV), v2.4.9 is required on the target hardware for deep learning examples.