已安装 nvidia 驱动程序,但更新后无法运行

已安装 nvidia 驱动程序,但更新后无法运行

我看到了关于更新后 nvidia 驱动程序的其他一些答案(sudo apt updatesudo apt upgrade)。但我的 nvidia 安装不再起作用

例如:

  • 我的第二台显示器通过 USB-C 适配器连接,无法再工作
  • 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.
  • 我不能再使用 CUDA
>>> import torch
>>> torch.cuda.is_available()
False

我尝试了一些答案,所以我prime-select query这样做了prime-select on-demand,因为按需是我唯一的选择。

但是我的驱动程序已安装:

dpkg -l | grep "nvidia-"
ii  libnvidia-cfg1-530:amd64                   535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-cfg1-535
ii  libnvidia-cfg1-535:amd64                   535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-530                       535.54.03-0ubuntu0.22.04.1              all          Transitional package for libnvidia-common-535
ii  libnvidia-common-535                       535.54.03-0ubuntu0.22.04.1              all          Shared files used by the NVIDIA libraries
iU  libnvidia-compute-530:amd64                535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-compute-535
iU  libnvidia-compute-530:i386                 535.54.03-0ubuntu0.22.04.1              i386         Transitional package for libnvidia-compute-535
ii  libnvidia-compute-535:amd64                535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA libcompute package
ii  libnvidia-compute-535:i386                 535.54.03-0ubuntu0.22.04.1              i386         NVIDIA libcompute package
iU  libnvidia-decode-530:amd64                 535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-decode-535
iU  libnvidia-decode-530:i386                  535.54.03-0ubuntu0.22.04.1              i386         Transitional package for libnvidia-decode-535
iU  libnvidia-decode-535:amd64                 535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA Video Decoding runtime libraries
iU  libnvidia-decode-535:i386                  535.54.03-0ubuntu0.22.04.1              i386         NVIDIA Video Decoding runtime libraries
iU  libnvidia-encode-530:amd64                 535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-encode-535
iU  libnvidia-encode-530:i386                  535.54.03-0ubuntu0.22.04.1              i386         Transitional package for libnvidia-encode-535
iU  libnvidia-encode-535:amd64                 535.54.03-0ubuntu0.22.04.1              amd64        NVENC Video Encoding runtime library
iU  libnvidia-encode-535:i386                  535.54.03-0ubuntu0.22.04.1              i386         NVENC Video Encoding runtime library
iU  libnvidia-extra-530:amd64                  535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-extra-535
ii  libnvidia-extra-535:amd64                  535.54.03-0ubuntu0.22.04.1              amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-530:amd64                   535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-fbc1-535
ii  libnvidia-fbc1-530:i386                    535.54.03-0ubuntu0.22.04.1              i386         Transitional package for libnvidia-fbc1-535
ii  libnvidia-fbc1-535:amd64                   535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-535:i386                    535.54.03-0ubuntu0.22.04.1              i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-530:amd64                     535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for libnvidia-gl-535
ii  libnvidia-gl-530:i386                      535.54.03-0ubuntu0.22.04.1              i386         Transitional package for libnvidia-gl-535
ii  libnvidia-gl-535:amd64                     535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-535:i386                      535.54.03-0ubuntu0.22.04.1              i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
iU  nvidia-compute-utils-530:amd64             535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-compute-utils-535
ii  nvidia-compute-utils-535                   535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA compute utilities
iU  nvidia-dkms-530                            535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-dkms-535
iF  nvidia-dkms-535                            535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA DKMS package
iU  nvidia-driver-530                          535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-driver-535
iU  nvidia-driver-535                          535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA driver metapackage
ii  nvidia-firmware-535-535.54.03              535.54.03-0ubuntu0.22.04.1              amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-530:amd64             535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-kernel-common-535
ii  nvidia-kernel-common-535                   535.54.03-0ubuntu0.22.04.1              amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-530                   535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-kernel-source-535
ii  nvidia-kernel-source-535                   535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA kernel source package
ii  nvidia-prime                               0.8.17.1                                all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            510.47.03-0ubuntu1                      amd64        Tool for configuring the NVIDIA graphics driver
iU  nvidia-utils-530:amd64                     535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for nvidia-utils-535
ii  nvidia-utils-535                           535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                    0.18.2                                  all          Extension for the nvidia-settings control panel
iU  xserver-xorg-video-nvidia-530:amd64        535.54.03-0ubuntu0.22.04.1              amd64        Transitional package for xserver-xorg-video-nvidia-535
iU  xserver-xorg-video-nvidia-535              535.54.03-0ubuntu0.22.04.1              amd64        NVIDIA binary Xorg driver

所以我有正确的驱动程序(?)nvidia-driver-535因为 ubuntu 说这是我的 GPU 运行的驱动程序ubuntu-drivers devices

另外,我的外接显示器也出现了问题,我必须将 ubuntu 配置为使用集成 gpu (amd) 来运行桌面应用程序,并将我的 nvidia GPU 仅用于 CUDA

如何解决我的实际问题以恢复此行为?

答案1

我刚刚找到了答案:

sudo dkms autoinstall

就我而言,它有效

相关内容