LoginSignup
19
30

More than 5 years have passed since last update.

JetsonTX2初期セットアップ(Jetpack)からサンプルのコンパイルまでの手順

Last updated at Posted at 2017-06-18

概要

JETSON TX2が手元に来ましたので、初期セットアップ(JetPackのインストール)からサンプルのコンパイルまでの手順について記録を残します。

事前準備

以下の物品が手元に必要となります。
・host用PC(ubuntu14.04が必要)
・ディスプレイ(HDMI端子) / またはHDMIセレクター
・USB HUB(USB Type A)
・USB Keyboard と Mouse
・Wifiルーター または 有線LAN
・電源ケーブル3ピンプラグ(オス)をさせる電源タップ / または 3ピンプラグ(オス)→2ピンプラグ変換アダプタ

インストール作業

1. Host用 Ubuntu14.04 amd64のマシンを用意

専用PCを用意できなかったため、USBメモリでのデュアルブートで挑むことにしました。HDDの空き容量がないため、windows10のデスクトップPCにUSBメモリを挿して、USBメモリ上にUbuntuをインストールしました。
USBメモリのアクセスが遅すぎて(わたしが)耐えられなくなり、HDDのファイル整理とパーティション調整を行って、素直にHDD領域に入れなおしました・・。

Ubuntu(host)のインストールは、以下のサイトを参考にさせていただきました。
[Legacy環境編]Ubuntu 14.04 LTS と Windows10 とのデュアルブート環境の構築

[Legacy環境編]Ubuntu 14.04 LTS と Windows10 とのデュアルブート環境の構築

BIOS画面が出ない場合は、以下のサイトをご参考ください

[UEFI基本編]Ubuntu 16.04 LTS と Windows10 とのデュアルブート環境の構築
高速スタートアップの無効化

使用したメディアは、以下となります。
Ubuntu 14.04.5 LTS (Trusty Tahr)
ubuntu-14.04.5-desktop-amd64.iso をDVDに焼き、インストールに使用しました。

Ubuntuのユーザは、ubuntu/ubuntu 、
rootのパスワードもubuntu としています。

2.nVidiaまるっとインストーラー「Jetpack」の準備

Ubuntu(host)上のブラウザから以下のアドレスにアクセスし、Jetpackをダウンロードします。
事前に、nVidiaの会員登録は済ませておく必要があります。
https://developer.nvidia.com/embedded/jetpack
JetPack-L4T-3.0-linux-x64.run (34.8MB)

格納先は以下とします。
~/jetson/JetPack-L4T-3.0-linux-x64.run

3.Jetpackをhost側PC(ubuntu)へインストール

本家のインストール手順はこちら
http://docs.nvidia.com/jetpack-l4t/index.html#developertools/mobile/jetpack/l4t/3.0/jetpack_l4t_install.htm

host側PCにファイル格納後、実行権限を付与し実行します。

$ cd /home/ubuntu/jetson/
$ chmod u+x JetPack-L4T-3.0-linux-x64.run
$ sudo ./JetPack-L4T-3.0-linux-x64.run

3-1."JetPack L4T Installer"画面

[NEXT>] を押下

3-2."Installation Configuration"画面

[NEXT>] を押下

3-3."Select Development Environment"画面

 ◎Jetson TX2 Developer Kit(64-bit) and Ubuntu Host
 を選択し、 [NEXT>] を押下

3-4."Component Manager"画面

 Actionがすべてinstallになっていることを確認。
 [NEXT>] を押下

3-5."Terms and Conditions"画面

 Accept Allにチェックをいれ、[Accept]を押下。

 ダウンロードとインストールが始まります。(8GB程度)

3-6."Installing"画面

 Completedが表示される。
 [NEXT>] を押下

メモ
en-localeでない場合、ワーニングが出ます。

xmessage
Warning: We noticed you are running OS with non-EN locale. NVIDIA does not test nor support such configureations.
メモ2
わたしの環境で発生したエラーをメモしておきます。
インストール中、「残念ながら、Ubuntu 14.04 で内部エラーが発生しました。」
というウィンドウが表示されました。
Ubuntu14.04TLS日本語版だったせい?と判断がつかなかった為、Ubuntu14.04.5英語版でやり直しました。
メモ3
CUDA Toolkitのインストール中にエラーが発生しました。との表示。
ダウンロードエラーかな?ということで、
JetPack-L4T-3.0-linux-x64.run以外のファイルを削除し、
再度ダウンロードを実行。
二回目はすべてのインストールがうまくいきました。

3-7."Network Layout - Jetson TX2"画面

 ◎Device accessinternet via router/switch
 を選択。
 [NEXT>] を押下

3-8."Network Inteface Selection"画面

 eth0 を選択。
 [NEXT>] を押下

3-9."Post Installation Jetson TX2"画面

 [NEXT>] を押下

3-10.terminal画面にて"Post Installation"画面が表示されます。

window
×-□ Post Installation
----------------------------------------------------------------------
Please put your device to Force USB Recovery Mode, when your are ready, press Enter key
TO place system in Force USB Recovery Mode:
1. Power down the device. If connected, remove the AC adapter from the device. The device MUST be powered OFF, not in a suspend or sleep state.
2. Connect the Micro-B plug on the USB cable to the Recovery (USB Micro-B) Port on the device and the other end to an available USB port on the host PC.
3. Connect the power adapter to the device.
4. Press and release the POWER button to power on device. Press and hold the FORCE RECOVERY button: while pressing the FORCE RECOVERY button, press and release the RESE button; wait two seconds and release the FORCE RECOVERY button.;
5. When device is in recovery mode, lsusb command on host will list a line of "NVidia Corp"

手順
1:ACアダプタを抜いた状態にします。
2:USBケーブルで、TX2とHost側PC(Ubuntu)を接続します。
3:ACアダプタをつないで、JetsonTX2の電源ボタンを押します。
  (基盤の端にPOWER BTNとマークがあります。基盤中央よりのボタン)

  |〇〇〇◎ 電源ボタン
  +-------

4:リカバリーボタンを押しっぱなしにし、
  リセットボタンを押し、2秒間押したあと、離します。
  リカバリーボタンを離します。

  |〇〇◎〇 リカバリーボタン
  +-------

  |◎〇〇〇 リセットボタン
  +-------

5:host側PCにてterminalを立ち上げ、lsusbを実行し"Nvidia Corp"の行が存在すればOK!

上記までが完了した後、terminal画面にて、エンターキーを押下します。

・・・

terminal画面に以下のメッセージが表示されます。

Finished Flasing OS
Determining the IP address of target...

進まない場合は、一度Ctrl+Cで停止させます。

□Remove downloaded files には、チェックをいれずに、[Finish]ボタンを押下します。

4.TX2へのインストール作業

以後、TX2のIPアドレスが必要となるため、以下の作業を行います。

4-1.TX2のネットワークアドレスを確認

TX2にHDMIケーブルを挿し、画面を表示させます。
nvidia / nvidia でログインします。
Wifiルータへの接続を行います。
ifconfigでTX2のipを確認します。(IPアドレスをメモします)

4-2.インストールの継続

host側PCから、再度JetPack-L4T-3.0-linux-x64.runを実行します。

"Component Manager"画面 まで進み、
 Flash OS Image to Target のActionを、
 install から、no actionに変更します。
 [NEXT>] を押下

"Terms and Conditions"画面
Accept Allにチェックをいれ、[Accept]を押下。

"Installing"画面
 Competedが表示される。
 [NEXT>] を押下

4-3."Device Infomation - Jetson TX2"画面

  Device IP Address : 先ほどTX2に設定されていたIPアドレスを入力
  User Name : ubuntu
  Password : ubuntu
 [NEXT>] を押下

4-4."Post Installation Jetson TX2"画面

 [NEXT>] を押下

4-5.terminal画面にて"Post Installation"画面が表示されます。

 最終的には、以下のメッセージが表示されます。
 Installation of target components finished, press Enter key to continue.

これでインストール完了です。

インストールの参考にさせていただきました。
http://demura.net/athome/13445.html

5.TX2上のサンプルコードコンパイル

TX2にログイン(nvidia/nvidia)

先に、キーボード設定を変更しておきましょう。

おまけ:キーボード変更
$ sudo dpkg-reconfigure keyboard-configuration

画面表示後、各画面の設定は以下。
・The model of the keyboard of this machine. : Microsoft Internet Keyboard
・Country of origin for the keyboard: Japanase
・Keyboard layout:Japanese
・Key to function as AltGr:defalut
・Compose key:No compose key
・Use Ctrl+Alt+Back to terminate the X server? : Yes
コンパイルの実行
$ su - ubuntu
$ /home/ubuntu/NVIDIA_CUDA-8.0_Samples
$ SMS=53 EXTRA_LDFLAGS=--unresolved-symbols=ignore-in-shared-libs TARGET_ARCH=aarch64 make

コンパイルすると、エラーが出ました。
Makefile:52: recipe for target '5_Simulations/nbody/Mkaefile.ph_build' failed
make: *** [5_Simulations/nbody/Makefile.ph_build] Error 2

以下のサイトを参考に、以下のファイルを修正し、再度makeを実行します。

参考
https://devtalk.nvidia.com/default/topic/1003955/errors-compiling-cuda-8-0-samples-with-r27-1-on-tx2/

修正内容

/home/ubuntu/NVIDIA_CUDA-8.0_Samples/common/inc/helper_gl.h

修正前:
line105:
#if !defined(GLX_EXTENSION_NAME) || defined(__arm__) || defined(__aarch64__)

修正後:
Line105:
#if !defined(GLX_EXTENSION_NAME) || !defined(GL_VERSION_1_3)

参考
http://developer2.download.nvidia.com/embedded/L4T/r27_Release_v1.0/Docs/Jetson_X2_Developer_Kit_User_Guide.pdf

以下のメッセージが表示されれば、サンプルのコンパイルは完了です。
Finished building CUDA samples

6.サンプルの実行(例)

$ cd /home/ubuntu/NVIDIA_CUDA-8.0_Samples\5_Simulations\particles
$ sudo ./particles

CUDA Particlesの画面が表示されます。

以上です。

7.感想

host側PCの準備からインストール、サンプルの実行まで半日以上かかりました。
時間があるときに少しずつ作業するのがおすすめです。

19
30
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
30