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 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/gdengden/article/details/86379607