Main Content

jetson

Connection toNVIDIAJetsonhardware

Since R2018b

Description

This object represents a connection from the MATLAB®software to the NVIDIA®Jetson™ hardware. To create this object, use thejetsonfunction. To interact with the Jetson hardware, use this object with the functions listed inObject Functions.

Creation

Description

example

obj= jetsoncreates 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. Thejetsonobject 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 theobjobject to interact with the Jetson hardware and attached peripherals such as a camera. To close the connection, useclearto removeobjand any other connections that useobj.

Input Arguments

expand 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

expand all

A connection from the MATLAB software to the Jetson hardware, returned as ajetsonobject.

Properties

expand all

This property is read-only.

The numbers of the available GPIO pins on the NVIDIA Jetson hardware, returned as a vector of doubles.

Example:[7 11 12 13 15 16 18 19 21 23 24 29 31 32 33 35 36 37 38 40]

Data Types:array

This property is read-only.

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

Example:'NVIDIA Jetson TX2'

This property is read-only.

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

Example:'9.0'

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'

This property is read-only.

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

Example:'169.254.0.2'“jetson-board-name”

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 useobjectName.GPUInfo. The structure contains the following fields:

Name Description

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 = structwithfields:Name:'NVIDIA Tegra X2'CUDADriverVersi指数:0 ComputeCapability: 6.2000on: 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

This property is read-only.

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

Example:'1.14.5'

This property is read-only.

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

Example:'4.1.1'

This property is read-only.

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

Example:22

This property is read-only.

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

Example:'1.2'

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”

This property is read-only.

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

Example:'1.14.2-1'

This property is read-only.

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

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

Object Functions

configurePin Configure GPIO pin as digital input or digital output
deleteFile Delete file on target hardware
getCameraList Get a list of available cameras on theNVIDIAhardware
getDisplayEnvironment Get the display environment value used for redirecting the display on the target
getFile Transfer file fromNVIDIAhardware to host computer
getL4TVersion Get the L4T version of theNVIDIAJetsonhardware
getLinuxVersion Get information about theLinuxenvironment on the target
getPdkorSdkVersion Get the version number of the DriveWorks SDK installed on theNVIDIA DRIVEhardware
getPILPort Get the TCP/IP port number used by the PIL execution
getPILTimeout Get the timeout value that PIL uses for reading data
imageDisplay Create animageDisplayobject for displaying images onNVIDIAtargets
killApplication Kill an application on theNVIDIAtarget by name
killProcess Kill a process on theNVIDIAtarget by ID
listAudioDevices Get a list of available audio devices on theNVIDIAhardware
openShell Open terminal on host computer to use aLinuxshell onNVIDIAhardware
putFile Transfer file from host computer to target hardware
readDigitalPin Read logical value from GPIO input pin
runApplication Launch an application on theNVIDIAtarget by name
runExecutable Launch an executable on theNVIDIAtarget by name
setDisplayEnvironment Set the display environment value used for redirecting the display on the target
setPILPort Set the TCP/IP port number used by the PIL execution
setPILTimeout Set the timeout value that PIL uses for reading data
setupCodegenContext Select the target hardware to build code for from multiple live connection objects
showPins Show diagram of GPIO pins
system Run commands in aLinuxshell on theNVIDIAhardware
updatePeripheralInfo Scan for and update the list of peripherals connected to the target hardware
webcam Createwebcamobject to acquire images from an USB webcam attached to theNVIDIAhardware
writeDigitalPin Write logical value to GPIO output pin

Examples

collapse all

这个例子向您展示了如何创建一个连接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... Checking for third-party library availability on the Target... Gathering hardware details is complete. Board name : NVIDIA Jetson TX2 CUDA Version : 10.0 cuDNN Version : 7.6 TensorRT Version : 6.0 GStreamer Version : 1.14.5 V4L2 Version : 1.14.2-1 SDL Version : 1.2 OpenCV Version : 4.1.1 Available Webcams : Microsoft® LifeCam Cinema(TM) Available GPUs : NVIDIA Tegra X2 Available Digital Pins : 7 11 12 13 15 16 18 19 21 22 23 24 29 31 32 33 35 36 37 38 40 hwJetson =jetsonwith properties: DeviceAddress: 'jetson-board-name' Port: 22 BoardName: 'NVIDIA Jetson TX2' CUDAVersion: '10.0' cuDNNVersion: '7.6' TensorRTVersion: '6.0' SDLVersion: '1.2' V4L2Version: '1.14.2-1' GStreamerVersion: '1.14.5' OpenCVVersion: '4.1.1' GPUInfo: [1×1 struct] WebcamList: {'Microsoft® LifeCam Cinema(TM)'} AvailableDigitalPins: [7 11 12 13 15 16 18 19 21 22 23 24 29 31 32 33 35 36 37 38 40]

TheMATLAB Coder™ Support Package for NVIDIA Jetson and NVIDIA DRIVE®Platformsestablishes 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, seeInstall and Setup Prerequisites for NVIDIA Boards.

To get the L4T software version on the Jetson board, use thegetL4TVersionmethod of thejetsonconnection object.

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

To start a PuTTY SSH terminal session on the Jetson board, use theopenShellmethod of thejetsonconnection 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 169.20.200.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 aslsas shown.

To close the connection, useclearto removehwJetsonand any other connections that usehwJetson.

clearhwJetson;

这个例子向您展示了如何创建一个连接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. For example,

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 : 10.0 cuDNN Version : 7.6 TensorRT Version : 6.0 GStreamer Version : 1.14.5 V4L2 Version : 1.14.2-1 SDL Version : 1.2 OpenCV Version : 4.1.1 Available Webcams : Microsoft® LifeCam Cinema(TM) Available GPUs : NVIDIA Tegra X2 Available Digital Pins : 7 11 12 13 15 16 18 19 21 22 23 24 29 31 32 33 35 36 37 38 40 hwJetson =jetsonwith properties: DeviceAddress: '169.254.0.2' Port: 22 BoardName: 'NVIDIA Jetson TX2' CUDAVersion: '10.0' cuDNNVersion: '7.6' TensorRTVersion: '6.0' SDLVersion: '1.2' V4L2Version: '1.14.2-1' GStreamerVersion: '1.14.5' OpenCVVersion: '4.1.1' GPUInfo: [1×1 struct] WebcamList: {'Microsoft® LifeCam Cinema(TM)'} AvailableDigitalPins: [7 11 12 13 15 16 18 19 21 22 23 24 29 31 32 33 35 36 37 38 40]

Version History

Introduced in R2018b