使用显卡时登录循环和黑屏

使用显卡时登录循环和黑屏

我是如何来到这里的

我一直在笔记本电脑上使用 Ubuntu 18.04,配有 Nvidia GTX 1660Ti 显卡,并使用从 Nvidia 网站下载的 .run 文件安装了 440 驱动程序。我需要它来实现 pytorch cuda 加速并在 gazebo 上运行一些模拟。

我的系统设置:

  • 配备集成 GPU 的 i7 9750H
  • Nvidia Geforce GTX 1660Ti(支持 Optimus)
  • 16GB 内存
  • Ubuntu 18.04 与 Windows 10 双启动
  • x86_64 Linux 5.4.0-52-通用内核

问题始于我更新 BIOS 时。首先,亮度调到最大,滑块无法改变亮度。鼠标垫也停止工作了。我尝试安装xserver-xorg-input-synaptics,按照论坛上的说明进行操作,但最终删除了一些 xserver-xorg 软件包和 ubuntu-desktop。重新启动系统导致黑屏,其中有大量以 [OK] 开头的文本。我可以用 alt+ctr+F2 启动 tty,但无法登录,因为之前的黑屏一直在闪烁并捕获了我的击键。我将显示管理器更改为 lightdm,然后能够启动 tty。我卸载了 nvidia 驱动程序并添加了 nomodeset 并安装ubuntu-desktopxserver-xorg-hwe-18.04能够登录,一切正常。但是,我无法使用我的 GPU(集成或独立,两者兼有)。

问题

但是,当我删除 nomodeset 时,即使在集成 GPU 上运行时,我也会进入登录循环。lightdm 登录屏幕出现,然后我的壁纸出现并停留约 2 秒,然后返回登录屏幕。/tmp 文件夹和 .Xauthority 文件的权限和所有权没有问题。我尝试安装 nvidia 驱动程序,结果出现黑屏(无登录屏幕)。添加 nomodeset 可以正常工作,但我显然无法使用我的 nvidia GPU 进行 cuda 加速,也无法加载 gazebo,因此从长远来看这不是一个选择。

我是 Linux 新手,对内核、显示管理等知之甚少。因此,我无法有效地在 /var/log/Xorg.0.log 文件中发现任何问题。请指导我可能出现的问题,并询问我需要附加哪些日志文件(如果可能,请使用完整路径,因为我真的不知道该怎么做)

输出apt list --installed | grep xserver

x11-xserver-utils/bionic,now 7.7+7build1 amd64 [installed]
xserver-common/bionic-updates,bionic-updates,now 2:1.19.6-1ubuntu4.7 all [installed]
xserver-xephyr/bionic-updates,now 2:1.19.6-1ubuntu4.7 amd64 [installed]
xserver-xorg-core-hwe-18.04/bionic-updates,bionic-security,now 2:1.20.8-2ubuntu2.2~18.04.3 amd64 [installed]
xserver-xorg-hwe-18.04/bionic-updates,now 1:7.7+19ubuntu8~18.04.3 amd64 [installed]
xserver-xorg-input-all-hwe-18.04/bionic-updates,now 1:7.7+19ubuntu8~18.04.3 amd64 [installed]
xserver-xorg-input-libinput-hwe-18.04/bionic-updates,now 0.28.1-1~18.04.1 amd64 [installed]
xserver-xorg-input-wacom-hwe-18.04/bionic-updates,now 1:0.36.1-0ubuntu1~18.04.1 amd64 [installed]
xserver-xorg-legacy-hwe-18.04/bionic-updates,bionic-security,now 2:1.20.8-2ubuntu2.2~18.04.3 amd64 [installed]
xserver-xorg-video-all-hwe-18.04/bionic-updates,now 1:7.7+19ubuntu8~18.04.3 amd64 [installed]
xserver-xorg-video-amdgpu-hwe-18.04/bionic-updates,now 19.1.0-1~18.04.1 amd64 [installed]
xserver-xorg-video-ati-hwe-18.04/bionic-updates,now 1:19.1.0-1~18.04.1 amd64 [installed]
xserver-xorg-video-fbdev-hwe-18.04/bionic-updates,now 1:0.5.0-1ubuntu1~18.04.1 amd64 [installed]
xserver-xorg-video-intel-hwe-18.04/bionic-updates,now 2:2.99.917+git20171229-1ubuntu1~18.04.1 amd64 [installed]
xserver-xorg-video-nouveau-hwe-18.04/bionic-updates,now 1:1.0.16-1~18.04.1 amd64 [installed]
xserver-xorg-video-qxl-hwe-18.04/bionic-updates,now 0.1.5-2build2~18.04.1 amd64 [installed]
xserver-xorg-video-radeon-hwe-18.04/bionic-updates,now 1:19.1.0-1~18.04.1 amd64 [installed]
xserver-xorg-video-vesa-hwe-18.04/bionic-updates,now 1:2.4.0-1~18.04.1 amd64 [installed]
xserver-xorg-video-vmware-hwe-18.04/bionic-updates,now 1:13.3.0-2build1~18.04.1 amd64 [installed]

输出sudo lshw -C display

  *-display UNCLAIMED       
       description: VGA compatible controller
       product: NVIDIA Corporation
       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
       configuration: latency=0
       resources: memory:b3000000-b3ffffff memory:a0000000-afffffff memory:b0000000-b1ffffff ioport:4000(size=128) memory:b2000000-b207ffff
  *-display UNCLAIMED
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:b5000000-b5ffffff memory:90000000-9fffffff ioport:5000(size=64) memory:c0000-dffff

相关内容