[ubuntu 22.04 Geforce 4060Ti]NVIDIA-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。请确保最新的 NVIDIA 驱动程序

[ubuntu 22.04 Geforce 4060Ti]NVIDIA-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。请确保最新的 NVIDIA 驱动程序

我在这里询问有关在 Ubuntu22.04 系统 ( uname -rgeives 6.5.0-28-generic,并且在同一桌面上我安装了 Windows 10) 上安装 NVIDIA Geforce 4060ti (ID:2803,驱动程序版本:535) 的 NVIDIA 驱动程序的一些问题,为此我在终端中使用以下命令:

# shut down the secure boot in Bios

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

sudo apt-get remove --purge '^libnvidia-.*'

sudo apt-get remove --purge '^cuda-.*'

按照建议,而推荐的命令

sudo apt-get install linux-headers-6.5.0-28-generic 

失败:

Package linux-headers-6.5.0-28-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-6.5.0-28-generic' has no installation candidate

然后我安装:

sudo apt install nvidia-driver-535

然后重新启动才发现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.

为了调试,我尝试了:dpkg -l | grep -i nvidia,结果给了我:

ii  libnvidia-cfg1-535:amd64                      535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-535                          535.171.04-0ubuntu0.20.04.1                    all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-535:amd64                   535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA libcompute package
ii  libnvidia-compute-535:i386                    535.171.04-0ubuntu0.20.04.1                    i386         NVIDIA libcompute package
ii  libnvidia-decode-535:amd64                    535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-535:amd64                    535.171.04-0ubuntu0.20.04.1                    amd64        NVENC Video Encoding runtime library
ii  libnvidia-extra-535:amd64                     535.171.04-0ubuntu0.20.04.1                    amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-535:amd64                      535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-535:amd64                        535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  nvidia-compute-utils-535                      535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA compute utilities
ii  nvidia-dkms-535                               535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA DKMS package
ii  nvidia-driver-535                             535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA driver metapackage
ii  nvidia-firmware-535-535.171.04                535.171.04-0ubuntu0.20.04.1                    amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-535                      535.171.04-0ubuntu0.20.04.1                    amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-535                      535.171.04-0ubuntu0.20.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
ii  nvidia-utils-535                              535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                       0.18.2                                         all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-535                 535.171.04-0ubuntu0.20.04.1                    amd64        NVIDIA binary Xorg driver

请注意,虽然我的系统是ubuntu22.04,但这些版本基本上是基于ubuntu20.04

我相信这可能是主要问题,但我不知道如何解决它:(

我尝试了一下inxi -Fxxxrz,它给了我:

System:
  Kernel: 6.5.0-28-generic x86_64 bits: 64 compiler: N/A Desktop: GNOME 42.9
    tk: GTK 3.24.33 wm: gnome-shell dm: GDM3 42.0
    Distro: Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Machine:
  Type: Desktop System: HP product: Victus by HP 15L Gaming Desktop TG02-2xxx
    v: N/A serial: <superuser required> Chassis: type: 3
    serial: <superuser required>
  Mobo: HP model: 8B3B v: A (SMVB) serial: <superuser required> UEFI: AMI
    v: F.21 date: 10/24/2023
CPU:
  Info: 10-core (6-mt/4-st) model: Intel Core i5-14400F bits: 64
    type: MST AMCP smt: enabled arch: N/A rev: 2 cache: L1: 864 KiB L2: 9.5 MiB
    L3: 20 MiB
  Speed (MHz): avg: 886 high: 1160 min/max: 800/4700:3500 cores: 1: 1038
    2: 1113 3: 800 4: 911 5: 800 6: 800 7: 1156 8: 1160 9: 796 10: 800 11: 800
    12: 800 13: 817 14: 800 15: 800 16: 800 bogomips: 79872
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA vendor: Hewlett-Packard driver: N/A pcie: speed: 16 GT/s
    lanes: 8 bus-ID: 01:00.0 chip-ID: 10de:2803 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.4 compositor: gnome-shell driver: X:
    loaded: nouveau,vesa unloaded: fbdev,modesetting gpu: N/A display-ID: :1
    screens: 1
  Screen-1: 0 s-res: 3840x2160 s-dpi: 96 s-size: 1016x572mm (40.0x22.5")
    s-diag: 1166mm (45.9")
  Monitor-1: default res: 3840x2160 hz: 88 size: N/A
  OpenGL: renderer: llvmpipe (LLVM 15.0.7 256 bits)
    v: 4.5 Mesa 23.2.1-1ubuntu3.1~22.04.2 direct render: Yes
Audio:
  Device-1: Intel vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:7ad0 class-ID: 0403
  Device-2: NVIDIA vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    pcie: speed: 16 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:22bd
    class-ID: 0403
  Sound Server-1: ALSA v: k6.5.0-28-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: speed: 2.5 GT/s
    lanes: 1 port: 4000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: Realtek vendor: Hewlett-Packard driver: rtw89_8852be v: kernel
    pcie: speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 03:00.0
    chip-ID: 10ec:b852 class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8
    bus-ID: 1-14:4 chip-ID: 0bda:b85c class-ID: e001 serial: <filter>
  Report: hciconfig ID: hci0 rfk-id: 0 state: up address: <filter>
    bt-v: 3.0 lmp-v: 5.2 sub-v: 91cb hci-v: 5.2 rev: dfb7
Drives:
  Local Storage: total: 953.87 GiB used: 28.09 GiB (2.9%)
  ID-1: /dev/nvme0n1 vendor: Western Digital
    model: WD PC SN560 SDDPNQE-1T00-2006 size: 953.87 GiB speed: 63.2 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: HPS1 temp: 36.9 C scheme: GPT
Partition:
  ID-1: / size: 27.99 GiB used: 21.65 GiB (77.3%) fs: ext4
    dev: /dev/nvme0n1p7
  ID-2: /boot size: 1.84 GiB used: 179.2 MiB (9.5%) fs: ext4
    dev: /dev/nvme0n1p5
  ID-3: /boot/efi size: 256 MiB used: 64.4 MiB (25.2%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 57.23 GiB used: 6.2 GiB (10.8%) fs: ext4
    dev: /dev/nvme0n1p8
Swap:
  ID-1: swap-1 type: partition size: 61.04 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p6
Sensors:
  System Temperatures: cpu: 46.0 C mobo: 27.8 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: apt: 2004
  Active apt repos in: /etc/apt/sources.list
    1: deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
    2: deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    3: deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    4: deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    5: deb http://cn.archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
    6: deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/vscode.list
    1: deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/code stable main
  Active apt repos in: /etc/apt/sources.list.d/zotero.list
    1: deb [signed-by=/usr/share/keyrings/zotero-archive-keyring.gpg by-hash=force] https://zotero.retorque.re/file/apt-package-archive ./
Info:
  Processes: 355 Uptime: 11m wakeups: 309 Memory: 15.37 GiB
  used: 3.62 GiB (23.6%) Init: systemd v: 249 runlevel: 5 Compilers:
  gcc: 12.0.1 alt: 11/12 Shell: Bash v: 5.1.16 running-in: gnome-terminal
  inxi: 3.3.13

我的gcc版本是12.0.1,除此之外,12.3.0驱动程序也是从中编译出来的。

有人能帮我吗?如果需要任何额外信息,我会尽快回复。

我确实花了一整天的时间来安装它。提前谢谢大家,并且对我的业余问题和糟糕的英语表示抱歉。

编辑 1:感谢@mikewhatever 的解决方案,dpkg -l | grep -i nvidia的回复现在具有正确的ubuntu0.22.04.1后缀,如下所示:

ii  libnvidia-cfg1-535:amd64                      535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-535                          535.171.04-0ubuntu0.22.04.1                    all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-535:amd64                   535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA libcompute package
ii  libnvidia-compute-535:i386                    535.171.04-0ubuntu0.22.04.1                    i386         NVIDIA libcompute package
ii  libnvidia-decode-535:amd64                    535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-535:i386                     535.171.04-0ubuntu0.22.04.1                    i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-535:amd64                    535.171.04-0ubuntu0.22.04.1                    amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-535:i386                     535.171.04-0ubuntu0.22.04.1                    i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-535:amd64                     535.171.04-0ubuntu0.22.04.1                    amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-535:amd64                      535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-535:i386                       535.171.04-0ubuntu0.22.04.1                    i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-535:amd64                        535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-535:i386                         535.171.04-0ubuntu0.22.04.1                    i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  nvidia-compute-utils-535                      535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA compute utilities
ii  nvidia-dkms-535                               535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA DKMS package
ii  nvidia-driver-535                             535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA driver metapackage
ii  nvidia-firmware-535-535.171.04                535.171.04-0ubuntu0.22.04.1                    amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-535                      535.171.04-0ubuntu0.22.04.1                    amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-535                      535.171.04-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
ii  nvidia-utils-535                              535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                       0.18.2                                         all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-535                 535.171.04-0ubuntu0.22.04.1                    amd64        NVIDIA binary Xorg driver

然后重启后sudo apt-get install linux-headers-6.5.0-28-generic,我的问题就解决了!非常感谢@mikewhatever!

相关内容