ubuntu18.04anzhaungcudnn
时间: 2024-03-05 10:43:33 浏览: 70
要在Ubuntu 18.04上安装cudnn,您需要执行以下步骤:
1. 下载cudnn软件包并解压缩:
```bash
tar -zxvf cudnn-11.0-linux-x64-v8.0.4.30.tgz
```
2. 复制解压缩后的文件到相应目录中:
```bash
sudo cp -rf cuda/include/cudnn* /usr/local/cuda/include/
sudo cp -rf cuda/lib64/libcudnn* /usr/local/cuda/lib64/
```
3. 为文件设置适当的权限:
```bash
sudo chmod a+r /usr/local/cuda/include/cudnn*
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
```
4. 安装cudnn相关的deb软件包:
```bash
sudo dpkg -i libcudnn8_8.0.4.30-1+cuda11.0_amd64.deb
sudo dpkg -i libcudnn8-dev_8.0.4.30-1+cuda11.0_amd64.deb
sudo dpkg -i libcudnn8-samples_8.0.4.30-1+cuda11.0_amd64.deb
```
5. 添加cudnn到环境变量中,打开.bashrc文件并在文件末尾添加以下语句:
```bash
gedit ~/.bashrc
export PATH=$PATH:/usr/local/cuda-11.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.0/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-11.0/lib64
```
完成这些步骤后,您应该成功安装了cudnn。
阅读全文