ubuntu18.04安裝cuda10 cudnn

一、卸載cuda8.0

使用cuda自帶的卸載工具進行卸載。


 
  1. cd /usr/local/cuda/bin

  2. sudo ./uninstall_cuda_9.0.pl

安裝指示卸載即可。

https://blog.csdn.net/yjt1325/article/details/84641062 安裝.deb文件過程。

The base installer is available for download below.

 

 Base Installer Download (1.6 GB)  
Installation Instructions:
  1. `sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb`
  2. `sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub`
  3. `sudo apt-get update`
  4. `sudo apt-get install cuda`
Other installation options are available in the form of meta-packages. For example, to install all the library packages, replace "cuda" with the "cuda-libraries-10-0" meta package. For more information on all the available meta packages click here.

The CUDA Toolkit contains Open-Source Software. The source code can be found here.
The checksums for the installer and patches can be found in Installer Checksums
For further information, see the Installation Guide for Linux and the CUDA Quick Start Guide.

 

 

一 安裝顯卡驅動:

直接在系統軟件更新中選擇安裝:

或者選擇PPA源安裝,參照:https://blog.csdn.net/new_delete_/article/details/81544438

輸入命令測試是否安裝成功:

nvidia-smi
 

二 安裝CUDA10

CUDA官網選擇適合自己系統的版本下載。

2、運行命令安裝CUDA10

sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
 

3、添加環境變量:

打開 .bashrc

sudo gedit ~/.bashrc
在末尾添加:

export CUDA_HOME=/usr/local/cuda 
export PATH=$PATH:$CUDA_HOME/bin 
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


保存退出

刷新環境變量:

source ~/.bashrc
測試CUDA是否安裝成功:

nvcc -V
界面如下:

三 安裝CUDNN

在官網下載安裝包,需要註冊登錄才能下載,選擇適合自己的版本(選擇deb安裝包,可直接安裝完成,而不需要人爲拷貝):

在這我選擇:cuDNN Runtime Library for Ubuntu18.04 (Deb)

 

安裝CUDNN:

sudo dpkg -i libcudnn7_7.4.1.5-1+cuda10.0_amd64.deb 
 

完成

 
--------------------- 
作者:yjt1325 
來源:CSDN 
原文:https://blog.csdn.net/yjt1325/article/details/84641062 
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章