我已经使用 GUI 安装了 NVIDIA 驱动程序版本 435:
我现在看到一个包裹列表:
hekto@lynx:~$ dpkg -l|grep nvidia
ii libnvidia-cfg1-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-435 435.21-0ubuntu0.18.04.2 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA libcompute package
ii libnvidia-decode-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVENC Video Encoding runtime library
ii libnvidia-fbc1-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-435:amd64 435.21-0ubuntu0.18.04.2 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA compute utilities
ii nvidia-dkms-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA DKMS package
ii nvidia-driver-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-435 435.21-0ubuntu0.18.04.2 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.8.2 all Tools to enable NVIDIA's Prime
ii nvidia-settings 390.77-0ubuntu0.18.04.1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA driver support binaries
ii xserver-xorg-video-nvidia-435 435.21-0ubuntu0.18.04.2 amd64 NVIDIA binary Xorg driver
我对 OpenCL 很感兴趣,所以我找到了 NVIDIA 软件包,它提供了与 OpenCL 相关的文件 - 就是这个libnvidia-compute-435
软件包。它包含以下文件:
hekto@lynx:~$ dpkg -L libnvidia-compute-435
/.
/etc
/etc/OpenCL
/etc/OpenCL/vendors
/etc/OpenCL/vendors/nvidia.icd
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libcuda.so.435.21
/usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.435.21
/usr/lib/x86_64-linux-gnu/libnvidia-fatbinaryloader.so.435.21
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.435.21
/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.435.21
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.435.21
/usr/share
/usr/share/doc
/usr/share/doc/libnvidia-compute-435
/usr/share/doc/libnvidia-compute-435/changelog.Debian.gz
/usr/share/doc/libnvidia-compute-435/copyright
/usr/lib/x86_64-linux-gnu/libcuda.so
/usr/lib/x86_64-linux-gnu/libcuda.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so
/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so
/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.1
文件/etc/OpenCL/vendors/nvidia.icd
是在这个列表中,但是它不存在在我的系统上。所有 OpenCL 程序都需要 ICD 文件,没有这些文件,它们就无法找到特定于供应商的库。
那么,为什么这个文件不存在?为什么apt
没有安装所有需要的文件?
(我使用的是 Xubuntu 18.04.3)
答案1
尝试删除所有 nvidia 包(这也会删除 /etc 目录中的文件):
sudo apt-get --purge remove '*nvidia*'
然后照常重新安装驱动程序:
sudo apt install nvidia-driver-435
看看该文件是否在那里。
答案2
我遇到了同样的问题。当我输入以下命令时,它会告诉我建议安装的驱动程序版本是什么:
mona@goku:~$ sudo ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001F95sv000017AAsd000022C0bc03sc00i00
vendor : NVIDIA Corporation
driver : nvidia-driver-450-server - distro non-free
driver : nvidia-driver-460 - distro non-free recommended
driver : nvidia-driver-460-server - distro non-free
driver : nvidia-driver-450 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
== /sys/devices/virtual/dmi/id ==
modalias : dmi:bvnLENOVO:bvrN2VET26W(1.11):bd11/16/2020:br1.11:efr1.6:svnLENOVO:pn20TKCTO1WW:pvrThinkPadX1ExtremeGen3:rvnLENOVO:rn20TKCTO1WW:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrNone:
driver : oem-sutton.simon-adken-meta - third-party free
然后:
sudo apt-get --purge remove '*nvidia*'
和
sudo apt install nvidia-driver-460