Jetson Nano configuration process (1)
This article introduces some records of the process of jetson nano from starting to running the model. I burned the system image to JP 4.3 version. The built-in CUDA of JP 4.4 version is 10.2 too new, and only supports the high version of tensorflow, which is more troublesome.
1. System burn
Prepare a burning tool such as: win32diskimager or Etcher
used by Etcher for easy operation and no problems.
Go to the official website to download the Nano mirror.
https://developer.nvidia.com/embedded/downloads
Note that the CUDA in the system image JP4.4 is 10.2, and the opencv is 4.1.1; the CUDA in JP4.3 is 10.0, and the OpenCV3.4 is downloaded according to your needs.
I use tensorflow 1.13.1 version here and need JP4.3 version system burned by CUDA10.0, and then install OpenCV4.1.1 myself.
2. apt for domestic sources
#添加root密码
sudo passwd root
#备份存nano源原文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#编辑该文件
sudo vi /etc/apt/sources.list
#拷贝到文件中
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
#更新下源
sudo apt-get update
#更新下软件
sudo apt-get full-upgrade
3. CUDA CUDNN OpenCV check whether the installation is complete
3.1 CUDA configuration
#编辑环境变量
sudo vim ~/.bashrc
#在最后添加以下内容
export CUDA_HOME=/usr/local/cuda-10.0
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.0/bin:$PATH
#保存生效一下
source ~/.bashrc
Note: If the environment variable is added, it still shows nvcc not found:
first check whether the nvcc file exists in cd /usr/local/cuda/bin, if it exists, reduce the above to the following two sentences:
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
#保存生效一下
source ~/.bashrc
#查看是否正确
nvcc -V
The configuration is correct as shown in the figure below:
3.2 View of CUDNN
The nano system has already installed cuda and cudnn, run the mnist case to verify whether cudnn is available.
#进入案例文件
cd /usr/src/cudnn_samples_v8/mnistCUDNN/mnistCUDNN
#编译一下例子
sudo make
#运行测试
./mnistCUDNN
Note: If the above fails to run, you can add permissions as follows:
sudo chmod a+x mnistCUDNN # Add execution permissions to executable files
Successful operation is the final display test result: 1 3 5
3.3 View of OpenCV
Check the normal use and version of Opencv under python
python
import cv2
print(cv2.__version__)
The output is the system OpenCV version