メインコンテンツ

Prerequisites for Generating Code for NVIDIA Boards

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

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

  • NVIDIA DRIVE PX 2

  • NVIDIA Clara AGX™

  • NVIDIA Jetson AGX Xavier™

  • NVIDIA Jetson AGX Orin™

  • NVIDIA Jetson Orin Nano

  • NVIDIA Jetson Orin NX

  • NVIDIA Jetson Nano™

  • NVIDIA Jetson TX1

  • NVIDIA Jetson TX2

  • NVIDIA Jetson Xavier NX

  • NVIDIA Jetson AGX Thor™

  • NVIDIA IGX Orin

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 SDK Manager to install the SDK required for developing applications on Jetson or DRIVE platforms. For more information, see SDK Manager on the NVIDIA website. Install the operating system and these libraries on the Jetson or DRIVE board:

  • CUDA® toolkit

  • GStreamer library version 1.0 or higher

Optionally, install the NVIDIA CUDA Deep Neural Network (cuDNN) and NVIDIA TensorRT™ libraries.

This table shows the SDK versions that MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms supports for these hardware platforms:

Hardware PlatformSoftware Version

Jetson AGX Thor

JetPack 7.0

IGX Orin

IGX-SW 1.1

To install IGX software, see IGX Download Center on the NVIDIA website.

Jetson AGX Orin

JetPack 6.0

Note

  • By default, JetPack 6 configures the GPIO pins to only accept inputs. To use a GPIO pin for output, change the pinmux of the board. For more information, see the NVIDIA documentation.

  • Generating and deploying code that uses the TensorRT library is not supported for boards using JetPack 6.1 or later.

Jetson Orin Nano

Jetson Orin NX

Jetson AGX Xavier

JetPack 5.1.1

Jetson Xavier NX

Clara AGX

Holoscan SDK

Note

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

If you target an IGX Orin, AGX Thor, or Clara AGX board, generating and deploying code that uses the NVIDIA TensorRT library is not supported.

Optional Target Software

These features require additional software on the target:

  • To run webcam examples, install version 1.2 of the Simple DirectMedia Layer library, the V4L2 library, and the V4L2 utilities. You must also install the development packages for these libraries. To install these libraries, use these commands:

    sudo apt-get install libsdl1.2debian libsdl1.2-dev v4l-utils
  • To deploy the Audio File Read Simulink® block, install the Sound eXchange (SoX) utility and its development and format libraries. To install these libraries on Jetson, use the apt-get command.

    sudo -S apt-get -y install sox libsox-fmt-all libsox-dev alsa-utils
  • To use Modbus® functions and blocks, install the libmodbus libraries from https://github.com/stephane/libmodbus. To install these libraries, use these commands:

    git clone https://github.com/stephane/libmodbus
    cd libmodbus
    ./autogen.sh
    ./configure && sudo make install
    
  • To use MQTT Publish and MQTT Subscribe blocks, install the MQTT library from https://github.com/eclipse-paho/paho.mqtt.c. You must also install the json-c library.

    To install the MQTT library, use these commands:

    git clone https://github.com/eclipse/paho.mqtt.c.git
    cd paho.mqtt.c
    make
    sudo -S make install

    To install the json-c library, use these commands:

    sudo apt install libjson-c-dev

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 NameDefault ValueDescription
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

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

 Example /etc/environment File

Input Devices

To record video or audio, connect:

  • A camera connected to the USB or CSI port of the target hardware

  • A USB audio device

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

  • GPU Coder— Required for GPU targeting

  • Parallel Computing Toolbox™— Required for GPU targeting

  • Simulink— Required for generating code from Simulink models

  • Simulink Coder— Required for generating code from Simulink models

  • Deep Learning Toolbox™— Required for deep learning

  • MATLAB Coder Interface for Deep Learning and GPU Coder Interface for Deep Learning support packages— Required for deep learning

  • Embedded Coder®— Recommended

  • Computer Vision Toolbox™— Recommended

  • Image Processing Toolbox™— Recommended

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