Main Content

jetson

Create connection to NVIDIA Jetson hardware

Description

Add-On Required: This feature requires the MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms add-on.

obj = jetson creates a connection, obj, from the MATLAB® software to the NVIDIA® Jetson™ hardware. Use this syntax to connect or reconnect to the same hardware. You do not need to supply the device address, user name, and password. The jetson object reuses these settings from the most recent successful connection to the Jetson hardware.

example

obj = jetson(deviceaddress,username,password) overrides the device address, user name, and password from the previous connection. Use this syntax to connect to hardware whose settings are different from the previous successful connection. The Jetson hardware has two default user names: 'nvidia' and 'ubuntu'. For 'nvidia', the default password is 'nvidia'. For 'ubuntu', the default password is 'ubuntu'. It is a good security practice to create a strong password after the first login. After changing the hardware password, or after connecting from the MATLAB software to a different piece of Jetson hardware, use this syntax.

After connecting to the hardware, you can use the obj object to interact with the Jetson hardware and attached peripherals such as a camera. To close the connection, use clear to remove obj and connections that use obj.

example

Examples

collapse all

This example shows you how to create a connection from the MATLAB software to the NVIDIA Jetson hardware. Connect the Jetson hardware to the same TCP/IP network as the host computer. This example uses the device address, user name, and password settings from the most recent successful connection to the Jetson hardware.

Create a connection, hwObj, to the NVIDIA Jetson hardware.

hwObj = jetson
### Checking for CUDA availability on the target...
### Checking for 'nvcc' in the target system path...
### Checking for cuDNN library availability on the target...
### Checking for TensorRT library availability on the target...
### Checking for prerequisite libraries is complete.
### Gathering hardware details...
### Checking for third-party library availability on the target...
### Gathering hardware details is complete.
Board name              : NVIDIA Jetson Nano Developer Kit
CUDA Version            : 10.2
cuDNN Version           : 8.2
TensorRT Version        : 8.2
GStreamer Version       : 1.14.5
V4L2 Version            : 1.14.2-1
SDL Version             : 1.2
OpenCV Version          : 4.1.1
Available Webcams       :  
Available GPUs          : NVIDIA Tegra X1
Available Digital Pins  : 7  11  12  13  15  16  18  19  21  22  23  24  26  29  31  32  33  35  36  37  38  40

hwObj = 

  jetson with properties:

           DeviceAddress: 'jetson-nano-1'
                    Port: 22
               BoardName: 'NVIDIA Jetson Nano Developer Kit'
             CUDAVersion: '10.2'
            cuDNNVersion: '8.2'
         TensorRTVersion: '8.2'
              SDLVersion: '1.2'
             V4L2Version: '1.14.2-1'
        GStreamerVersion: '1.14.5'
           OpenCVVersion: '4.1.1'
                 GPUInfo: [1×1 struct]
              WebcamList: []
    AvailableDigitalPins: [7 11 12 13 15 16 18 19 21 22 23 24 26 29 31 32 33 35 36 37 38 40]
       AvailableI2CBuses: {'i2c-0'  'i2c-1'}

The MATLAB Coder™ Support Package for NVIDIA Jetson and NVIDIA DRIVE® Platforms establishes an SSH connection to the Jetson hardware using the settings stored in memory. It checks for the CUDA® toolkit, cuDNN, and TensorRT libraries on the target hardware and displays this information on the MATLAB Command Window. To set up the environment variables on the board for the compiler and the libraries, see Prerequisites for Generating Code for NVIDIA Boards.

To get the L4T software version on the Jetson board, use the getL4TVersion method of the jetson connection object.

getL4TVersion(hwObj);
Jetson L4T version is: L4T R32.7.1.

To start a PuTTY SSH terminal session on the Jetson board, use the openShell method of the jetson connection object. After logging into the Linux® shell, you execute shell commands such as ls

openShell(hwObj);
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.9.253-tegra aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

30 packages can be updated.
0 updates are security updates.

ubuntu@tegra-ubuntu:~$ ls
Desktop    gpucoderTX2       Music     remoteBuildDir  Videos
Documents  jetson_clocks.sh  Pictures  tegrastats      weston.ini
Downloads  MATLAB            Public    Templates
ubuntu@tegra-ubuntu:~$

To close the connection, use clear to remove hwObj and connections that use hwObj.

clear hwObj;

This example shows you how to create a connection from the MATLAB software to the NVIDIA Jetson hardware that has different device address, user name, and password settings from the previous successful connection.

Create a connection, hwJetson, from the MATLAB software to NVIDIA Jetson hardware.

hwJetson = jetson('169.254.0.2','nvidia','nvidia');
Checking for CUDA availability on the Target...
Checking for 'nvcc' in the target system path...
Checking for cuDNN library availability on the Target...
Checking for TensorRT library availability on the Target...
Checking for prerequisite libraries is complete.
Gathering hardware details...
Checking for third-party library availability on the Target...
Gathering hardware details is complete.
 Board name         : NVIDIA Jetson TX2
 CUDA Version       : 9.0
 cuDNN Version      : 7.0
 TensorRT Version   : 3.0
 GStreamer Version  : 1.14.5
 V4L2 Version       : 1.14.2-1
 SDL Version        : 1.2
 Available Webcams  : Microsoft® LifeCam Cinema(TM)
 Available GPUs     : NVIDIA Tegra X2

hwJetson = 

  jetson with properties:

       DeviceAddress: '169.254.0.2'
                Port: 22
           BoardName: 'NVIDIA Jetson TX2'
         CUDAVersion: '9.0'
        cuDNNVersion: '7.0'
     TensorRTVersion: '3.0'
          SDLVersion: '1.2'
         V4L2Version: '1.14.2-1'
    GStreamerVersion: '1.14.5'
             GPUInfo: [1×1 struct]
          WebcamList: {'Microsoft® LifeCam Cinema(TM)'}

Input Arguments

collapse all

IP address or host name of the hardware, specified as a character vector or string.

To use the host name, you must connect an Ethernet cable to the Ethernet port of the board. Use Linux commands to configure the hardware IP address and associate the host name with the IP address.

Example: '169.254.0.2'

Example: 'jetson-board-name'

Linux user name, specified as a character vector or string.

Example: 'ubuntu'

Password associated with the Linux user name, specified as a character vector or string.

Example: 'ubuntu'

Output Arguments

collapse all

A connection from the MATLAB software to the Jetson hardware, returned as a jetson object.

Version History

Introduced in R2018b