3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Jetson AGX Xavier をdocker 経由でセットアップ

Last updated at Posted at 2021-04-05

ちなみ

VirtualBox + Mac は後述のflash.shが何回やっても成功しなかった
flash.sh の中身を見ていると、途中でUSBが切断するタイミングがあり、そのタイミングでロストする
https://qiita.com/notitle420/items/786e1293e6a776338c55

この記事の特徴

  • docker 使っている
  • chroot が失敗する問題対応

SDK Manager のdocker image をDL してload

公式:
https://docs.nvidia.com/sdk-manager/docker-containers/index.html

sudo docker load -i ./sdkmanager-1.4.1.7402_docker.tar.gz
sudo docker tag sdkmanager:1.4.1.7402 sdkmanager:latest 

DLとインストール

docker に入る

sudo docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb/ --name JetPack_NX_Devkit --entrypoint /bin/bash sdkmanager

以下全部コンテナの中

chroot が失敗する

2021/03/21現在フルでインストールをすると

nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh

if [ "${#pre_deb_list[@]}" -ne 0 ]; then
        LC_ALL=C PYTHONHASHSEED=0 chroot . dpkg -i --path-include="/usr/share/doc/*" "${pre_deb_list[@]}" # ここ
fi

で落ちる。原因は binfmtsの設定が無く aarch64のバイナリが動かせる設定になっていないため
mata strings mo nakute otiru

sudo apt update
sudo apt install vim binfmt-support binutils
sudo vim /usr/share/binfmts/qemu-aarch64

内容は下記の通り

package qemu-user-static
interpreter /usr/bin/qemu-aarch64-static
flags: OC
offset 0
magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00
mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff

binfmt-support.

sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc/
sudo update-binfmts --enable qemu-aarch64

これで有効化し
enableになったらOK

update-binfmts --display qemu-aarch64
qemu-aarch64 (enabled):
     package = qemu-user-static
        type = magic
      offset = 0
       magic = \x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00
        mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
 interpreter = /usr/bin/qemu-aarch64-static
    detector =

イメージ作成

sdkmanager --cli install --logintype devzone --product Jetson --target P2888-0001 --targetos Linux --version 4.5.1 --license accept --staylogin true --datacollection enable

To initiate login process open https://static-login.nvidia.com/service/default/pin?user_code=45610295 in a browser (can be done on a different machine) and login with your NVIDIA Developer account. SDK Manager will start once done.
Login user code: 45610295. (valid for: 10 minutes).
? SDK Manager is waiting for you to complete login. 
  1) Generate a new login user code
  2) Cancel login
  Answer: 
  • --version: インストールバージョン 2021/03/13 の最新は 4.5.1
  • --target: Jetson の型番に合わせて変更 AGX Axevia は P2888-0001
  • --exitonfinish 公式のマニュアルにはこちらがついているがエラー時も終了して使いづらいのでオプションを付けないほうが良い

Jetson SDK
Jetson SDK Component
両方チェックしてDLする

最後にInstall の確認が出るがNoを選択

Authenticating with NVIDIA server...
Login succeeded.
Loading user information...
User information loaded successfully.
Loading server data...
Server data loaded successfully.
Session initialized...

Installation of this software is under the terms and conditions of the license agreements located in /opt/nvidia/sdkmanager/Eula/
  ===== INSTALLATION COMPLETED SUCCESSFULLY. ===== 
      - Drivers for Jetson: Installed
      - File System and OS: Installed
      - Device Mode Host Setup in Flash: Skipped
      - Flash Jetson AGX Xavier 16GB/32GB: Skipped
      - Device Mode Host Setup in Target SDK: Skipped
      - DateTime Target Setup: Skipped
      - CUDA Toolkit for L4T: Skipped
      - cuDNN on Target: Skipped
      - TensorRT on Target: Skipped
      - OpenCV on Target: Skipped
      - VisionWorks on Target: Skipped
      - VPI on Target: Skipped
      - NVIDIA Container Runtime with Docker integration (Beta): Skipped
      - Multimedia API: Skipped
      - NVIDIA Nsight Systems: Skipped

  ===== Installation completed successfully - Total 15 components =====
  ===== 2 succeeded, 0 failed, 0 up-to-date, 13 skipped =====

書き込み

cd nvidia/nvidia_sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/
sudo ./flash.sh jetson-xavier mmcblk0p1

リカバリーモードじゃなくて通常起動しているこんなエラーがでる

###############################################################################
# L4T BSP Information:
# R32 , REVISION: 5.1
###############################################################################
Error: probing the target board failed.
       Make sure the target board is connected through 
       USB port and is in recovery mode.

書き込みはむちゃくちゃ時間がかかるので、放置中にスリープしないように注意する
Ubuntu のスリープ禁止は 設定→電源→自動サスペンド をオフにする

3
0
0

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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?