Lubuntu 20.04,安装了 Nvidia 驱动程序,但 NVIDIA-SMI 指出无法连接到驱动程序

Lubuntu 20.04,安装了 Nvidia 驱动程序,但 NVIDIA-SMI 指出无法连接到驱动程序

我按照附加驱动程序提示安装了 nvidia 440 驱动程序,它们确实显示为已安装。但是 SMI 输出显示它无法连接,并且表现得好像它未安装或未运行。prime-select 查询显示它设置为 nvidia,我尝试将 prime select 交换为 intel,然后切换回 nvidia,并进行了完全重启,但问题并未得到任何修复。

nvidia 的 dpkg 输出显示我拥有一切。

ii  libnvidia-cfg1-440:amd64                                    440.100-0ubuntu0.20.04.1              amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-440                                        440.100-0ubuntu0.20.04.1              all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-440:amd64                                 440.100-0ubuntu0.20.04.1              amd64        NVIDIA libcompute package
ii  libnvidia-compute-440:i386                                  440.100-0ubuntu0.20.04.1              i386         NVIDIA libcompute package
ii  libnvidia-decode-440:amd64                                  440.100-0ubuntu0.20.04.1              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-440:i386                                   440.100-0ubuntu0.20.04.1              i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-440:amd64                                  440.100-0ubuntu0.20.04.1              amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-440:i386                                   440.100-0ubuntu0.20.04.1              i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-440:amd64                                   440.100-0ubuntu0.20.04.1              amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-440:amd64                                    440.100-0ubuntu0.20.04.1              amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-440:i386                                     440.100-0ubuntu0.20.04.1              i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-440:amd64                                      440.100-0ubuntu0.20.04.1              amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-440:i386                                       440.100-0ubuntu0.20.04.1              i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-440:amd64                                    440.100-0ubuntu0.20.04.1              amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ifr1-440:i386                                     440.100-0ubuntu0.20.04.1              i386         NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  nvidia-compute-utils-440                                    440.100-0ubuntu0.20.04.1              amd64        NVIDIA compute utilities
ii  nvidia-dkms-440                                             440.100-0ubuntu0.20.04.1              amd64        NVIDIA DKMS package
ii  nvidia-driver-440                                           440.100-0ubuntu0.20.04.1              amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-440                                    440.100-0ubuntu0.20.04.1              amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-440                                    440.100-0ubuntu0.20.04.1              amd64        NVIDIA kernel source package
ii  nvidia-prime                                                0.8.14                                all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                                             440.64-0ubuntu1                       amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-440                                            440.100-0ubuntu0.20.04.1              amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                                     0.18build1                            all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-440                               440.100-0ubuntu0.20.04.1              amd64        NVIDIA binary Xorg driver

在尝试运行 nvidia-settings 时我得到了

ERROR: NVIDIA driver is not loaded

ERROR: Unable to load info from any available system

(nvidia-settings:1791): GLib-GObject-CRITICAL **: 01:18:05.602: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

答案1

在提问之前我花了一段时间研究这个问题,但我认为最好的方法可能是通过以下方式清除所有 nvidia 驱动程序文件

sudo apt remove --purge '^nvidia-.*'

然后按照 CLI 安装

sudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-440

完成后我nvidia-settings再次运行并真正得到了所需的输出,而不是一堆指出无法找到驱动程序的错误。

+-----------------------------------------------------------------------------+                                                                                                              
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2060    Off  | 00000000:01:00.0  On |                  N/A |
| N/A   51C    P5    14W /  N/A |    467MiB /  5934MiB |     23%      Default |
+-------------------------------+----------------------+----------------------+

相关内容