【JetPack5.0.1 Special Edition】Jetson NX flashing record (detailed)

background

The TensorRT in JetPack4.6.2 does not support the 16G version of NX, which is very annoying. According to the nvidia official website, someone replied that you can try JetPack5.0.1, then I will try it, and I will die if I try it. Okay, the problem is a little bit smaller, so I will record it in detail this time. If there is no special requirement, it is recommended not to use this version

process

  1. Download VMware , I use 16, download the ubuntu image , I use 18.04, create a virtual machine , note that the storage space is recommended to be more than 80G , and you need to save things. Modify the mirror source to a domestic source (personally modify the mirror source through the interface, there are many choices if you are too lazy to copy and paste)
  2. To download the sdkmanager installation package , you need to have an nvidia account. After the download is complete, put it anywhere and then open the terminal, and enter it sudo apt install ./xxx.debto install it.
  3. Enter sdkmanager in the terminal, and then you need to log in to the nvidia account, and it may need to be updated
  4. Prepare the NX development board, the on-screen keyboard and mouse are still in use, try the command line without plugging in for the time being. Power off the NX development board , connect the recovery pin of the development board to the ground with a jumper wire or a DuPont line , the pin positions of different development boards are different, here are two kinds of development boards, one is this , the other is this , in Record it here. Then turn on the power and enter the recovery mode, then you can remove the jumper. Connect the mirco port to the usb to the computer. Remember to set the USB port to be connected to the virtual machine all the time , otherwise it will be disconnected occasionally in the middle of flashing, and you have to click to connect to the virtual machine every time. Recently, I often come across prompts that the virtual machine does not jump to peripherals. You can disconnect or connect as shown in the figure:insert image description here
  5. After logging in, the development board should be recognized after the usb is connected, as shown in the figure. insert image description here
    I choose JetPack5.0.1 according to my needs, add deepstream, and click continue to enter the next step
  6. Since my NX itself only has 16G EMMC, and a 128G SSD is expanded externally, basically all the software cannot be installed on the EMMC (I tried it, and in the end there were only a few hundred megabytes of storage left, and nothing could be done). Therefore, after going to step02, only choose to install the OS , check what is shown in the picture, and then click continue:
    insert image description here
  7. Then prompt to enter the password of the virtual machine, click OK after the input is complete insert image description here7. Then some basic system settings pop up, select manual setup here, and then enter the user name and password you set for your own development board below, I just entered here , and then click Flash.insert image description here
  8. Then the software started to flash, and it was a little slow. Halfway through, the software itself reminded me that I had waited too long, should I continue, what a shame. About half an hour. Then wait for the development board to update the configuration by itself. At this time, the fan will take off, and the fan will automatically restart after the update. It will be normal.insert image description here
  9. The next step is to move the system to the ssd. After thinking about it, I still have to plug in the screen keyboard and mouse, okay, let's use it for a while. The command line should also work, but it looks a little more cumbersome. After plugging in the screen keyboard and mouse, connect the development board to wifi, and then format the hard disk first:
    search for disks in the application and open it, insert image description here
    select your solid-state hard disk, format it,
    insert image description here
    and click Format insert image description hereto enter your own password insert image description here
    , then the formatting is complete, and then Click the plus sign under the disk to allocate 16G of free space, click next insert image description here
    and finally arrange a name, and the disk is arranged.
    insert image description here
  10. I have connected to wifi before, and then I can continue without the screen keyboard and mouse, suspend the virtual machine, use mobaxterm on the computer to open the serial port, and log in. Of course, it is the same to directly use the keyboard and mouse, just skip this step:insert image description here
  11. According to other tutorials , type the following command, git may not be easy to connect, try a few more times:
cd ~/Documents
git clone https://github.com/jetsonhacks/rootOnNVMe.git
cd rootOnNVMe
./copy-rootfs-ssd.sh
./setup-service.sh

The series should be done in one go, and you need to enter the password twice in the middle. Then sudo reboot should restart the ssd as the system disk.

  1. Modify the software source in advance, and the development board needs to download some things by itself after flashing:
sudo vim /etc/apt/sources.list

I picked a relatively small source here to try. Note that JetPack5.0.1 is ubuntu20, the suffix is ​​focal, and the development board should also bring ports:

deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse

If you can't knock on vim and the like, you can also gedit even on the screen. If you don’t have a screen like me, you can actually combine it with the latter method. Use winscp to copy your own sources.list to the development board, and then copy it in the terminal. That’s what I did. After the modification, the update is done.

sudo apt-get update
  1. Restart reboot and enter the virtual machine to continue the virtual machine. You may need to refer to the third step to hang the serial port on the virtual machine, and then go back to the first step. Refresh selects the nx development board and continue to enter:insert image description here
  2. In the second step, be careful not to check the operating system, only check the components, I checked the develop tools by the way, and then continue:insert image description here
  3. Enter the user name and password of the development board set before, the ip generally does not need to be changed by default, and then continueinsert image description here
  4. This is the beginning of the software installation. I started the installation at 16:50, and it ’s not over yet. I blindly guess that the company’s network is not working after 6:30 and 6:00. .insert image description here
  5. The screen is still occupied, okay, interrupt the virtual machine, it is no longer needed, and continue to operate the serial port. Next, you need to modify some configurations and install some software. Annoyances come, after flashing the software, the fan is full, I searched for a long time to find a solution, recorded it here, and write it here :
sudo systemctl stop nvfancontrol.service
sudo rm /var/lib/nvfancontrol/status
sudo systemctl start nvfancontrol

Later, I found that this can only be solved once. After searching for a while, I found a solution and wrote it here:
find a new script file anywhere, and I will name it fan_init.sh:
gedit fan_init.sh, or vim, enter the following content:

#!/bin/sh -e
sudo systemctl stop nvfancontrol
sudo rm /var/lib/nvfancontrol/status
sudo systemctl start nvfancontrol 
exit 0

Then save, move to /etc/init.d, and perform a series of operations:

sudo mv fan_init.sh /etc/init.d               # 文件move到 /etc/init.d/
sudo chmod 777 /etc/init.d/fan_init.sh              # 修改文件权限
sudo update-rc.d fan_init.sh defaults 99            # 脚本添加到启动脚本 , 99代表的优先级,越高执行的越晚

It still doesn't work after restarting. It is necessary to modify the file permissions here. After a while of trying, I found that it is enough to create an empty rc.local in /etc and restart it. I don’t understand.

  1. Install pip, modify the mirror source, and change the default python to python3 by the way:
sudo apt-get install python3-pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
python -m pip install --upgrade pip
  1. The next step is my own needs, install onnxruntime-gpu, since the official zoo does not have a corresponding package, I installed it with the whl file compiled by myself before . Type ifconfig in the serial port to see the ip of wlan0, then fill in the ip with winscp to log in, put the whl file in any directory, then cd in the serial port, enter:
pip install ./onnxruntime_gpu-1.12.0-cp38-cp38-linux_aarch64.whl
  1. Next, winscp moves down its own code, runs down its own test code, and when it’s done, it’s time to sneak away~

Guess you like

Origin blog.csdn.net/weixin_42492254/article/details/124966621