我正在尝试在运行 Ubuntu 18.04.5 LTS 的台式机上安装 CUDA。这是一台 WIN-10 机器,我将其与 Ubuntu 双启动。我有两个用于 CUDA 的 NVIDIA TITAN RTX gpu 和一个用于运行显示器的 Intel gpu。
注意:未启用安全启动,下面显示的命令按如下方式运行:sudo -i
从 NVIDIA Linux 安装活动安装指南:
$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1e02 (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation Device 1e02 (rev a1)
$ uname -m && cat /etc/*release
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
$ gcc --version
gcc (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
$ apt-get install linux-headers-$(uname -r)
linux-headers-5.4.0-48-generic is already the newest version (5.4.0-48.52~18.04.1).
$ apt-get install nvidia-driver-455
nvidia-driver-455 is already the newest version (455.23.05-0ubuntu1).
nvidia-driver-455 set to manually installed.
满足先决条件后,安装 CUDA
$ apt-get install cuda
cuda is already the newest version (11.1.0-1).
$ apt install nvidia-cuda-toolkit
nvidia-cuda-toolkit is already the newest version (9.1.85-3ubuntu1).
执行安装后操作:
/usr/local/cuda-11.1/bin
已添加到PATH
通过.bashrc
/usr/local/cuda-11.1/lib64
已添加到LD_LIBRARY_PATH
通过.bashrc
推荐的操作 - 安装nvidia-persistenced
$ /usr/bin/nvidia-persistenced --verbose
nvidia=persistenced failed to start.
Syslog 报告:
Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist
其他测试:
$ ls /dev/nvidia*
ls: cannot access '/dev/nvidia*': No such file or directory
$ cat /proc/driver/nvidia/version
cat: /proc/driver/nvidia/version: No such file or directory
$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
$ prime-select query
intel
$ lshw -c video
*-display UNCLAIMED
description: VGA compatible controller
product: NVIDIA Corporation
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller cap_list
configuration: latency=0
resources: memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:df000000-df07ffff
*-display UNCLAIMED
description: VGA compatible controller
product: NVIDIA Corporation
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:02:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller cap_list
configuration: latency=0
resources: memory:dc000000-dcffffff memory:a0000000-afffffff memory:b0000000-b1ffffff ioport:d000(size=128) memory:dd000000-dd07ffff
*-display
description: VGA compatible controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:167 memory:db000000-dbffffff memory:90000000-9fffffff ioport:f000(size=64) memory:c0000-dffff
**在我看来,和/dev/nvidia*
缺失/proc/driver/nvidia*
是我问题的根本原因,但我不知道我做错了什么,也不知道如何解决。
欢迎提出任何建议/意见!