如下教程可分步骤单独安装SDK Packages,此教程对应的JetPack版本是JetPack4.4-L4T-R32.4.3/JetPack4.4.1-L4T-R32.4.4(如需要其他版本请参考此方法,下载对应版本即可)
JetPack4.4 SDK Packages:(百度网盘共享链接):
链接: https://pan.baidu.com/s/1XqLujhw5dc423WBGJsXcgg
提取码:x7ck
0. 查看jetson 版本(命令:jetson_release)
nvidia@nx:~$ jetson_release
- NVIDIA Jetson Xavier NX
* Jetpack 4.4 [L4T 32.4.3]
* NV Power Mode: MODE_10W_2CORE - Type: 3
* jetson_clocks service: inactive
- Libraries:
* CUDA: 10.2.89
* cuDNN: 8.0.0.180
* TensorRT: NOT_INSTALLED
* Visionworks: NOT_INSTALLED
* OpenCV: NOT_INSTALLED compiled CUDA: NO
* VPI: NOT_INSTALLED
* Vulkan: 1.2.70
nvidia@nx:~$
1. CUDA-10.2安装 JetPack4.4/4.4.1 CUDA版本相同
$sudo dpkg -i /opt/nvidia/deb_repos/cuda-repo-l4t-10-2-local-10.2.89_1.0-1_arm64.deb
#安装完成会提示pub key, 根据提示添加apt key(.pub),例如:
$sudo apt-key add /var/cuda-repo-10-2-local-10.2.89/7fa2af80.pub
$sudo apt-get -y update
$sudo apt-get -y install cuda-toolkit-10-2
#以上安装完成后,通过nvcc 查询不到,但可以搜索目录/usr/local 是否有cuda,此时可通过添加环境变量 ~/.bash.rc
$vi ~/.bashrc
export PATH=/usr/local/cuda-10.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
nvidia@nx:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_21:14:42_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
2. cuDNN-8.0安装 JetPack4.4/4.4.1 cuDNN版本相同
$sudo dpkg -i libcudnn8_8.0.0.180-1+cuda10.2_arm64.deb
$sudo dpkg -i libcudnn8-dev_8.0.0.180-1+cuda10.2_arm64.deb
$sudo dpkg -i libcudnn8-doc_8.0.0.180-1+cuda10.2_arm64.deb
$sudo apt-get -y update
以上安装完成后,通过jetson_release 查看安装后的版本信息
$ jetson_release
安装CUDA和cuDNN 后, 剩余空间约2.8GB
3. TensorRT-7.13安装 JetPack4.4/4.4.1 TensorRT版本相同
$sudo dpkg -i libnvinfer7_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvinfer-plugin7_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvinfer-plugin-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvonnxparsers7_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvonnxparsers-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvparsers7_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvparsers-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvinfer-bin_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i libnvinfer-doc_7.1.3-1+cuda10.2_all.deb
$sudo dpkg -i libnvinfer-samples_7.1.3-1+cuda10.2_all.deb
$sudo dpkg -i tensorrt_7.1.3.0-1+cuda10.2_arm64.deb
$sudo dpkg -i python-libnvinfer_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i python-libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i python3-libnvinfer_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i python3-libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i graphsurgeon-tf_7.1.3-1+cuda10.2_arm64.deb
$sudo dpkg -i uff-converter-tf_7.1.3-1+cuda10.2_arm64.deb
或
$sudo dpkg -i libnvinfer7_7.1.3-1+cuda10.2_arm64.deb libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb libnvinfer-plugin7_7.1.3-1+cuda10.2_arm64.deb libnvinfer-plugin-dev_7.1.3-1+cuda10.2_arm64.deb libnvonnxparsers7_7.1.3-1+cuda10.2_arm64.deb libnvonnxparsers-dev_7.1.3-1+cuda10.2_arm64.deb libnvparsers7_7.1.3-1+cuda10.2_arm64.deb libnvparsers-dev_7.1.3-1+cuda10.2_arm64.deb libnvinfer-bin_7.1.3-1+cuda10.2_arm64.deb libnvinfer-doc_7.1.3-1+cuda10.2_all.deb libnvinfer-samples_7.1.3-1+cuda10.2_all.deb tensorrt_7.1.3.0-1+cuda10.2_arm64.deb python-libnvinfer_7.1.3-1+cuda10.2_arm64.deb python-libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb python3-libnvinfer_7.1.3-1+cuda10.2_arm64.deb python3-libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb graphsurgeon-tf_7.1.3-1+cuda10.2_arm64.deb uff-converter-tf_7.1.3-1+cuda10.2_arm64.deb
$sudo apt-get -y update
以上安装完成后,通过jetson_release 查看安装后的版本信息
$ jetson_release
4. OpenCV 安装
由于NVIDIA SDKManager自带安装的OpenCV都不支持CUDA, 所以安装意义不大,不如通过源码编译安装,如下介绍NX/Nano的OpenCV 源码编译安装!
参考:Nano_build_opencv
$git clone https://github.com/mdegans/nano_build_opencv.git
$cd nano_build_opencv/
$./build_opencv.sh 4.3.0
#指定版本编译,下载时间一般较长,把如下一句指令注释掉可节约一些时间
#sudo apt-get dist-upgrade -y --autoremove
问题1、 编译opencv_contrib或opencv时提示缺少boostdesc_bgm.i等编译错误
错误:
opencv_contrib/modules/xfeatures2d/src/boostdesc.cpp:673:20: fatal error: boostdesc_bgm.i: No such file or directory
解决:
由于采用的是opencv源码编译方式,可查看 build文件夹下的日志文件 CMakeDownloadLog.txt并搜索 boostdesc_bgm.i 关键词 ,发现这个文件下载失败同时还有其他一些.i 文件下载识别,此txt日志文件中有它们的下载地址,直接复制其下载地址到网页可以看该到文件的源码,可直接拷贝源码并保存同名文件,存放于opencv_contrib/modules/xfeatures2d/src/ 路径下,文件包含:
boostdesc_bgm.i
boostdesc_bgm_bi.i
boostdesc_bgm_hd.i
boostdesc_lbgm.i
boostdesc_binboost_064.i
boostdesc_binboost_128.i
boostdesc_binboost_256.i
vgg_generated_120.i
vgg_generated_64.i
vgg_generated_80.i
vgg_generated_48.i
或 通过上面百度网盘分享的opencv 4.3.0 源码编译安装
下载并解压缩:opencv.gz、opencv_contrib.gz、build_opencv.sh
$mkdir -p /tmp/build_opencv
$cd /tmp/build_opencv
$tar zxvf opencv.gz
$tar zxvf opencv_contrib.gz
$./build_opencv.sh
附录:
安装完成,第一件事把已安装好的镜像备份出来,备份及升级方法参考连接:
Jetson个平台系统升级命令合集
5. DeepStream 安装
下载tar 或 deb 安装包进行安装即可
https://developer.nvidia.com/assets/Deepstream/5.0/ga/secure/deepstream_sdk_5.0_jetson.tbz2
https://developer.nvidia.com/assets/Deepstream/5.0/ga/secure/deepstream_sdk_5.0_arm64.deb
DeepStream Apps
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps