drive

Create connection to NVIDIA DRIVE hardware

Description

example

obj = 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. The drive object reuses these settings from the most recent successful connection to the DRIVE hardware.

After connecting to the hardware, you can use the obj to interact with the DRIVE hardware. To close the connection, use clear to remove obj and any other connections that use obj.

example

obj = drive(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 DRIVE hardware has two default user names: 'nvidia' and 'ubuntu'. For 'nvidia', the default password is 'nvidia'. For 'ubuntu', the default password is empty: '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.

You can use the connection to interact with the DRIVE hardware and attached devices such as a web camera.

Examples

collapse all

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.

hwDRIVE = DRIVE
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 Drive
 CUDA Version      : 9.0
 cuDNN Version     : 7.0
 TensorRT Version  : 3.0
 Available Webcams : Microsoft® LifeCam Cinema(TM)
 Available GPUs    : Graphics Device,NVIDIA Tegra X2

hwDRIVE = 

  drive with properties:

      DeviceAddress: 'gpucoder-drivepx2-1a'
               Port: 22
          BoardName: 'NVIDIA Drive'
        CUDAVersion: '9.0'
       cuDNNVersion: '7.0'
    TensorRTVersion: '3.0'
            GpuInfo: [1×2 struct]
         webcamlist: {'Microsoft® LifeCam Cinema(TM)'}

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

openShell(hwDRIVE);
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 remove hwDRIVE and any other connections that use hwDRIVE.

clear 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('192.168.1.16','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...
Gathering hardware details is complete.
 Board name        : NVIDIA Drive
 CUDA Version      : 9.0
 cuDNN Version     : 7.0
 TensorRT Version  : 3.0
 Available Webcams : Microsoft® LifeCam Cinema(TM)
 Available GPUs    : Graphics Device,NVIDIA Tegra X2

hwDRIVE = 

  drive with properties:

      DeviceAddress: '192.168.1.16'
               Port: 22
          BoardName: 'NVIDIA Drive'
        CUDAVersion: '9.0'
       cuDNNVersion: '7.0'
    TensorRTVersion: '3.0'
            GpuInfo: [1×2 struct]
         webcamlist: {'Microsoft® LifeCam Cinema(TM)'}

Input Arguments

collapse all

IP address or host name of the hardware, specified 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 IP address.

Example: '169.254.0.2'

Example: 'gpucoder-drivepx2-1a'

Data Types: char

Linux user name, specified as a character vector.

Example: 'ubuntu'

Data Types: char

Linux user password, specified as a character vector.

Example: 'ubuntu'

Data Types: char

Output Arguments

collapse all

A connection from the MATLAB software to the DRIVE hardware, returned as a drive object.

Introduced in R2018b