如下教程可分步驟單獨安裝SDK Packages该默,此教程對應(yīng)的JetPack版本是JetPack4.4-L4T-R32.4.3/JetPack4.4.1-L4T-R32.4.4(如需要其他版本請參考此方法瞳氓,下載對應(yīng)版本即可)
JetPack4.4 SDK Packages:(百度網(wǎng)盤共享鏈接):
鏈接: 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, 根據(jù)提示添加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裹刮,此時可通過添加環(huán)境變量 ~/.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
#指定版本編譯,下載時間一般較長买鸽,把如下一句指令注釋掉可節(jié)約一些時間
#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 關(guān)鍵詞 癞谒,發(fā)現(xiàn)這個文件下載失敗同時還有其他一些.i 文件下載識別底燎,此txt日志文件中有它們的下載地址,直接復(fù)制其下載地址到網(wǎng)頁可以看該到文件的源碼弹砚,可直接拷貝源碼并保存同名文件双仍,存放于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
或 通過上面百度網(wǎng)盤分享的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個平臺系統(tǒng)升級命令合集
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