hei*_*eik 6 nvidia xorg kernel graphics drivers
我运行 Ubuntu 20.04,在上次重新启动后,我的图形驱动程序出现了问题 - 系统分辨率较低,只有一台显示器在工作。
$ sudo lshw -C display
*-display UNCLAIMED
description: VGA compatible controller
product: TU104 [GeForce RTX 2070 SUPER]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:31:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller cap_list
configuration: latency=0
resources: memory:f5000000-f5ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:f000(size=128) memory:f6000000-f607ffff
Run Code Online (Sandbox Code Playgroud)
$ sudo dkms status
nvidia, 510.47.03: added
Run Code Online (Sandbox Code Playgroud)
这种状态似乎有点奇怪,至少我在谷歌搜索时没有发现很多类似的案例。
$ 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.
Run Code Online (Sandbox Code Playgroud)
$ modinfo nvidia
modinfo: ERROR: Module nvidia not found.
Run Code Online (Sandbox Code Playgroud)
在系统信息中,我看到“llvmpipe(LLVM 12.0.0,256 位)”作为我的图形。
我尝试了多种安装 Nvidia 驱动程序的方法,我使用 apt sudo apt autoremove --purge nvidia* && sudo apt install nvidia-driver-510、“附加驱动程序”UI 和ubuntu-drivers,我尝试了当前最新版本 510 和之前工作的旧版本 - 470。我还尝试选择 nvidiasudo prime-select nvidia以及选择 intel 和 swithcing回到 nvidia - 同样的结果。
我使用 Nvidia 驱动程序 470 和内核 5.13.0.26,然后重新启动后,我得到了内核 .27,但没有 wifi,最近由于 Nvidia 驱动程序而遇到了这个问题(需要为新内核安装 linux-modules-extra),所以我决定升级驱动希望一切都能解决。这导致了目前的情况:安装linux-modules-extra-5.13.0-27-generic后切换到 510 - 与 0.28 修复的 wifi 问题相同,但视频驱动程序已损坏。在使用 5.13.0.27 时,我能够启动 5.13.0.26,并且在那里我有工作视频,但现在情况并非如此,因为 .27 是 Grub 菜单中最旧的最新内核。
我觉得我错过了一些可以解决这个问题的步骤,希望得到任何帮助。
sudo dkms install -m nvidia -v 510.47.03 -k 5.13.0-28-generic --force
Error! Your kernel headers for kernel 5.13.0-28-generic cannot be found.
Please install the linux-headers-5.13.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Run Code Online (Sandbox Code Playgroud)
$ sudo dkms build -m nvidia -v 510.47.03
Error! Your kernel headers for kernel 5.13.0-28-generic cannot be found.
Please install the linux-headers-5.13.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Run Code Online (Sandbox Code Playgroud)
所以看来 dkms 在某种程度上不知道我的内核。我使用了上面错误消息的建议并安装了 headers sudo apt install linux-headers-5.13.0-28-generic,之后输出看起来更好:
sudo dkms build -m nvidia -v 510.47.03
Module nvidia/510.47.03 already built for kernel 5.13.0-28-generic/4
Run Code Online (Sandbox Code Playgroud)
sudo dkms status
nvidia, 510.47.03, 5.13.0-28-generic, x86_64: installed
Run Code Online (Sandbox Code Playgroud)
我现在将尝试重新启动,然后按照评论中的建议安装驱动程序。
就是这样,现在一切似乎都正常了。无需对驱动程序执行任何操作,问题似乎在于缺少标头。
假设您已安装所有先决条件 ( sudo apt install linux-headers-generic),您可以按照以下步骤解决该问题:
(可选)启动到root shell以安全地运行命令。
删除dkmsNVIDIA 驱动程序文件:
sudo rm -r /var/lib/dkms/nvidia
Run Code Online (Sandbox Code Playgroud)
清除 NVIDIA 驱动程序:
sudo dpkg -P --force-all $(dpkg -l | grep "nvidia-" | grep -v lib | awk '{print $2}')
Run Code Online (Sandbox Code Playgroud)
重新安装 NVIDIA 驱动程序:
sudo ubuntu-drivers autoinstall
Run Code Online (Sandbox Code Playgroud)
重启!
现在,您的 NVIDIA 驱动程序应该可以正常工作了!
| 归档时间: |
|
| 查看次数: |
14818 次 |
| 最近记录: |