Installing Prerequisite Products
R2026bTo use GPU Coder™ for CUDA® code generation, you must install and set up the following products. For setup instructions, see Setting Up the Prerequisite Products.
MathWorks Products and Support Packages
MATLAB® (required)
MATLAB Coder™ (required)
Parallel Computing Toolbox™ (required)
Simulink® (required for generating code from Simulink models)
Simulink Coder (required for generating code from Simulink models)
Deep Learning Toolbox™ (required for deep learning)
GPU Coder Interface for Deep Learning support package (required for deep learning)
MATLAB Coder Support Package for NVIDIA® Jetson™ and NVIDIA DRIVE® Platforms (required for deployment to embedded targets such as NVIDIA Jetson and Drive)
Embedded Coder® (recommended)
Computer Vision Toolbox™ (recommended)
Image Processing Toolbox™ (recommended)
For instructions on installing MathWorks® products, see the MATLAB installation documentation for your platform. If you have MATLAB and want to check which other MathWorks products are installed, enter ver in the MATLAB Command Window.
To install the support packages, use the Add-On Explorer in MATLAB.
If you install MATLAB on a path that contains non-7-bit ASCII characters, such as Japanese characters, GPU Coder does not work because it cannot locate code generation library functions.
Third-Party Hardware
NVIDIA GPU enabled for CUDA with a compatible graphics driver. For more information, see CUDA GPU Compute Capability on the NVIDIA website.
This table lists the CUDA compute capability requirements for code generation.
Target Compute Capability CUDA MEX
Source code, static or dynamic library, and executables
3.2 or higher.
Deep learning applications in 8-bit integer precision
6.1, 7.0 or higher.
Deep learning applications in half-precision (16-bit floating point)
5.3, 6.0, 6.2 or higher.
ARM® Mali graphics processor.
For the Mali device, GPU Coder supports code generation for only deep learning networks.
Third-Party Software
GPU Coder requires third-party software to build and execute generated code. For desktop GPUs, you must install a compatible host compiler and NVIDIA display driver. You can install additional software to compile standalone code or generate code that uses deep learning libraries.
For NVIDIA Jetson or NVIDIA DRIVE hardware, install the NVIDIA JetPack™ or NVIDIA DriveOS™ software, respectively. Additionally, you must set up the board by using the Hardware Setup tool. For more information, see Prerequisites for Generating Code for NVIDIA Boards.
Host Compiler
To build CUDA code, install a host compiler that is compatible with NVIDIA CUDA Toolkit version 13.1. This table lists compatible compilers. On Windows®, install the Microsoft® Visual Studio® IDE with the Microsoft Visual C++® compiler.
Linux® Compiler | Windows IDE | Windows Compiler |
|---|---|---|
GCC C/C++ compiler For supported versions, see Supported and Compatible Compilers. | Microsoft Visual Studio 2022 versions 17.0 through 17.9 | Microsoft Visual C++ compiler version 19.3x |
Microsoft Visual Studio 2019 version 16.x | Microsoft Visual C++ compiler version 19.2x |
Note
The Microsoft Visual C++ 2026 compiler is not compatible with CUDA Toolkit version 13.1 and is not supported.
NVIDIA Display Driver
To run compiled CUDA code, install the latest NVIDIA display driver for your system. Download drivers for your GPU from Drivers on the NVIDIA website.
Optional Software
Building standalone source code, executables, and libraries requires additional software. To build standalone code for deployment to NVIDIA GPUs, you must install the NVIDIA CUDA Toolkit. To generate standalone code that uses third-party libraries, install the version of the library in this table. To generate code for deep learning networks that does not use third-party libraries, see Code Generation for Deep Learning Networks.
| Software Name | Version | Additional Information |
|---|---|---|
CUDA Toolkit | 13.1 (since R2026b) | Install the latest update of CUDA Toolkit version 13.1. To download the CUDA Toolkit, see CUDA Toolkit Archive on the NVIDIA website. |
NVIDIA CUDA Deep Neural Network library (cuDNN) for NVIDIA GPUs | 9.20 (since R2026b) | GPU Coder does not support cuDNN version 7 and earlier. To download cuDNN, see NVIDIA cuDNN on the NVIDIA website. |
NVIDIA TensorRT™ high-performance inference optimizer and runtime library | 10.15 (since R2026b) | GPU Coder does not support TensorRT version 7 and earlier. To use the
TensorRT library to build MEX functions or accelerate
Simulink simulations, you must install it by using
To use TensorRT in standalone code, download it from NVIDIA TensorRT on the NVIDIA website. |
ARM Compute Library for Mali GPUs | 19.05 | For more information, see Arm Compute Library on the ARM website. |
Tips
See Also
Apps
Functions
Objects
Topics
- Setting Up the Prerequisite Products
- The GPU Environment Check and Setup App
- Generate Code by Using the GPU Coder App
- Generate Code Using the Command Line Interface
- Code Generation for Deep Learning Networks by Using cuDNN
- Code Generation for Deep Learning Networks by Using TensorRT
- Code Generation for Deep Learning Networks Targeting ARM Mali GPUs