ubuntu18.04安装CUDA10.0

1、更新驱动

在这里插入图片描述
对于CUDA10.0,要求驱动版本大于410.48,因此首先要更新驱动

ubuntu-drivers devices(查看所有驱动)
sudo ubuntu-drivers autoinstall(自动安装最适合的驱动)

查看驱动版本

nvidia-smi
在这里插入图片描述

2、下载CUDA10.0

https://developer.nvidia.com/cuda-toolkit-archive

选择10.0版本后,进行如下选择
在这里插入图片描述
下载这个2.0G的。

3、安装

  • 将下载的包复制到主目录下
  • 运行以下命令

chmod 777 cuda_10.0.130_410.48_linux.run
sudo ./cuda_10.0.130_410.48_linux.run

  • 在终端中根据提示一步一步操作,如下所示,这里面特别要留意:不要安装显卡驱动。
Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 410.48?
(y)es/(n)o/(q)uit: n

Install the CUDA 10.0 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-10.0 ]: 

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 10.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /home/test ]: 

Installing the CUDA Toolkit in /usr/local/cuda-10.0 ...
  • 安装结束,终端中会显示如下信息:
Installing the CUDA Toolkit in /usr/local/cuda-10.0 ...
Missing recommended library: libGLU.so
Missing recommended library: libX11.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so

Installing the CUDA Samples in /home/test ...
Copying samples to /home/test/NVIDIA_CUDA-10.0_Samples now...
Finished copying samples.

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-10.0
Samples:  Installed in /home/test, but missing recommended libraries

Please make sure that
 -   PATH includes /usr/local/cuda-10.0/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-10.0/lib64, or, add /usr/local/cuda-10.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-10.0/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.0/doc/pdf for detailed information on setting up CUDA.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 384.00 is required for CUDA 10.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run -silent -driver

Logfile is /tmp/cuda_install_8442.log
  • 安装缺失的包
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev 

4、配置环境变量

sudo gedit ~/.bashrc

  • 在末尾写入
# for CUDA 10.0
export CUDA_10_0_HOME=/usr/local/cuda-10.0
export PATH=$PATH:$CUDA_10_0_HOME/bin 
export LD_LIBRARY_PATH=CUDA_10_0_HOME/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

在这里插入图片描述

  • 运行环境变量

source ~/.bashrc

5、验证

cd /usr/local/cuda/samples/1_Utilities/deviceQuery
./deviceQuery

在这里插入图片描述

nvcc --version

在这里插入图片描述

cat /usr/local/cuda/version.txt

在这里插入图片描述

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值