Nvidia 驱动程序在更新后重置,现在显示器为“未知”并卡在 640x480

Nvidia 驱动程序在更新后重置,现在显示器为“未知”并卡在 640x480

我对我的系统(Ubuntu 20.04)进行了软件更新,运行后失败了,现在我的系统只能在 VGA 上看到我的显示器(我还有一个 HDMI 显示器作为主显示器)并在“未知显示器”上读出它,唯一的分辨率选项是 640X480。

运行 Xrandr 可以

xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 640 x 480, maximum 640 x 480
default connected primary 640x480+0+0 0mm x 0mm
   640x480       73.00* 

并尝试这里的方法对于不发送 EDID 的显示器,如何使用 Nvidia 驱动程序设置正确的显示器分辨率?什么都没改变。当我尝试运行时,sudo ubuntu-drivers autoinstall 我得到了以下结果

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-modules-nvidia-460-generic-hwe-20.04-edge : Depends: nvidia-kernel-common-460 (<= 460.32.03-1) but it is not going to be installed
                                                   Depends: nvidia-kernel-common-460 (>= 460.32.03) but it is not going to be installed
 nvidia-driver-460 : Depends: nvidia-kernel-common-460 (<= 460.32.03-1) but it is not going to be installed
                     Depends: nvidia-kernel-common-460 (>= 460.32.03) but it is not going to be installed
                     Depends: nvidia-kernel-source-460 (= 460.32.03-0ubuntu0.20.04.1) but it is not going to be installed
                     Depends: libnvidia-extra-460 (= 460.32.03-0ubuntu0.20.04.1) but it is not going to be installed
                     Depends: libnvidia-encode-460 (= 460.32.03-0ubuntu0.20.04.1) but it is not going to be installed
                     Recommends: libnvidia-decode-460:i386 (= 460.32.03-0ubuntu0.20.04.1)
                     Recommends: libnvidia-encode-460:i386 (= 460.32.03-0ubuntu0.20.04.1)
                     Recommends: libnvidia-ifr1-460:i386 (= 460.32.03-0ubuntu0.20.04.1)
                     Recommends: libnvidia-fbc1-460:i386 (= 460.32.03-0ubuntu0.20.04.1)
                     Recommends: libnvidia-gl-460:i386 (= 460.32.03-0ubuntu0.20.04.1)
E: Unable to correct problems, you have held broken packages.

当我第一次尝试运行自动安装时,它被阻止,因为即使在更新后重新启动,dpkg 仍在被 apt 使用。

以下是输出ubuntu-drivers devices

== /sys/devices/pci0000:00/0000:00:07.0/0000:05:00.0 ==
modalias : pci:v000010DEd00001244sv0000196Esd0000089Cbc03sc00i00
vendor   : NVIDIA Corporation
model    : GF116 [GeForce GTX 550 Ti]
driver   : nvidia-340 - distro non-free
driver   : nvidia-driver-440-server - distro non-free
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-450 - distro non-free
driver   : nvidia-driver-460 - distro non-free recommended
driver   : nvidia-driver-418-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

== /sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0 ==
modalias : pci:v000014E4d000043A0sv00001043sd000085DFbc02sc80i00
vendor   : Broadcom Inc. and subsidiaries
model    : BCM4360 802.11ac Wireless Network Adapter
driver   : bcmwl-kernel-source - distro non-free

更新/解决方案 所以我很确定我以前也遇到过类似的问题。原来答案是我必须卸载 Nvidia 驱动程序并使用 nouveau——问题是更新对 nvidia 驱动程序进行了更新,然后系统默认使用

答案1

我在这里找到了一个(对我来说)可行的解决方案:https://forums.linuxmint.com/viewtopic.php?f=59&t=339381&start=20

如果合并:

  • 在“附加驱动程序”中选择 Nouveau 驱动程序
  • 跑步sudo apt-get purge *nvidia*
  • 重启
  • 跑步sudo apt-get install nvidia-driver-460
  • 选择 Nvidia 460 驱动程序
  • 重启

可选(安装后nvidia-driver-460):

  • 跑步sudo apt install nvidia-kernel-source-460
  • 跑步sudo apt install xserver-xorg-video-nvidia-460
  • 跑步sudo apt install libnvidia-cfg1-460

14 分钟前它对我来说是有效的,一切正常:)

答案2

当我升级到 Ubuntu 20.04 时,我遇到了类似的问题。您需要安装正确的 nvidia 驱动程序。

如果您尚未安装 aptitude,可以使用“sudo apt install aptitude”进行安装。我的解决方案是使用命令“sudo aptitude install libgl1”。这是为了体面。然后它会为您提供一个解决方案供您接受。接受它并尝试使用“sudo apt install nvidia-driver-460”手动安装 nvidia 驱动程序。如果这不起作用,请再次运行“sudo aptitude install libgl1”,不要接受第一个解决方案并尝试第二个解决方案。重复此操作,直到找到一个可行的解决方案。我最终的方法是降级软件包然后安装。

您还可以尝试使用“sudo apt remove --purge '^nvidia-.*'”或“sudo nvidia-uninstall”完成 nvidia 驱动程序的卸载。然后尝试使用“sudo apt install ubuntu-desktop”或“sudo ubuntu-drivers-autoinstall”安装 ubuntu-desktop

答案3

只需使用 nouveau 驱动程序。解决方案是

sudo nvidia-uninstall 
reboot

感谢 Benhamin1029

答案4

我在 Ubuntu 20.04 上也遇到了类似的问题,为确保我们遇到相同的问题,请尝试以下命令:

nvidia-smi

如果您收到错误,那么我认为以下步骤将对您有所帮助(对我来说上述答案没有帮助):

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

 - sudo apt-get purge *nvidia*

现在你必须从这里下载 cuda: https://developer.nvidia.com/cuda-downloads 这应该类似于:

wget https://developer.download.nvidia.com/compute/cuda/11.2.1/local_installers/cuda_11.2.1_460.32.03_linux.run

下载完成后运行:

sudo sh cuda_11.2.1_460.32.03_linux.run

接受,下一步,下一步等等。如果出现错误,请尝试:

sudo apt-get install linux-headers-`uname -r`

然后再

sudo sh cuda_11.2.1_460.32.03_linux.run

安装成功后,重新启动计算机,一切都会正常。

相关内容