Prerequisites for Generating Code for NVIDIA Boards - MATLAB & Simulink (original) (raw)

You must install required software and hardware to use NVIDIA® Jetson™ or NVIDIA DRIVE® boards with MATLAB®. To use the MATLAB Coder™ Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms, you must use a supported hardware board, install required software, and set up environment variables. To target GPU devices, you can also install GPU Coder™.

Target Requirements

The target NVIDIA board must be a supported board, and you must install NVIDIA software and other libraries on the board. The support package uses environment variables to locate the required software.

Target Hardware

TheMATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms supports these boards:

The support package uses an SSH connection over TCP/IP to execute commands while building and running the generated code on the Jetson or DRIVE platforms. Connect the target platform to the same network as the host computer. Alternatively, use an Ethernet crossover cable to connect the board directly to the host computer.

Note

On the Windows® platform, open port 18735 in the Windows Firewall settings. This port is required to establish a connection to the MATLAB server running on the embedded platforms.

Required Target Software

Use the NVIDIA JetPack (NVIDIA) or the DriveOS SDK (NVIDIA) software to install the OS image, developer tools, and the libraries required for developing applications on the Jetson or DRIVE platforms. You can use the Component Manager in the JetPack or the Drive Platform software to select the components to install on the target hardware. For installation instructions, refer to the NVIDIA board documentation. Install these libraries on the Jetson or DRIVE board:

The MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms supports these JetPack and DriveOS SDK versions.

Hardware Platform Software Version
Jetson AGX Orin JetPack 6.0 NoteBy default, JetPack 6 makes the GPIO pins of the board input-only. To use a GPIO pin for output, see the NVIDIA documentation to change the pinmux of the board.Generating code that uses the TensorRT library is not supported for boards configured with JetPack 6.1.
Jetson Orin Nano
Jetson Orin NX
Jetson AGX Xavier JetPack 5.1.1
Jetson Xavier NX
Clara AGX Holoscan SDK NoteGenerating code that uses the TensorRT library is not supported.Using the GPIO pins of the Clara AGX board is not supported.
Jetson Nano JetPack 4.6.1
Jetson TX1
Jetson TX2
DRIVE DRIVE OS 5.0.10.3-12606092

Optional Target Software

These features require additional software on the target:

Environment Variables on the Target

The support package uses environment variables to locate the tools, compilers, and libraries required for code generation. Set the environment variables in the table.

Variable Name Default Value Description
PATH /usr/local/cuda/bin Path to the CUDA toolkit executable on the Jetson or DRIVE platform.
LD_LIBRARY_PATH /usr/local/cuda/lib64 Path to the CUDA library folder on the Jetson or DRIVE platform.

The required environment variables must be accessible from non-interactive SSH logins. For example, you can use the export command at the beginning of the $HOME/.bashrc shell configuration file to add the environment variables.

Example .bashrc File

~/.bashrc: executed by bash(1) for non-login shells.

see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)

for examples

If not running interactively, don't do anything

case $- in i) ;; *) export PATH=$PATH:/usr/local/cuda/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 return;; esac

don't put duplicate lines or lines starting with space in the history.

See bash(1) for more options

HISTCONTROL=ignoreboth

append to the history file, don't overwrite it

shopt -s histappend

for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

HISTSIZE=1000 HISTFILESIZE=2000 . . .

Alternatively, you can set the system-wide environment variables in the/etc/environment file. You must havesudo privileges to edit this file.

Example /etc/environment File

PATH="/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" LD_LIBRARY_PATH="/usr/local/cuda/lib64/"

Input Devices

To record video or audio, connect:

Development Host Requirements

The development host computer must have MATLAB and MATLAB Coder. For processor-in-the-loop (PIL) execution, you must also install a supported compiler on the host computer. Optionally, to target GPU devices or generate code for deep learning applications, install additional MathWorks® software.

Optional MathWorks Software

To verify the GPU code generation environment on the Jetson or DRIVE, use the GPU Environment Check (GPU Coder) app or the coder.checkGpuInstall (GPU Coder) function.

See Also

Topics