Ubuntu 20.04 和 21.10 上的专有 NVIDIA 驱动程序不起作用

Ubuntu 20.04 和 21.10 上的专有 NVIDIA 驱动程序不起作用

我有一张 GeForce RTX 3060 Ti 显卡,并全新安装了 Ubuntu 20.04 LTS。我的主板来自 MSI:PRO Z690-A DDR4(MS-7D25)。我已经从可启动的 USB 驱动器安装了操作系统,并选择了选项Download updates while installing UbuntuInstall third-party software for graphics and Wi-Fi hardware and additional media formats。安装后,我启动了操作系统。

现在我仍然想要 NVIDIA 驱动程序,所以我遵循教程。

我已经使用 GUI 软件更新程序更新了软件。我查看了“软件和更新”中的“附加驱动程序”部分,并选择了 Nouveau 驱动程序。我单击了Using NVIDIA driver metapackage from nvidia-driver-470 (proprietary, tested)选项,应用了更改并重新启动。现在我的 PC 无法通过 MSI 启动徽标。我可以使用 Ctrl+Alt+F3 获得 tty。从那里我执行了以下命令:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002489sv000010DEsd0000153Cbc03sc00i00
vendor   : NVIDIA Corporation
driver   : nvidia-driver-470 - distro non-free recommended
driver   : nvidia-driver-495 - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

请注意,我没有得到字段model!我不知道为什么……

$ nvidia-settings -q all
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.
$ nvidia-smi
Wed Dec 22 11:47:05 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.86       Driver Version: 470.86       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   33C    P8     6W / 200W |     14MiB /  7982MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1017      G   /usr/lib/xorg/Xorg                  8MiB |
|    0   N/A  N/A      1310      G   /usr/bin/gnome-shell                3MiB |
+-----------------------------------------------------------------------------+
$ nvidia-smi --query-gpu=name --format=csv,noheader
NVIDIA GeForce RTX 3060 Ti
$ sudo lshw -c video
  *-display
       description: VGA compatible controller
       product: GA104 [GeForce RTX 3060 Ti Lite Hash Rate]
       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 bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:160 memory:42000000-42ffffff memory:60000000-6fffffff memory:70000000-71ffffff ioport:5000(size=128) memory:43000000-4307ffff
  *-display UNCLAIMED
       description: VGA compatible controller
       product: AlderLake-S GT1
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 0c
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:41000000-41ffffff memory:50000000-5fffffff ioport:6000(size=64) memory:c0000-dffff memory:45000000-4bffffff
$ systemctl status gdm
● gdm.service - GNOME Display Manager
     Loaded: loaded (/lib/systemd/system/gdm.service; static; vendor preset: enabled)
     Active: active (running) since Wed 2021-12-22 11:17:05 CET; 31min ago
    Process: 892 ExecStartPre=/usr/share/gdm/generate-config (code=exited, status=0/SUCCESS)
    Process: 913 ExecStartPre=/usr/lib/gdm3/gdm-wait-for-drm (code=exited, status=0/SUCCESS)
   Main PID: 916 (gdm3)
      Tasks: 3 (limit: 76852)
     Memory: 5.6M
     CGroup: /system.slice/gdm.service
             └─916 /usr/sbin/gdm3

dec 22 11:17:05 spectroag systemd[1]: Starting GNOME Display Manager...
dec 22 11:17:05 spectroag systemd[1]: Started GNOME Display Manager.
dec 22 11:17:07 spectroag gdm-autologin][961]: gkr-pam: no password is available for user
dec 22 11:17:07 spectroag gdm-autologin][961]: pam_unix(gdm-autologin:session): session opened for user developer by (uid=0)
dec 22 11:17:07 spectroag gdm-autologin][961]: gkr-pam: gnome-keyring-daemon started properly

(我安装了具有自动登录功能的 Ubuntu)

$ sudo lspci -vnn | grep -i VGA -A 25
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:4680] (rev 0c) (prog-if 00 [VGA controller])
    DeviceName: Onboard - Video
    Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:7d25]
    Flags: bus master, fast devsel, latency 0, IRQ 255
    Memory at 41000000 (64-bit, non-prefetchable) [size=16M]
    Memory at 50000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 6000 [size=64]
    Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
    Capabilities: [40] Vendor Specific Information: Len=0c <?>
    Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
    Capabilities: [ac] MSI: Enable- Count=1/1 Maskable+ 64bit-
    Capabilities: [d0] Power Management version 2
    Capabilities: [100] Process Address Space ID (PASID)
    Capabilities: [200] Address Translation Service (ATS)
    Capabilities: [300] Page Request Interface (PRI)
    Capabilities: [320] Single Root I/O Virtualization (SR-IOV)

00:06.0 PCI bridge [0604]: Intel Corporation Device [8086:464d] (rev 02) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 123
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    I/O behind bridge: [disabled]
    Memory behind bridge: 44800000-448fffff [size=1M]
    Prefetchable memory behind bridge: [disabled]
    Capabilities: [40] Express Root Port (Slot+), MSI 00
    Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
    Capabilities: [90] Subsystem: Device [0000:0000]
--
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2489] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: NVIDIA Corporation Device [10de:153c]
    Flags: bus master, fast devsel, latency 0, IRQ 160
    Memory at 42000000 (32-bit, non-prefetchable) [size=16M]
    Memory at 60000000 (64-bit, prefetchable) [size=256M]
    Memory at 70000000 (64-bit, prefetchable) [size=32M]
    I/O ports at 5000 [size=128]
    Expansion ROM at 43000000 [virtual] [disabled] [size=512K]
    Capabilities: [60] Power Management version 3
    Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [78] Express Legacy Endpoint, MSI 00
    Capabilities: [b4] Vendor Specific Information: Len=14 <?>
    Capabilities: [100] Virtual Channel
    Capabilities: [250] Latency Tolerance Reporting
    Capabilities: [258] L1 PM Substates
    Capabilities: [128] Power Budgeting <?>
    Capabilities: [420] Advanced Error Reporting
    Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
    Capabilities: [900] Secondary PCI Express
    Capabilities: [bb0] Resizable BAR <?>
    Capabilities: [c1c] Physical Layer 16.0 GT/s <?>
    Capabilities: [d00] Lane Margining at the Receiver <?>
    Capabilities: [e00] Data Link Feature <?>
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
$ prime-select query
nvidia
$ ps aux | grep X
root        1017  0.0  0.0 25358216 56396 tty2   Sl+  11:17   0:01 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
root        2905  0.0  0.0 25346156 51956 tty1   Sl+  11:50   0:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/125/gdm/Xauthority -background none -noreset -keeptty -verbose 3
develop+    3488  0.0  0.0  17676   664 tty3     R+   12:12   0:00 grep --color=auto X

(我在 tty3 中执行此操作)

$ cat /etc/default/grub | grep CMDLINE
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

知道会发生什么吗?它看起来很像应该可以工作,但我看不到任何视觉效果。

在我的 BIOS 中,我可以看到安全启动已被禁用,如果重要的话,我也会使用 UEFI。

如果我需要提供更多信息,请告诉我!

编辑:我让屏幕在启动时显示日志,这样我就可以看到它在卡住之前在做什么。这是屏幕上显示的最后一部分:

[  OK  ] Started Session 1 of user developer.
         Starting RealtimeKit Scheduling Policy Service...
         Starting NVIDIA Persistence Daemon...
[  OK  ] Started NVIDIA Persistence Daemon.
[  OK  ] Started Snap Daemon.
         Starting Wait until snapd is fully seeded...
[  OK  ] Finished Wait until snapd is fully seeded.
[  OK  ] Started RealtimeKit Scheduling Policy Service.
         Starting Daemon for power management...
[  OK  ] Started Daemon for power management.

我期望的大多数流程也都在那里,但我无法为您复制所有内容。看起来它在完成后仍然有效,但我不知道为什么仍然...

更新 :我已经安装了 Ubuntu 21.10,并使用 sudo apt install nvidia-driver-470 下载了驱动程序。重新启动时,我遇到了与帖子中描述相同的情况。这次,我也无法通过按 ctrl alt f3 进入 VT3,因为它一直回到我认为是 VT1(登录屏幕)的位置,显示带有光标的黑屏(再次像帖子中那样)。

更新:我尝试更新我的BIOS 版本,但 v11 版本使我的整个系统崩溃,我不得不手动将 BIOS 降级回 v10。我尝试使用 495.44 驱动程序,也尝试使用不在标准存储库中的 470.94 驱动程序。我尝试使用内核 5.15。不幸的是,什么都没起作用。使用内核 5.15 和驱动程序 495.44 时,最新的启动日志是“正在启动显示 Plymouth 启动屏幕...”,我没有看到任何日志表明它已完成。

更新:以下是更多信息:/var/log/boot.log,在我看来这很正常。/var/lib/gdm3/.local/share/xorg/Xorg.0.log,它显示了一个有趣的错误。对于这两个日志,我在全新安装时使用的是内核 5.13.0-22-generic 和 NVIDIA 驱动程序 470.86。

答案1

我让它工作了!我很愚蠢,这么晚才这样做,但我的显示器连接到主板的 HDMI 端口,而不是 GPU。只需将电缆移到 GPU 端口即可解决问题,因为驱动程序工作正常……我希望没有其他人遇到这种情况!

相关内容