Pages

Friday, 3 February 2017

Limiting factors in the real-time machine learning on the embedded devices are both hardware and software. Hardware with high processing power usually consumes lots of energy and there is a lack of Machine Learning software support for embedded platforms. NVIDIA provides solution for this covering both constraints:

Why Jetson?

small power consumption (less than 10W) so suitable for battery-powered, portable devices (drones, robots etc...)

big processing power for embedded visual, AI, GPU computing

Jetson TX1 Unboxing

JetPack

In my recent posts I wrote about installing some of NVIDIA's frameworks - CUDA (for parallel computing using GPU) and cuDNN (Neural Network system) on a desktop machine running Ubuntu (16.04; with CUDA-compatible graphic card). NVIDIA packaged together these and some other tools and made them available for Jetson. That package is called JetPack and can be downloaded for free from NVIDIA's website.

JetPack Installer can:

flash Jetson board with Ubuntu OS

32-bit Ubuntu 14.04 on Jetson TK1

64-bit Ubuntu 16.04 on Jetson TX1

install all the Jetson Embedded Platform tools (on the Jetson)

install various tools on the host only; it is not necessary to have Jetson Developer Kit (TK1 or TX1 boards) in order to run these tools on PC

Installation Process

Prerequisites

We have to have:

Jetson TX1 (target)

HDMI cable - to connect Jetson board to monitor

Micro-USB to USB cable - to connect Jetson with PC

USB keyboard

USB mouse

PC or Linux VM (host). Host is required for running JetPack installer as this can't be run directly on the Jetson. Also, host needs to be running Ubuntu 14.04.

NOTE: I tried to use PC with Ubuntu 16.04 as host but installation of some packages failed. E.g. Installation of OpenCV package compiled for 14.04 (libopencv4tegra-repo_2.4.13-17-g5317135_amd64_ubuntu-14.04.deb) and also some CUDA dependencies. Don't waste time on experimenting, just follow the instructions and stick to Ubuntu 14.04 on the host. I used Ubuntu 14.04 running as VM on VirtualBox on my Window 10 machine.

Downloading JetPack

Fill in the online form in order to get membership in the NVIDIA Embedded Developer Program

Download JetPack Installer. At the time of writing the latest version is v2.3.1 and the installer file name is JetPack-L4T-2.3.1-linux-x64.run.

Create a new directory to store installation packages and place .run installer in that directory

Hardware Setup

Host (PC/VM)

Connected to the router (WiFi or LAN cable)

Jetson

Connected to the router (WiFi or LAN cable)

USB Keyboard and Mouse attached

Connected to the monitor via HDMI cable

Jetson comes preflashed with Ubuntu Linux. If we turn on Jetson device for the first time, Terminal window appears with instructions how to install Nvidia Linux driver:

$ cd ${HOME}/NVIDIA-INSTALLER
$ sudo ./installer.sh

This is a prerequisite for UI to appear after reboot which can be triggered with:

$ sudo reboot

Running the Installer

Add execution permission to .run installer:

/opt/JetPack$ chmod +x JetPack-L4T-2.3.1-linux-x64.run

Run the installer:

/opt/JetPack$ ./JetPack-L4T-2.3.1-linux-x64.run

Installation Wizard appears:

Wizard shows Installation directory:

In the next step we have to select Jetson platform we'll be installing JetPack on. In our case, that's Jetson TX1:

At one point installation prompts for privileges elevation:

Wizard now displays a Component Manager with list of tools that can be installed on the host and the target:

This is the second part of the list - showing all packages that can be installed on the target:

Here is a short description of some available packages:

NVIDIA PerfKit is a comprehensive suite of performance tools to help debug and profile OpenGL and Direct3D applications.

NVIDIA VisionWorks toolkit is a software development package for computer vision (CV) and image processing.

NVIDIA TensorRT is a high performance neural network inference engine for production deployment of deep learning applications.

If we don't have Jetson Developer Kit (Jetson board) but want to install JetPack on the host only, we can simply change Action type from install to no action for item group "For Jetson TX1 64bit".

In the next step we have to accept Ts&Cs:

Before the installation starts a pop up appears asking us to be aware about what's going on, to monitor the process and act if required:

Installer first downloads packages selected for installation:

We are half way through - host packages have been installed!

Because we included flashing OS in the process, in the next step we have to select our setup regarding Jetson's Internet accesses. Two options are available:

Jetson connects to the same router as the host (making them both members of the same subnet)

Host acts as gateway through which Jetson gets access to the outer network and Internet

I opted for more straightforward option and connected both host and target to the same router: PC via WiFi and Jetson via LAN cable:

If host has multiple network interfaces (adapters), we have to select the one which is connected to the same network (router) as Jetson. We can run ifconfig command in the Terminal to find the name of the interface. LAN IP addresses of host's and target's network interface have to show that they belong to the same network (both have to have IP addresses which start with e.g. 192.168.0).

Wizard is listing what will be its next actions so we can still decide to go back change them if necessary:

Still on the host machine, a Terminal window appears listing instructions how to connect Jetson with the host and how to put Jetson into Force USB Recovery Mode which is required for flushing OS:

If running host on a Virtual Machine, we'll have to enable its access to the USB device. In VirtualBox, after connecting PC and Jetson with USB cable, I ran lsusb command but USB device with name Nvidia Corp was not in the list but I could see it in VirtualBox's list of USB Devices:

All I had to do was to click on USB Settings and add desired USB device to the filter:

lsusb command now shows NVIDIA Corp USB device:

The output which appears on the host during flushing OS onto target:

...more output...:

The output which appears on the host when flushing OS onto target is completed:

Upon restarting the Jetson, host has to establish SSH tunnel with it through which it will push software tools selected in the Package Manager. Host first has to get target's IP address:

We have to manually enter Jetson's IP address and OS username and password (default credentials are ubuntu/ubuntu):

We can determine IP address of each device with ifconfig command and we can verify that they both belong to the same subnet. If using VirtualBox, make sure that Virtual Machine's adapter is in Network settings attached to Bridged Adapter instead of NAT (the default option).

Once transport channel is established, we can confirm the list of the next actions:

...and trigger pushing software from host to target starts by clicking on Next button:

Once all selected software packages are installed on Jetson, Wizard is giving us an option to remove all package installers from the host:

This completes JetPack installation. Yay!

APPENDIX A: Connecting Jetson to the Internet via Host

If we choose the following networking setup:

...Installer displays which actions it will perform in order to make this connection possible: