Ubuntu 20.04 安装CUDA11.1 和cudnn 8.0.5

Install CUDA

cuda 11.1
百度网盘链接
密码: bo6f

sudo sh cuda_11.1.0_455.23.05_linux.run

把第一个X,用enter键去掉,去掉之后,如下所示
在这里插入图片描述

安装成功后跳出

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

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.1/
Samples:  Not Selected

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

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.1/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least .00 is required for CUDA 11.1 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 /var/log/cuda-installer.log

修改 ~/.bashrc 文件

sudo vim ~/.bashrc

add the following lines to the end of the file ~/.bashrc

export PATH=/usr/local/cuda-11.1/bin${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:${LD_LIBRARY_PATH}

source ~/.bashrc

Install cudnn

https://developer.nvidia.com/rdp/cudnn-archive

cudnn 8.0.5
百度网盘
密码: 935g

tar xvzf cudnn-10.0-linux-x64-v7.6.4.38.tgz
sudo cp -rp cuda/include/cudnn.h /usr/local/cuda-11.1/include
sudo cp -rp cuda/lib64/libcudnn* /usr/local/cuda-11.1/lib64
sudo chmod a+r /usr/local/cuda-11.1/include/cudnn.h /usr/local/cuda-11.1/lib64/libcudnn*

重启

nvcc -V
zdx@wood:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是在 Ubuntu 20.04 安装 CUDA 11.1 的步骤: 1. 下载 CUDA 11.1安装包。可以在 NVIDIA 官方网站上下载适用于 Ubuntu 20.04CUDA 11.1 安装包。链接如下:https://developer.nvidia.com/cuda-downloads 2. 安装必要的软件包。在安装 CUDA 之前,需要先安装必要的软件包。可以使用以下命令安装: ``` $ sudo apt-get update $ sudo apt-get install build-essential dkms freeglut3 freeglut3-dev libxi-dev libxmu-dev ``` 3. 禁用 Nouveau 驱动。在安装 CUDA 之前,需要先禁用 Nouveau 驱动。可以按照以下步骤进行操作: - 编辑 /etc/modprobe.d/blacklist.conf 文件: ``` $ sudo nano /etc/modprobe.d/blacklist.conf ``` - 在文件末尾添加以下内容: ``` blacklist nouveau options nouveau modeset=0 ``` - 保存并关闭文件。 - 更新 initramfs: ``` $ sudo update-initramfs -u ``` - 重启系统。 4. 安装 CUDA 11.1。可以按照以下步骤进行操作: - 进入下载的 CUDA 11.1 安装包所在的目录。 - 运行安装程序: ``` $ sudo sh cuda_11.1.0_455.23.05_linux.run ``` 安装程序将提示你接受 NVIDIA 的许可协议。接受后,将会提示你选择安装位置和组件。默认情况下,安装位置为 /usr/local/cuda-11.1,而所有的组件都会被安装。 - 安装完成后,需要将 CUDA 的路径添加到 PATH 环境变量中。可以编辑 ~/.bashrc 文件,在文件末尾添加以下内容: ``` export PATH=/usr/local/cuda-11.1/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} ``` 保存并关闭文件,然后运行以下命令使其生效: ``` $ source ~/.bashrc ``` 至此,CUDA 11.1 已经成功安装Ubuntu 20.04 中了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值