Linux18.04中安装cuda
时间: 2023-10-17 10:28:50 浏览: 162
在Linux 18.04中安装CUDA,可以按照以下步骤进行操作。首先,下载CUDA的本地安装包并安装:
```
wget https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
```
然后,添加密钥并更新apt-get:
```
sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
```
接下来,安装CUDA:
```
sudo apt-get -y install cuda
```
此外,你还需要将解压出来的CUDA目录下的include和lib64文件夹中的文件复制到/usr/local/cuda-10.1下的include和lib64目录,并设置权限:
```
sudo cp cuda/include/cudnn.h /usr/local/cuda-10.1/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64
sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h /usr/local/cuda-10.1/lib64/libcudnn*
```
完成以上步骤后,你就成功地在Linux 18.04中安装了CUDA。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [如何在ubuntu18.04中安装 cuda11.0 + cudnn8](https://blog.csdn.net/weixin_44009878/article/details/113926893)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [【无坑安装】linux(ubuntu18.04)下安装CUDA +cuDNN + Pytorch](https://blog.csdn.net/qq_42642142/article/details/125820514)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文