显卡驱动程序问题:无法登录

显卡驱动程序问题:无法登录

这是我的问题:Ubuntu 启动正常,但是当我进入登录屏幕并尝试登录时,屏幕变黑,几秒钟后我又回到了登录屏幕。

我认为问题出在显卡驱动程序上,因为在遇到问题之前我刚刚从备用驱动程序切换到专有驱动程序。(我使用了软件和更新应用程序来执行此操作。)

我有一台配备 i7 的华硕电脑,双启动,Windows 和 Ubuntu 18.04(Grub 启动正常)。我的显卡是 Nvidia Geforce 920M。

谢谢你!

附言:我是 Ubuntu 新手用户,如果我忘记了重要信息,请随时询问。

编辑:根据@JoshuaBesneatte 的回答,我做了以下事情:

  1. sudo apt-get purge nvidiareboot。我现在可以登录,但窗口现在“放大了”。(奇怪的是,我第一次执行第 1 步时没有出现“放大”问题)。

  2. 我添加了图形驱动程序存储库:sudo add-apt-repository ppa:graphics-drivers。稍后检查软件和更新(不确定更改是否来自此命令),我现在有 4 种可能性:3 个 Nvidia 驱动程序(390、400 和 415)和 Nouveau 显示驱动程序(我之前只有一种 Nvidia 可能性)。

  3. 我已更新 ( sudo apt update) :

    leo@leo:~$ sudo apt-get update
    [sudo] password for leo: 
    Hit:1 http://uk-mirrors.evowise.com/ubuntu bionic InRelease
    Hit:2 http://archive.canonical.com/ubuntu bionic InRelease                     
    Hit:3 http://uk-mirrors.evowise.com/ubuntu bionic-backports InRelease          
    Hit:4 http://uk-mirrors.evowise.com/ubuntu bionic-security InRelease           
    Hit:5 http://ppa.launchpad.net/bluetooth/bluez/ubuntu bionic InRelease       
    Hit:6 http://uk-mirrors.evowise.com/ubuntu bionic-updates InRelease
    Hit:7 http://ppa.launchpad.net/daniruiz/flat-remix/ubuntu bionic InRelease   
    Hit:8 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease  
    Hit:9 http://ppa.launchpad.net/linrunner/tlp/ubuntu bionic InRelease
    Hit:10 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu bionic InRelease
    Reading package lists... Done   
    
  4. 我尝试安装 Nvidia 驱动程序:

    • nvidia-current 没有工作(sudo apt install nvidia-current):

      leo@leo:~$ sudo apt install nvidia-current
      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      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:
      nvidia-current : Depends: nvidia-304 but it is not going to be installed
      E: Unable to correct problems, you have held broken packages.
      
    • 再次执行步骤 1 后,我尝试安装 390 ( sudo apt install nvidia-driver-390)。它似乎有效,并sudo nvidia-xconfig给出了以下结果:

      sudo nvidia-xconfig
      
      Using X configuration file: "/etc/X11/xorg.conf".
      Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
      New X configuration file written to '/etc/X11/xorg.conf'
      

    但是重新启动后,当我尝试登录时,我的计算机冻结了。当我尝试使用sudo apt install nvidia-driver-415和时,得到了相同的结果sudo ubuntu-drivers autoinstall

    • 当我尝试安装 nvidia 400(sudo apt install nvidia-driver-400)时,出现以下信息:

      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      E: Unable to locate package nvidia-driver-400
      

注意:奇怪的是,Firefox 不再起作用,但 Chrome 可以起作用。

解决方案:清除 Nvidia 后,只需删除 /etc/X11 中的 xorg.conf 文件即可。这不会使 Nvidia 驱动程序正常工作,但至少 Nouveau 可以正常工作。

答案1

您使用的驱动程序与显卡不兼容。您需要安装其他可用的专业驱动程序(或恢复为 nouveau)。

1. 进入命令 shell:

ctrl++altf2登录。

2. 清除 NVIDIA

sudo apt-get purge nvidia*

现在您可以重新启动并且您将在 Nouveau 上运行,我们可以确保您拥有正确的 NVIDIA 驱动程序。

3. 确保你拥有正确的 Nvidia

sudo add-apt-repository ppa:graphics-drivers
sudo apt update
sudo apt install nvidia-driver-390
sudo nvidia-xconfig

然后重新启动,你应该一切顺利。如果您需要 400 系列驱动程序的功能,请尝试安装 400(而不是 415 或自动安装)并查看它是否有效。否则请坚持使用 390,因为我个人认为它的错误较少。

4. 如果您想测试其他驱动程序或查看有哪些可用:

正如这个帖子,您可以执行以下操作:

sudo ubuntu-drivers list

将显示适用于您当前系统的所有驱动程序包。然后您可以

sudo ubuntu-drivers autoinstall 

安装您需要的所有软件包,或者您可以执行以下操作:

sudo ubuntu-drivers devices

向您显示哪些设备需要驱动程序及其对应的包名称。

5. 重命名旧的 xorg.conf 文件并重新生成

如果你的 xorg.conf 文件中的配置不正确,你可能需要一个新的。因此,请重命名旧文件:

sudo mv /etc/X11/xorg.conf /etc/x11/xorg.conf.bak

然后再次运行 nvidia-xconfig:

sudo nvidia-xconfig

答案2

进入终端。有一个登录选项可以执行此操作。你只需要终端即可。你可以尝试按 ctrl-alt-f1 或 ctrl-alt-f2 进入终端。

无论如何,一旦你进入终端类型:

sudo ubuntu-drivers 自动安装

然后重新启动。

答案3

因此感谢@JoshuaBesneatte,我找到了恢复原始驱动程序(Nouveau)的解决方案:

  1. 清除 Nvidia 并重新启动(参见@JoshuaBesneatte 的回答);
  2. 如果您之前尝试安装过 Nvidia 驱动程序,则可能需要恢复原始配置文件(尤其是如果您使用过sudo nvidia-xconfig)。为此,请删除 /etc/11/ 中的 xorg.conf 文件。

我仍然无法让 Nvidia 驱动程序工作,但至少我有一个可以工作的驱动程序,所以我没问题。

相关内容