drive - Connection to NVIDIA DRIVE hardware - MATLAB (original) (raw)
Connection to NVIDIA DRIVE hardware
Description
This object represents a connection from the MATLAB® software to the NVIDIA DRIVE® hardware. To create this object, use the drive function. To interact with the DRIVE hardware, use this object with the functions listed in Object Functions
Creation
Syntax
Description
[obj](#mw%5Fa40227a5-7019-439e-80c6-75ce7c3b662c) = drive
creates a connection,obj
, from the MATLAB software to the NVIDIA DRIVE 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. Thedrive
object reuses these settings from the most recent successful connection to the DRIVE hardware.
[obj](#mw%5Fa40227a5-7019-439e-80c6-75ce7c3b662c) = drive([deviceaddress](#mw%5Fc911e681-86da-4309-b201-9360a6c3bc1f),[username](#mw%5F519fa072-a9e9-4ae2-ad58-8ecce469989e),[password](#mw%5F43873f01-f658-46ee-8c42-fd36beb3f5c6))
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 DRIVE 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 DRIVE hardware, use this syntax.
After connecting to the hardware, you can use the obj
object to interact with the DRIVE hardware and attached peripheral devices such as a camera. To close the connection, use clear to remove obj
and connections that use obj
.
Input Arguments
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: '169.254.0.2'
Example: 'drive-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
A connection from the MATLAB software to the DRIVE hardware, returned as a drive object.
Properties
This property is read-only.
The name of the target DRIVE board, returned as a character vector.
Example: 'NVIDIA Drive PX2'
This property is read-only.
Version number of the CUDA toolkit installed on the DRIVE board, returned as a character vector.
Example: '9.2'
This property is read-only.
Version number of the CUDA Deep Neural Network library (cuDNN) installed on the DRIVE board, returned as a character vector.
Example: '7.1'
This property is read-only.
The IP address or host name of the Ethernet port on the DRIVE board, returned as a character vector.
Example: '169.254.0.2'
'drive-board-name'
This property is read-only.
Additional information on the GPU of the DRIVE board, returned as a 1-by-N structure, where N is the number of GPU devices. 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 DRIVE PX2 board has the following values:
hwDrive.GPUInfo(1,1)
ans =
struct with fields:
Name: 'DRIVE PX 2 AutoChauffeur'
Index: 0
ComputeCapability: 6.1000
CUDADriverVersion: 9.2000
CUDAToolkitVersion: 9.2000
MaxThreadsPerBlock: 1024
MaxSharedMemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
AvailableMemory: 4.0265e+09
TotalConstMem: 65536
MultiprocessorCount: 9
TotalCUDACores: 1152
MaxThreadsPerSM: 2048
This property is read-only.
Version number of the GStreamer library installed on the DRIVE board, returned as a character vector.
Example: '1.8.2'
This property is read-only.
The SSH port number on the DRIVE board, returned as an integer.
Example: 22
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.
Version number of the SDL library installed on the DRIVE board, returned as a character vector.
Example: '1.2'
This property is read-only.
Version number of the NVIDIA® TensorRT library installed on the DRIVE board, returned as a character vector.
Example: '4.0'
This property is read-only.
Version number of the V4L2 library installed on the DRIVE board, returned as a character vector.
Example: '1.10.0-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
getFile | Transfer file from NVIDIA hardware to host computer |
---|---|
putFile | Transfer file from host computer to target hardware |
deleteFile | Delete file on target hardware |
openShell | Open terminal on host computer to use a Linux shell on NVIDIA hardware |
system | Run commands in a Linux shell on the NVIDIA hardware |
getL4TVersion | Get the L4T version of the NVIDIA Jetson hardware |
getPdkorSdkVersion | Get the version number of the DriveWorks SDK installed on the NVIDIA DRIVE hardware |
setupCodegenContext | Select the target hardware to build code for from multiple live connection objects |
webcam | Create webcam object to acquire images from a USB webcam attached to the NVIDIA hardware |
getCameraList | Get a list of available cameras on the NVIDIA hardware |
updatePeripheralInfo | Scan for and update the list of peripherals connected to the target hardware |
getLinuxVersion | Get information about the Linux environment on the target |
imageDisplay | Create an imageDisplay object for displaying images onNVIDIA targets |
getPILPort | Get the TCP/IP port number used by the PIL execution |
getPILTimeout | Get the timeout value that PIL uses for reading data |
setPILPort | Set the TCP/IP port number used by the PIL execution |
setPILTimeout | Set the timeout value that PIL uses for reading data |
killApplication | Kill an application on the NVIDIA target by name |
killProcess | Kill a process on the NVIDIA target by ID |
runApplication | Launch an application on the NVIDIA target by name |
runExecutable | Launch an executable on the NVIDIA target by name |
getDisplayEnvironment | Get the display environment value used for redirecting the display on the target |
setDisplayEnvironment | Set the display environment value used for redirecting the display on the target |
Examples
This example shows you how to create a connection from the MATLAB software to the NVIDIA DRIVE hardware. The DRIVE 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 DRIVE hardware.
Create a connection, hwDRIVE
, from the MATLAB software to NVIDIA DRIVE hardware.
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 Drive CUDA Version : 9.2 cuDNN Version : 7.1 TensorRT Version : 4.0 GStreamer Version : 1.8.2 V4L2 Version : 1.10.0-1 SDL Version : 1.2 Available Webcams : Microsoft® LifeCam Cinema(TM) Available GPUs : DRIVE PX 2 AutoChauffeur,NVIDIA Tegra X2
hwDrive =
jetson with properties:
DeviceAddress: 'drive-board-name'
Port: 22
BoardName: 'NVIDIA Drive'
CUDAVersion: '9.2'
cuDNNVersion: '7.1'
TensorRTVersion: '4.0'
SDLVersion: '1.2'
V4L2Version: '1.10.0-1'
GStreamerVersion: '1.8.2'
GPUInfo: [1×2 struct]
WebcamList: {'Microsoft® LifeCam Cinema(TM)'}
The support package establishes an SSH connection to the DRIVE 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 PDK/SDK software version on the DRIVE board, use the getPdkorSdkVersion
method of the DRIVE
connection object.
getPdkorSdkVersion(hwDRIVE);
Drive SDK/PDK version is: 5.0.5.0-10129397
To start a PuTTY SSH terminal session on the DRIVE board, use the openShell
method of the DRIVE
connection object.
Using username "ubuntu". Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.9.38-rt25-tegra aarch64)
- Documentation: https://help.ubuntu.com/
594 packages can be updated. 321 updates are security updates.
ubuntu@gpucoder-drivepx2-1a:$ ls
CamVid.avi Documents MATLAB Pictures segnetDemo Videos
Desktop Downloads Music Public Templates
ubuntu@gpucoder-drivepx2-1a:$
After logging into the Linux shell, you execute shell commands such as ls
as shown.
To close the connection, use clear
to removehwDRIVE
and connections that use hwDRIVE
.
This example shows you how to create a connection from the MATLAB software to the NVIDIA DRIVE hardware that has different device address, user name, and password settings from the previous successful connection.
Create a connection, hwDRIVE
, from the MATLAB software to NVIDIA DRIVE hardware.
hwDRIVE = drive('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 Drive CUDA Version : 9.2 cuDNN Version : 7.1 TensorRT Version : 4.0 GStreamer Version : 1.8.2 V4L2 Version : 1.10.0-1 SDL Version : 1.2 Available Webcams : Microsoft® LifeCam Cinema(TM) Available GPUs : DRIVE PX 2 AutoChauffeur,NVIDIA Tegra X2
hwDrive =
jetson with properties:
DeviceAddress: '169.254.0.2'
Port: 22
BoardName: 'NVIDIA Drive'
CUDAVersion: '9.2'
cuDNNVersion: '7.1'
TensorRTVersion: '4.0'
SDLVersion: '1.2'
V4L2Version: '1.10.0-1'
GStreamerVersion: '1.8.2'
GPUInfo: [1×2 struct]
WebcamList: {'Microsoft® LifeCam Cinema(TM)'}
Extended Capabilities
Version History
Introduced in R2018b
See Also
Objects
Topics
- Sobel Edge Detection on NVIDIA Jetson Nano Using Raspberry Pi Camera Module V2
- Getting Started with the MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms
- Deploy and Run Sobel Edge Detection with I/O on NVIDIA Jetson Nano
- Build and Run an Executable on NVIDIA Hardware
- Stop or Restart an Executable Running on NVIDIA Hardware
- Run Linux Commands on NVIDIA Hardware