xavier nx 安裝cuda, cudnn, tensorrt, opencv, 中文輸入法
xavier 刷機成功後
1. 安裝cuda( 參考https://blog.csdn.net/weixin_46263207/article/details/121419420)
sudo dpkg -i cuda-repo-l4t-10-2local-10.2.89_1.0-1_arm64.deb**
出现了下面这个错
**The public CUDA GPG key does not appear to be installed.
To install the key, run this command:
sudo apt-key add /var/cuda-repo-10-2-local/7fa2af80.pub
嘗試解決
sudo apt-key add /var/cuda-repo-10-2-local/7fa2af80.pub
sudo apt update
sudo apt install cuda-toolkit-10-2
成功解決
2. 安裝cudnn
sudo dpkg -i libcudnn8_8.0.0.180-1+cuda10.2_arm64.deb
sudo dpkg -i libcudnn8.0.0.180-1+cuda9.0_arm64.deb
sudo dpkg -i libcudnn8-doc_8.0.0.180-1+cuda10.2_arm64.deb
安装完成后,其实是安装到了默认安装路径usr/include和usr/lib下,因此,需要将其拷贝到cuda安装路径下
sudo cp /usr/include/cudnn.h /usr/local/cuda/include/
sudo cp /usr/lib/aarch64-linux-gnu/libcudnn* /usr/local/cuda/lib64/
sudo apt-get -f install
执行下面命令,重新生成cudnn库软连接
cd /usr/local/cuda/lib64
sudo chmod +r libcudnn*
sudo rm -rf libcudnn.so libcudnn.so.8
sudo ln -s libcudnn.so8.0.0 libcudnn.so.8
sudo ln -s libcudnn.so.8 libcudnn.so
sudo ldconfig
sudo ldconfig的时候出错:
/sbin/ldconfig.real: /usr/local/cuda-10.2/targets/aarch64 linux /lib /libcudnn_adv_infer.so.8 is not a symbolic link
注意:以上的錯誤可能有多條, 統一使用下面方法解決
sudo rm /usr/local/cuda-10.2/targets/aarch64 linux /lib /libcudnn_adv_infer.so.8
sudo ln -sf /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudnn_ops_train.so.8.0.0 /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudnn_ops_train.so.8
sudo ln -sf /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudnn_ops_train.so.8 /usr/local/cuda-10.2/targets/aarch64-linux/lib/libcudnn_ops_train.so
最後
sudo ldconfig
source ~/.bashrc
安裝完成
測試nvcc
nvcc -V
出現bash: nvcc: command not found
添加環境變量:
vim ~/.bashrc
在結尾添加:
export LD_LIBRARY_PATH=/usr/local/cuda/lib export PATH=$PATH:/usr/local/cuda/bin
export PATH=$PATH:/usr/local/cuda/bin
然後:
source ~/.bashrc
測試cudnn
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
輸出:
#define CUDNN_MAJOR 8
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 0
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)#endif /* CUDNN_VERSION_H */
表示成功
3. 安裝tensorrt
sudo dpkg -i tensorrt_7.1.3.0-1+cuda10.2_arm64.deb
出現錯誤: 找不到依賴(參考https://www.cnblogs.com/pandabang/p/11497245.html)
Reading database ... 227173 files and directories currently installed.)
Preparing to unpack xxx.deb ...
Unpacking xxx (1.0.0) over (1.0.0) ...
dpkg: dependency problems prevent configuration of xxx:
xxx depends on yyy; however:
Package yyy is not installed.
修復:
sudo apt-get -f install
再次安裝
sudo dpkg -i tensorrt_7.1.3.0-1+cuda10.2_arm64.deb
成功
4. 安裝中文輸入法
參考鏈接:https://blog.csdn.net/weixin_41010198/article/details/111287391
成功後但是发现输入法没有选择框,是因为有个东西阻止了
卸载它即可
killall fcitx-qimpanel
sudo apt-get remove fcitx-ui-qimpanel
5. 安裝opencv
sudo dpkg -i OpenCV-4.1.1-2-gd5a58aa75-aarch64-python.deb
sudo dpkg -i OpenCV-4.1.1-2-gd5a58aa75-aarch64-dev.deb
sudo dpkg -i OpenCV-4.1.1-2-gd5a58aa75-aarch64-libs.deb
sudo dpkg -i OpenCV-4.1.1-2-gd5a58aa75-aarch64-licenses.deb
sudo dpkg -i OpenCV-4.1.1-2-gd5a58aa75-aarch64-samples.deb
5.安裝jtop(可查看gpu, cpu, Opencv, tensorrt, CUDA等信息)
參考:https://blog.csdn.net/weixin_41010198/article/details/111287391
/usr/local/cuda-10.2/targets/aarch64 linux /lib /libcudnn_adv_infer.so.8