CUDA 安装失败 Ubunutu 18.04.5

CUDA 安装失败 Ubunutu 18.04.5

我正在尝试使用 Ubuntu 18.04.5 为我的 GTX 3060 Ti 安装 CUDA 工具包。我从 NVidia 网站下载了文件 cuda_11.2.1_460.32.03_linux.run 并按照说明操作,但出现以下错误

guser@m:~$ sudo ./cuda_11.2.1_460.32.03_linux.run 
[sudo] password for guser@m: 
Installation failed. See log at /var/log/cuda-installer.log for details.

cuda-installer 日志没什么帮助

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 

[INFO]: Initializing menu
[INFO]: Setup complete
[INFO]: Components to install: 
[INFO]: Driver
[INFO]: 460.32.03
[INFO]: Executing NVIDIA-Linux-x86_64-460.32.03.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd  2>&1
[INFO]: Finished with code: 36096
[ERROR]: Install of driver component failed.
[ERROR]: Install of 460.32.03 failed, quitting

检查 nvidia-installer.log 我有

guser@m:~$ tail /var/log/nvidia-installer.log 
[ 1539.155133] nvidia-uvm: Unloaded the UVM driver.
[ 1539.187421] nvidia-nvlink: Unregistered the Nvlink Core, major device number 236
WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set up for 32-bit compatibility. 32-bit compatibility files will not be installed; if you wish to install them, re-run the installation and set a valid directory with the --compat32-libdir option.
Will install libglvnd libraries.
Will install libEGL vendor library config file to /usr/share/glvnd/egl_vendor.d
-> Searching for conflicting files:
-> done.
-> Installing 'NVIDIA Accelerated Graphics Driver for Linux-x86_64' (460.32.03):
   executing: '/sbin/ldconfig'...
   executing: '/sbin/depmod -a '...

不知道问题出在哪里。

答案1


如果您研究一下这些 apt-packages 包含什么
以及如何使用它们,您很可能会得到一个更好的开始...

$ lsb_release -d
Description:    Ubuntu 18.04.5 LTS

$ sudo apt install nvidia-cuda-_ # hit TAB with the cursor at _
nvidia-cuda-dev      nvidia-cuda-doc      nvidia-cuda-gdb      nvidia-cuda-toolkit 

还要注意,您可能需要查看您当前拥有的 nvidia 驱动程序的版本;

这将显示名称或注释中带有 nvidia 的已安装内容:

$ dpkg --list | grep -E ^ii.*nvidia

... 根据您对硬件的支持(或不支持),您可能需要更新驱动程序。

相关内容