2019년 11월 4일 월요일

JetsonTX2 - Installation OS(Ubuntu 18.04 LTS) and SDK

Now let's set up a Jetson TX2 that outperforms the Jetson Nano.
Two advantages stand out from the Jetson Nano. The first is 8Gb of memory, double that of the Jetson Nano. Using the machine learning framework on the Jetson Nano took a tremendous amount of time loading the network model due to lack of memory. The 8Gb memory isn't big enough either, but it's expected to make up for the weaknesses of the Jetson Nano. The GPU also has 256 CUDA with Pascal architecture. That's twice the number of CUDA than the Jetson Nano. However, the Jetson TX2's Pascal structure is far superior to the Jetson Nano's Maxwell structure, allowing more than double the performance improvement on the GPU.


Hardware feature \ Jetson module
Jetson Nano
Jetson TX2/TX2i
CPU (ARM)
4-core ARM A57 @ 1.43 GHz
4-core ARM Cortex-A57 @ 2GHz, 2-core Denver2 @ 2GHz
GPU
128-core Maxwell @ 921MHz
256-core Pascal @ 1.3GHz
Memory
4GB LPDDR4, 25.6 GB/s
8GB 128-bit LPDDR4, 58.3 GB/s
Storage
MicroSD
32 GB eMMC 5.1
Tensor cores
--
--
Video encoding (NVENC)
(1x) 4Kp30, (2x) 1080p60, (4x) 1080p30
(1x) 4Kp60, (3x) 4Kp30, (4x) 1080p60, (8x) 1080p30
Video decoding (NVDEC)
(1x) 4Kp60, (2x) 4Kp30, (4x) 1080p60, (8x) 1080p30
(2x) 4Kp60, (4x) 4Kp30, (7x) 1080p60
USB
(4x) USB 3.0 + Micro-USB 2.0
(1x) USB 3.0 + (1x) USB 2.0
PCI-Express lanes
4 lanes PCIe Gen 2
5 lanes PCIe Gen 2
Power
5W / 10W
7.5W / 15W

<Jetson Nano VS Jetson TX@ H/W comparison>



Algorithm and parameters / Jetson model
Jetson Nano
Jetson TX2/TX2i
Host to Device
0.2
0.2
White Balance
0.6
0.24
HQLI Debayer
1.8
0.47
DFPD Debayer
4.7
2.06
MG Debayer
12.7
5.9
Color Correction with 3×4 matrix
1.7
0.81
Resize from 2K to 960×540
10.0
4.3
Resize from 2K to 1919×1079
19.8
8.2
Gamma (1920×1080)
1.4
0.84
JPEG Encoding (1920×1080, 90%, 4:2:0)
4.3
1.7
JPEG Encoding (1920×1080, 90%, 4:4:4)
6.8
2.6
JPEG2000 Encoding (lossy, 32×32, single mode)
81
63
JPEG2000 Encoding (lossless, 32×32, single mode)
190
163
Device to Host
0.1
0.1
Total for simple camera pipeline (ms)
9.8
4.4

<GPU kernel times for 2K image processing (1920×1080, 8/16 bits per channel, milliseconds)>



TX2 system layout

The important parts of the TX2 development board are like this.


To use TX2 for the first time, connect a monitor, keyboard and mouse as follows.
  • Connect a monitor to the HDMI port
  • Connect a mouse to the USB A port (use a USB hub)
  • Connect a keyboard to the USB A port (use a USB hub)
  • Connect a LAN cable  to the Ethernet port. If you use wifi network, This process may be omitted.
  • Connect Power to the DC Power Jack

Now if you press the Power Button, the TX2 board will turn on.


Initial boot up of the TX2

The initial OS image for TX2 is Ubuntu 16.04. However, this image is only needed for initial setup and will be replaced by the new image during installation. The first time TX2 is powered up, it will boot into text mode and prompt you for information to change the GUI mode. After entering the necessary information, you can see that the system will boot into GUI mode. If successful, turn off the power of the TX2.


Prepare the host computer

Starting with Jetson TX2 or above, it goes through a strange installation process.
You need a host computer with Ubuntu installed. Then install NVidia's SDK Manager on the host computer and set the target TX2 using this program. There is a significant difference between the Jetson Nano which the SD card image already made. The biggest reason is that from TX1 and above, SD card is no longer used as a storage device. Starting from TX1, eMMC memory, which is difficult to replace, is used as a storage device. Many previous articles on installing TX2 recommend installing Ubuntu 16.04 on the host computer. However, as of November 2019, SDKManager supports both 18.04 and 16.04 versions, so you can use any version. However, in order to install Ubuntu 18.04 on TX2, we will install 18.04 on the host computer.

I used a LattePanda alpha as a host computer. My host computer used Wifi instead of Ethernet. 


I'll skip the process of installing Ubuntu 18.04 on the host computer. There are numerous documents on the Internet about installation.

Download and install NVIDIA SDK Manager


You must have an NVIDIA developer account to install the SDK Manager. If you do not have one, please register for a new account on the NVIDIA Developer site.

Download the SDK Manager from https://developer.nvidia.com/nvidia-sdk-manager on the ubuntu host computer.
Current file name is sdkmanager_0.9.14-4964_amd64.deb, but the file name would change when the latest version is released.


Before install the SDK Manager, install these packages first.


apt-get install libgconf-2-4 libcanberra-gtk-module

Then install the SDK manager on your host computer.


dpkg -i ./sdkmanager_0.9.14-4964_amd64.deb


Connect the host computer and the TX2 using USB cable shipped with TX2.


Be careful : At this moment, TX2 is powered off.



TX2 recovery mode

Now connect the TX2's power. Then enter the recovery mode through the following process. In recovery mode, you can install a new OS.

  • Press the power button to turn on.
  • Press the Force Recovery Button(Do not release).
  • Press the Reset Button (At this moment, Recovery, Reset both buttons are pressed simultaneously.).
  • Release the Reset Button.
  • After 2 seconds, Release the Force Recovery Button.
TX2's recovery mode doesn't show any screen. (It is not an OS boot process.)


Run SDK Manager on the host computer and install OS on TX2.


Now run the SDK Manager. And follow these steps.






First install the Jetson OS only.



Select Manual Setup and press the Flash button.



Now the OS installation ends successfully.



Finishing installing new OS(Ubuntu 18.04 LTS) on TX2

Now your TX2 will reboot and asks you to finish a new installation.

<TX2 Screen>

This process is the same as finishing a typical Ubuntu OS installation. After finishing the installation, you can check the new version of Ubuntu OS as follows.



And check your TX2's IP Address. I'm using the wifi network.


Now we can install the SDK using this IP address. USB cable between the host and the TX2 is no more needed.

Install the SDK

SDK installation does not require recovery mode. After booting TX2 normally, check the IP address and start the installation.

Follow these steps.

Run the SDK Manager again and select the SDK only.



Enter the TX2's IP address and user account.



SDK installation is in progress.



Finally you can see the finishing screen.




Wrapping up


Let's check briefly if the SDK is installed correctly.


root@spytx-desktop:/home/spytx# python3
Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> import tensorflow
2019-11-04 21:55:59.684756: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
>>> 

You can see that opencv and tensorflow modules work fine in Python.

TX2's eMMC storage size is only  30Gb. Therefore, it is recommended to add a separate storage device if possible.
In particular, large storage devices are required to download the machine learning network model, training data, and test data.
Next time, I'll connect a SSD to the TX2. And I recommanded using serveral sd cards for Jetson Nano, but Jetson TX2 can't replace the eMMC easily. Therefore, you need a different method for package management. Using Python's virtual environment, you can reduce the interference between packages and only load the packages you want. I will explain this later too.







댓글 없음:

댓글 쓰기