Linux服务器上安装CUDA11.2和对应的cuDNN 8.4.0

news2024/11/23 3:43:55

一、检查

检查本机是否有CUDA工具包,输入nvcc -V:

如图所示,服务器上有CUDA,但版本为9.1.85,版本过低,因此博主要重装一个新的。

二、安装CUDA

1.查看服务器最高支持的CUDA版本

在命令行输入nvidia-smi查看显卡驱动版本也就是最高支持的CUDA工具包版本。
例如,本机可安装11.7及以下的CUDA工具包:

2.官网下载CUDA安装包

在NVIDIA官网选择对应版本的CUDA工具包并选择你的机器配置,我们就选择11.2.0版本下载

在终端执行如下命令:

wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda_11.2.0_460.27.04_linux.run
sudo sh cuda_11.2.0_460.27.04_linux.run

3.安装CUDA 

如果出现以下提示,选择continue并在下面取消安装驱动即可。

 根据提示一步步安装,手动输入accept确认。

 我们已经有驱动了,这里取消安装驱动,上下键跳转选项,回车键选择是否安装。

因为我服务器上之前安装过CUDA12,所以会出现这个提示。它表示已经找到了一个现有的CUDA Toolkit 11.2安装,并询问用户是否要升级所有组件或者选择要升级的组件。如果用户不想继续安装,可以选择"No, abort installation"来中止安装过程。我这里选择选择Upgrade all

稍作等待,出现以下提示信息就安装好了,可以看到CUDA安装到了/usr/local/cuda-11.2/

 注意看提示 make sure that:  意思是要添加环境变量 

4.配置环境变量

 输入如下指令查看PATH和LD_LIBRARY_PATH中环境变量

echo $PATH
echo $LD_LIBRARY_PATH

查看有无添加上述两个环境变量,若无,则采用如下两种方法添加环境变量 

 法1: 直接运行export命令定义变量【只对当前shell(BASH)有效(临时的)】  

export PATH=$PATH:/usr/local/cuda-11.2/bin
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64

 法二:在用户目录下的.bashrc文件中增加变量【(永久的)】

sudo vim ~/.bashrc

 点i进入编辑模式,在最后一行输入

export PATH=$PATH:/usr/local/cuda-11.2/bin
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64

 输入好了按Esc退出编辑模式,然后输入:wq 保存退出就好

 保存好了之后注意,这个时候如果查看环境变量会发现还是没有添加好的,所以我们需要更新一下bashrc文件。更新指令如下:

source ~/.bashrc

输入nvcc -V查看cuda版本

图示为安装成功。 

我出现的问题:

安装了新的cuda后nvcc -V依然显示旧版本

输入nvcc -V任显示旧版本的v9.1

但查看环境路径却已经配好

 解决办法是:
1.执行sudo apt-get remove nvidia-*卸载原驱动。
2.这时候nvcc -V就会显示下方的图片的错误。

3.下载驱动

  • 输入下条命令,查看你的显卡驱动所使用的内核版本
cat /proc/driver/nvidia/version

 可以看出内核版本为515.105.01

  • 输入下条命令,查看电脑驱动
cat /var/log/dpkg.log | grep nvidia

 2022-05-22 06:24:13 upgrade libnvidia-common-470:all 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:24:13 status half-configured libnvidia-common-470:all 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:24:13 status unpacked libnvidia-common-470:all 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:24:13 status half-installed libnvidia-common-470:all 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:24:14 status half-installed libnvidia-common-470:all 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:24:14 status unpacked libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:24:14 status unpacked libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:24:14 configure libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:24:14 status unpacked libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:24:14 status half-configured libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:24:14 status installed libnvidia-common-470:all 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:58 upgrade nvidia-driver-460:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:58 status half-configured nvidia-driver-460:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:25:58 status unpacked nvidia-driver-460:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:25:58 status half-installed nvidia-driver-460:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:25:58 status half-installed nvidia-driver-460:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:25:58 status unpacked nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:58 status unpacked nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:58 configure nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:25:58 status unpacked nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:59 status half-configured nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:25:59 status installed nvidia-driver-460:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:30:36 upgrade nvidia-driver-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:30:36 status half-configured nvidia-driver-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:36 status unpacked nvidia-driver-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status half-installed nvidia-driver-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status half-installed nvidia-driver-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status unpacked nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:30:37 status unpacked nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:30:37 upgrade libnvidia-gl-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:30:37 status half-configured libnvidia-gl-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status unpacked libnvidia-gl-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status half-configured libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:30:37 status half-installed libnvidia-gl-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:00 status half-installed libnvidia-gl-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:00 status unpacked libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:00 status unpacked libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:01 upgrade libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:01 status half-configured libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:01 status unpacked libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:01 status half-installed libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:04 status half-installed libnvidia-gl-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:05 status unpacked libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:05 status unpacked libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:05 upgrade nvidia-dkms-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:05 status half-configured nvidia-dkms-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:38 status unpacked nvidia-dkms-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:38 status half-installed nvidia-dkms-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:39 status half-installed nvidia-dkms-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:39 status unpacked nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:39 status unpacked nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:39 upgrade nvidia-kernel-source-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:39 status half-configured nvidia-kernel-source-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:39 status unpacked nvidia-kernel-source-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:39 status half-installed nvidia-kernel-source-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:41 status half-installed nvidia-kernel-source-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:41 status unpacked nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:42 status unpacked nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:42 upgrade nvidia-kernel-common-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:42 status half-configured nvidia-kernel-common-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:42 status unpacked nvidia-kernel-common-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:42 status half-installed nvidia-kernel-common-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:43 status half-installed nvidia-kernel-common-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:44 status unpacked nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:44 status unpacked nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:44 upgrade libnvidia-decode-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:44 status half-configured libnvidia-decode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:44 status unpacked libnvidia-decode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:44 status half-configured libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:44 status half-installed libnvidia-decode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:44 status half-installed libnvidia-decode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:45 status unpacked libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:45 status unpacked libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:45 upgrade libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:45 status half-configured libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:45 status unpacked libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:45 status half-installed libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:45 status half-installed libnvidia-decode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:45 status unpacked libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:45 status unpacked libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:46 upgrade libnvidia-compute-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:46 status half-configured libnvidia-compute-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:46 status unpacked libnvidia-compute-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:46 status half-configured libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:46 status half-installed libnvidia-compute-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:51 status half-installed libnvidia-compute-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:51 status unpacked libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:51 status unpacked libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:52 upgrade libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:52 status half-configured libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:52 status unpacked libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:52 status half-installed libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:56 status half-installed libnvidia-compute-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:56 status unpacked libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:56 status unpacked libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:56 upgrade libnvidia-extra-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:56 status half-configured libnvidia-extra-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:56 status unpacked libnvidia-extra-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:56 status half-installed libnvidia-extra-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:56 status half-installed libnvidia-extra-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:57 status unpacked libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:57 status unpacked libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:57 upgrade nvidia-compute-utils-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:57 status half-configured nvidia-compute-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:57 status unpacked nvidia-compute-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:57 status half-installed nvidia-compute-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:57 status half-installed nvidia-compute-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 upgrade libnvidia-encode-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-configured libnvidia-encode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked libnvidia-encode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-configured libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-installed libnvidia-encode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-installed libnvidia-encode-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 upgrade libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-configured libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status unpacked libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:58 status half-installed libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-installed libnvidia-encode-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 upgrade nvidia-utils-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-configured nvidia-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked nvidia-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-installed nvidia-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-installed nvidia-utils-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 upgrade xserver-xorg-video-nvidia-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-configured xserver-xorg-video-nvidia-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status unpacked xserver-xorg-video-nvidia-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:31:59 status half-installed xserver-xorg-video-nvidia-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status half-installed xserver-xorg-video-nvidia-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status unpacked xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:00 status unpacked xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:00 upgrade libnvidia-ifr1-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:00 status half-configured libnvidia-ifr1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status unpacked libnvidia-ifr1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status half-configured libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status half-installed libnvidia-ifr1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:00 status half-installed libnvidia-ifr1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:01 status unpacked libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:01 status unpacked libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:01 upgrade libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:01 status half-configured libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:01 status unpacked libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:01 status half-installed libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:01 status half-installed libnvidia-ifr1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:01 status unpacked libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:01 status unpacked libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:02 upgrade libnvidia-fbc1-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-configured libnvidia-fbc1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status unpacked libnvidia-fbc1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-configured libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-installed libnvidia-fbc1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-installed libnvidia-fbc1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status unpacked libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:02 status unpacked libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:02 upgrade libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-configured libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status unpacked libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-installed libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:02 status half-installed libnvidia-fbc1-470:i386 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:03 status unpacked libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 status unpacked libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 upgrade libnvidia-cfg1-470:amd64 470.103.01-0ubuntu0.18.04.1 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 status half-configured libnvidia-cfg1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:03 status unpacked libnvidia-cfg1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:03 status half-installed libnvidia-cfg1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:03 status half-installed libnvidia-cfg1-470:amd64 470.103.01-0ubuntu0.18.04.1
2022-05-22 06:32:03 status unpacked libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 status unpacked libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 configure nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:03 status unpacked nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:03 status half-configured nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status installed nvidia-kernel-common-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 configure libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:30 status unpacked libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status half-configured libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status installed libnvidia-gl-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 configure libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:30 status unpacked libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status half-configured libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status installed libnvidia-gl-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 configure libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:30 status unpacked libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status half-configured libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status installed libnvidia-fbc1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 configure libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:30 status unpacked libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status half-configured libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 status installed libnvidia-fbc1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:30 configure libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:30 status unpacked libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-compute-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status unpacked libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-compute-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-cfg1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-ifr1-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-ifr1-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed xserver-xorg-video-nvidia-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status installed libnvidia-extra-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 configure nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:31 status unpacked nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:31 status half-configured nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status installed nvidia-kernel-source-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 configure nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:32 status unpacked nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status half-configured nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status installed nvidia-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 configure libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:32 status unpacked libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status half-configured libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status installed libnvidia-decode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 configure libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:32 status unpacked libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status half-configured libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status installed libnvidia-decode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 configure nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:32:32 status unpacked nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:32:32 status half-configured nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status installed nvidia-dkms-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 configure nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:35:03 status unpacked nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status half-configured nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status installed nvidia-compute-utils-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 configure libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:35:03 status unpacked libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status half-configured libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status installed libnvidia-encode-470:i386 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 configure libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:35:03 status unpacked libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status half-configured libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 status installed libnvidia-encode-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:03 configure nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1 <无>
2022-05-22 06:35:03 status unpacked nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:04 status half-configured nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1
2022-05-22 06:35:04 status installed nvidia-driver-470:amd64 470.129.06-0ubuntu0.18.04.1

 可以看到由470.103.01升级到了515.105.01

  • 输入下条命令,查看电脑所有驱动
sudo dpkg --list | grep nvidia-*
  • 卸载现有驱动,重新安装

sudo /usr/bin/nvidia-uninstall
sudo apt-get --purge remove nvidia-*
sudo apt-get purge nvidia*
sudo apt-get purge libnvidia*

 其中第二行可能会出现:

那就按他说的做 

sudo apt autoremove nvidia-*
  • 直到命令不输出任何内容
sudo dpkg --list | grep nvidia-*
  • 查找可用的驱动版本
ubuntu-drivers devices

那我就安装515吧,带有server的是针对没有图形化界面的服务器的。

  • 重新安装
sudo apt-get install nvidia-driver-515 nvidia-settings nvidia-prime

3.然后按照安装cuda的步骤安装后再nvcc -V就可以显示安装的cuda版本信息。

三、安装cuDNN

1.根据安装的CUDA工具包版本在官网选择适合版本的cuDNN,本文安装的CUDA版本是11.2,就选择与之对应的cuDNN v8.4.0,选择Local Installer for Linux x86_64 (Tar)

2. 复制cuDNN库的链接,使用wget下载或者下载到自己电脑之后再传到服务器上。

  • 我的服务器网速有点慢,所以选择先下到自己电脑再传上去,速度很快啊。

 

 3.解压cuDNN文件,并进入解压出的文件夹,拷贝文件到/usr/local/cuda-11.2中

	tar -xvf cudnn-linux-x86_64-8.4.0.27_cuda11.6-archive.tar.xz
	cd cudnn-linux-x86_64-8.4.0.27_cuda11.6-archive
	sudo cp lib/* /usr/local/cuda-11.2/lib64/
	sudo cp include/* /usr/local/cuda-11.2/include/
	sudo chmod a+r /usr/local/cuda-11.2/lib64/*
	sudo chmod a+r /usr/local/cuda-11.2/include/*

 4. 

查看cuDNN版本,旧版本指令为cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A2,新版本有更新,将cuDNN版本信息单拉了一个文件名为cudnn_version.h,所以新版本查看cuDNN版本的命令为cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

 上述教程为这台机器上的所有用户安装了CUDA和cuDNN,我们查看nvcc是否能用。

好的,安装完成。 

参考文章:Failed to initialize NVML: Driver/library version mismatch_failed to initialize nvidia driver-CSDN博客

Linux安装CUDA & 添加环境变量 & 多版本CUDA切换 (软链接)-CSDN博客

【Linux】安装CUDA 11.2 和 cuDNN 8.4.0并检查是否安装成功_linux查看cudnn是否安装成功-CSDN博客

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1893752.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

航空数据管控系统-①项目准备阶段:任务2:项目技术预研(技术架构)

任务描述 掌握项目的总体功能&#xff0c;及实现流程。预习项目中所使用到的技术和知识点。 任务指导 一、项目效果展示 图1-数据统计大屏页面 图2-航空实时监控页面 二、项目架构 1、总体架构&#xff1a; 2、技术架构 技术清单&#xff1a; 功能 组件 说明 消息中间件…

MySQL 三大日志 ( binlog、redo log 和 undo log ) 的作用?

MySQL是一个功能强大的关系型数据库管理系统&#xff0c;它的高可靠性、高性能和易用性使得它成为众多企业和开发者的首选。在MySQL内部&#xff0c;为了保证数据的完整性、恢复能力和并发性能&#xff0c;设计了一套复杂的日志系统。其中&#xff0c;redo log、bin log和undo …

数据开发人员如何真正理解业务、并构建业务模型?

问题背景 最近有同学在问&#xff0c;新到一家公司&#xff0c;如何去深入理解业务&#xff1f;并高于业务视角呢&#xff1f; 针对这个问题 &#xff0c;我们将问题进行拆分以下几点进行回答&#xff0c;首先懂业务的标准是什么&#xff1f; 根据笔者的经验将懂业务标准进行如…

百度出品_文心快码Comate提升程序猿效率

1.文心快码 文心快码包含指令、插件 和 知识三种功能&#xff0c; 1&#xff09;指令包含Base64编码、Base64解码、JSON转TS类型、JSON转YAML、JWT解码喂JSON。 2&#xff09;插件包含 3&#xff09;指令包含如下功能&#xff1a; 官网链接

2024最全前端面试系列(计算机网络)(非科班出身最薄弱的环节)

2020最全前端面试系列&#xff08;CSS&#xff09; 2020最全前端面试系列&#xff08;VUE&#xff09; 2020最全前端面试系列&#xff08;浏览器原理&#xff09; 2020最全前端面试系列&#xff08;数据结构&#xff09; 常见状态码 | | 类别 | 原因短语 | | — | — | —…

Laravel 谨慎使用Storage::append()

在 driver 为 local 时&#xff0c;Storage::append()在高并发下&#xff0c;会存在丢失数据问题&#xff0c;文件被覆写&#xff0c;而非尾部添加&#xff0c;如果明确是本地文件操作&#xff0c;像日志写入&#xff0c;建议使用 Illuminate\Filesystem\Filesystem或者php原生…

window下git bash设置启动后默认路径进入自己的工程

方法一&#xff1a;更改快捷方式 方法二&#xff1a;修改~/.bashrc

香港即将“放松”加密货币监管!加密牌照制度备受批评!全球主力军无法进入香港市场?动摇了香港Web3的信心!

2024年7月3日&#xff0c;香港金融服务及库务局局长许正宇在立法会会议上表示&#xff0c;香港金融管理局(HKMA)和证券及期货事务监察委员会(SFC)将根据市场发展情况&#xff0c;适时检讨虚拟资产相关活动的监管要求。 这一表态引发了人们对香港加密货币监管框架可能进行调整的…

Android Studio 大作业--学生信息管理系统

欢迎光临&#xff1a; 古之立大事者&#xff0c;不惟有超世之才&#xff0c;亦必有坚忍不拔之志。——苏轼 ---------------&#x1f34e;------------&#x1f349;-------------- &#x1f43c;学编程的bird的博客&#xff0c;邀您一起学习&#x1f98c; ----------------&am…

面试篇-Redis-3+分布式锁+集群部署

文章目录 前言一、你们项目中使用Redis 作为分布式锁吗1.1 将余券存入到Redis 中&#xff0c;当有人抢券进行-1操作并存回&#xff1a;1.2 分布式锁的使用1.3 Redis 分布式锁是怎么实现的&#xff1a;1.4 Redisson 分布式锁是可重入的吗&#xff1a;1.5 Redis 出现脑裂时如何保…

Java项目:基于SSM框架实现的班主任助理管理系统【ssm+B/S架构+源码+数据库+开题报告+毕业论文】

一、项目简介 本项目是一套基于SSM框架实现的班主任助理管理系统 包含&#xff1a;项目源码、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过严格调试&#xff0c;eclipse或者idea 确保可以运行&#xff01; 该系统功能完善、界面美观、操作简单、功…

防水头灯在户外探险的应用_鼎跃安全

随着我国民众生活品质的显著提升&#xff0c;人们对户外探险的热爱与参与度也日益高涨。在这一充满挑战与未知的旅途中&#xff0c;拥有一件可靠的照明设备成为了确保安全与探索乐趣的关键。面对户外多变的自然环境&#xff0c;包括突如其来的降雨、潮湿的森林小径等恶劣条件&a…

c++ primer plus 第15章友,异常和其他:友元类

c primer plus 第15章友&#xff0c;异常和其他&#xff1a;友元类 提示&#xff1a;这里可以添加系列文章的所有文章的目录&#xff0c;目录需要自己手动添加 例如&#xff1a;友元类 提示&#xff1a;写完文章后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的…

阳光倒灌试验太阳辐射系统日光模拟器

太阳光模拟器概述 太阳光模拟器是一种能在实验室环境下模拟太阳光照射特性的设备&#xff0c;广泛应用于材料科学、能源研究、环境科学等领域。通过模拟太阳光的光谱分布和辐射强度&#xff0c;太阳光模拟器可以为科研和工业提供稳定且可重复的光照条件&#xff0c;进而对材料…

如何隐藏和保护Excel表格中的敏感数据?

日常办公过程中&#xff0c;我们难免会遇到一些涉及个人隐私或商业机密等数据&#xff0c;那么该如何保护这些数据&#xff1f;现在&#xff0c;我将告诉你如何保护这些数据。 一、障眼法 我们选中要保护的数据&#xff0c;然后点击鼠标右键&#xff0c;选择设置单元格格式。选…

【WEB前端】---HTML---结构---笔记

目录 1.标签---单标签和双标签 1.1单标签 1.2双标签 2.基本结构标签 2.1HTML标签 2.2文档头部标签 2.3文档标题标签 2.4文档的主题标签 3.常用的标题标签 (n∈[1,6]) 4.段落标签 5.换行标签 6.文本格式化标签 6.1粗体 6.2倾斜 6.3删除线 6.4下划线 7.div和spa…

9.x86游戏实战-汇编指令mov

免责声明&#xff1a;内容仅供学习参考&#xff0c;请合法利用知识&#xff0c;禁止进行违法犯罪活动&#xff01; 本次游戏没法给 内容参考于&#xff1a;微尘网络安全 工具下载&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/1rEEJnt85npn7N38Ai0_F2Q?pwd6tw3 提…

Linux上快速定位Java代码问题行

生产环境中&#xff0c;经常会遇到CPU持续飙高或内存、IO飙高&#xff0c;如何快速定位问题点是很多新手头疼的问题&#xff0c;只能通过经验和代码推理&#xff0c;其实这里针对Java程序可以通过top和jstack命令&#xff0c;快速定位到问题代码。 Top命令的输出 具体定位之前…

ubuntu20.04配置调试工具

1.准备工作&#xff1a;安装g或者gdb sudo apt updatesudo apt install gg --versionsudo apt install gdbgdb --version 2.配置环境 2.1在本地新建一个main.cpp #include <iostream> #include <vector> #include <string>using namespace std;int main(…

【HarmonyOS4学习笔记】《HarmonyOS4+NEXT星河版入门到企业级实战教程》课程学习笔记(二十一)

课程地址&#xff1a; 黑马程序员HarmonyOS4NEXT星河版入门到企业级实战教程&#xff0c;一套精通鸿蒙应用开发 &#xff08;本篇笔记对应课程第 31 节&#xff09; P31《30.数据持久化-关系型数据库》 上一节中学习了使用用户首选项的方式实现数据持久化&#xff0c;但用户首…