Nvidia Jetson Orin NX配置环境配置环境
- 一、安装jetson5.1.2
- 二、安装jtop
- 三、配置CUDA和cuDNN
- 四、安装Pytorch
先导片:Jetson采用arm64架构
一、安装jetson5.1.2
安装好jetson自带cuda、cudnn和tensorRT
官方文档
-
更换源
sudo vi /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
-
更新源
sudo apt install python3-pip
sudo -H pip3 install -U pip
sudo -H pip install jetson-stats
-
安装jetson
sudo apt install nvidia-jetpack
二、安装jtop
-
安装
sudo apt install python3-pip sudo -H pip3 install -U pip sudo -H pip install jetson-stats
-
查看
sudo jtop
在这里插入代码片
三、配置CUDA和cuDNN
-
配置环境变量
vim ~/.bashrc
增加以下内容
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
export PATH=/usr/local/cuda/bin:$PATH
export CUDA_HOME=/usr/local/cuda -
更新环境变量
source ~/.bashrc
-
复制文件到cuda目录
cd /usr/include && sudo cp cudnn* /usr/local/cuda/include cd /usr/lib/aarch64-linux-gnu && sudo cp libcudnn* /usr/local/cuda/lib64
-
查看CUDA
nvcc -V
-
修改文件权限
sudo chmod 777 /usr/local/cuda/include/cudnn.h sudo chmod 777 /usr/local/cuda/lib64/libcudnn*
-
重新软链接
#这里的8.6.0和8对应安装的cudnn版本号和首数字 cd /usr/local/cuda/lib64 sudo ln -sf libcudnn.so.8.6.0 libcudnn.so.8 sudo ln -sf libcudnn_ops_train.so.8.6.0 libcudnn_ops_train.so.8 sudo ln -sf libcudnn_ops_infer.so.8.6.0 libcudnn_ops_infer.so.8 sudo ln -sf libcudnn_adv_train.so.8.6.0 libcudnn_adv_train.so.8 sudo ln -sf libcudnn_adv_infer.so.8.6.0 libcudnn_adv_infer.so.8 sudo ln -sf libcudnn_cnn_train.so.8.6.0 libcudnn_cnn_train.so.8 sudo ln -sf libcudnn_cnn_infer.so.8.6.0 libcudnn_cnn_infer.so.8 sudo ldconfig
- 查看cuDNN
dpkg -l libcudnn8
8. 报错libopenblas.so.0: cannot open shared object file: No such file or director
sudo apt-get install libopenblas-dev
四、安装Pytorch
torch官方教程
torch下载文档
torch下载地址
torch2.0.0
对应torchvision0.15.1
pip install torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl
torchvision下载
sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libopenblas-dev libavcodec-dev libavformat-dev libswscale-dev
将解压后的文件夹命名为torchvision
export BUILD_VERSION=0.15.1
python3 setup.py install --user