jetson

Connection to NVIDIA Jetson hardware

Description

This object represents a connection from the MATLAB® software to the NVIDIA® Jetson hardware. To create this object, use the jetson function. To interact with the Jetson hardware, use this object with the functions listed in Object Functions.

Creation

jetson

Properties

expand all

This property is read-only.

The name of the target Jetson board, returned as a character vector.

Example: 'NVIDIA Jetson TX2'

Data Types: char

This property is read-only.

Version number of the CUDA toolkit installed on the Jetson board, returned as a character vector.

Example: '9.0'

Data Types: char

This property is read-only.

Version number of the CUDA Deep Neural Network library (cuDNN) installed on the Jetson board, returned as a character vector.

Example: '7.0'

Data Types: char

This property is read-only.

The IP address or host name of the Ethernet port on the Jetson board, returned as a character vector.

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 hardware IP address.

Example: '169.254.0.2''gpucoder-tx2-1'

Data Types: char

This property is read-only.

Additional information on the GPU of the Jetson board, returned as a 1-by-1 structure. To access this structure use objectName.GpuInfo. The structure contains the following fields:

NameDescription

Name

Name of the CUDA device.

Index

Index of the selected GPU device.

ComputeCapability

Computational capability of the CUDA device.

CUDADriverVersion

The CUDA device driver version on the board currently in use.

CUDAToolkitVersion

Version of the CUDA toolkit on the board.

MaxThreadsPerBlock

Maximum supported number of threads per block during CUDA kernel execution.

MaxSharedMemPerBlock

Maximum amount of shared memory that a thread block can use during CUDA kernel execution.

MaxThreadBlockSize

Maximum size in each dimension for thread block.

MaxGridSize

Maximum size of grid of thread blocks.

AvailableMemory

Total amount of memory (in bytes) available for data.

TotalConstMem

Total amount of constant memory (in bytes) available for data.

MultiprocessorCount

The number of vector processors present on the device.

TotalCUDACores

Total number of CUDA cores available on the target board.

MaxThreadsPerSM

Maximum number of threads per symmetric multiprocessor.

For example, a Jetson TX2 board has the following values:

hwJetson.GpuInfo

ans = 

  struct with fields:

                    Name: 'NVIDIA Tegra X2'
                   Index: 0
       ComputeCapability: 6.2000
       CUDADriverVersion: 9
      CUDAToolkitVersion: 9
      MaxThreadsPerBlock: 1024
    MaxSharedMemPerBlock: 49152
      MaxThreadBlockSize: [1024 1024 64]
             MaxGridSize: [2.1475e+09 65535 65535]
         AvailableMemory: 8.2358e+09
           TotalConstMem: 65536
     MultiprocessorCount: 2
          TotalCUDACores: 256
         MaxThreadsPerSM: 2048

Data Types: struct

This property is read-only.

The SSH port number on the Jetson board, returned as an integer.

Example: 22

Data Types: integer

This property is read-only.

Version number of the NVIDIA TensorRT library installed on the Jetson board, returned as a character vector.

Example: '3.0'

Data Types: char

This property is read-only.

A list of the web cameras that are available, returned as a cell array of strings.

Example: {'Microsoft(R) LifeCam Cinema (TM)'}

Data Types: cell

This property is read-only.

Path to the code generation (codegen) folder on the target platform for the most recent successful build. You can use this path to identify the location of the generated source files and the executables for 'exe' builds.

Example: '/home/ubuntu/myLiveEdgeDetect/MATLAB_ws/R2019a/home/gpucoder/myLiveEdgeDetection'

Data Types: char

Object Functions

getFileTransfer file from NVIDIA hardware to host computer
putFileTransfer file from host computer to target hardware
deleteFileDelete file on target hardware
openShellOpen terminal on host computer to use Linux shell on NVIDIA hardware
systemRun command in Linux shell on NVIDIA hardware
getL4TVersionGet the L4T version of the NVIDIA Jetson hardware
getPdkorSdkVersionGet the current DriveWorks SDK installed on the DRIVE hardware
setupCodegenContextSelect the target hardware to build code for from multiple live connection objects
webcamCreate webcam object to acquire images from a webcam attached to the NVIDIA DRIVE or Jetson hardware
updatePeripheralInfoScan for and update the list of peripherals connected to the target hardware
getLinuxVersionGet information about the Linux environment on the target
imageDisplayCreate imageDisplay object for displaying images on NVIDIA DRIVE or Jetson targets
getPILPortGet the TCP/IP port number used by the PIL execution
getPILTimeoutGet the timeout value that PIL uses for reading data
setPILPortSet the TCP/IP port number used by the PIL execution
setPILTimeoutSet the timeout value that PIL uses for reading data
killApplicationKill an application on the NVIDIA target by name
killProcessKill a process on the NVIDIA target by ID
runApplicationLaunch an application on the NVIDIA target by name
runExecutableLaunch an executable on the NVIDIA target by name
getDisplayEnvironmentGet the display environment value used for redirecting the display on the target
setDisplayEnvironmentSet the display environment value used for redirecting the display on the target

Examples

collapse all

This example shows you how to create a connection from the MATLAB software to the NVIDIA Jetson hardware. The Jetson hardware is connected 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, hwJetson, from the MATLAB software to NVIDIA Jetson hardware.

hwJetson = 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...
Gathering hardware details is complete.
 Board name        : NVIDIA Jetson TX2
 CUDA Version      : 9.0
 cuDNN Version     : 7.0
 TensorRT Version  : 3.0
 Available Webcams :  
 Available GPUs    : NVIDIA Tegra X2

hwJetson = 

  jetson with properties:

      DeviceAddress: '192.168.1.15'
               Port: 22
          BoardName: 'NVIDIA Jetson TX2'
        CUDAVersion: '9.0'
       cuDNNVersion: '7.0'
    TensorRTVersion: '3.0'
            GpuInfo: [1×1 struct]
         webcamlist: []

The GPU Coder™ Support Package for NVIDIA GPUs 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 Install and Setup Prerequisites for NVIDIA Boards.

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

getL4TVersion(hwJetson);
Jetson L4T version is: L4T R28.2.0.

To start a PuTTY SSH terminal session on the Jetson board, use the openShell() method of the jetson connection object.

openShell(hwJetson);
Using username "ubuntu".
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.38-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.

Last login: Sat Aug 11 19:38:08 2018 from 172.28.216.242
ubuntu@tegra-ubuntu:~$ ls
Desktop    gpucoderTX2       Music     remoteBuildDir  Videos
Documents  jetson_clocks.sh  Pictures  tegrastats      weston.ini
Downloads  MATLAB            Public    Templates
ubuntu@tegra-ubuntu:~$

After logging into the Linux® shell, you execute shell commands such as ls as shown.

To close the connection, use clear to remove hwJetson and any other connections that use hwJetson.

clear hwJetson;

Introduced in R2018b