I'd like to describe my Nvidia woes of the past few days here in hopes someone can help me diagnose a problem with the Nvidia drivers.
background
TL;DR
I started having this issue on Ubuntu 17, after shuffling around some apt packages (issues with broken dependencies), then I tried for a while the nouveau drivers to get around this issue, and finally upgraded to 18.04 bionic. Unfortunately I am not sure what caused this exactly.
Long version:
- I was using the
nvidia-340
package with no issues with my GeForce 210 card for years. - At some point, not sure why, after logging in to my desktop manager, I would see a black screen, with only the mouse cursor showing. What desktop manager or window manager I used did not seem to make a difference. I could still switch to a virtual console and restart the manager service and some times (not predictably) I could log in again and everything would seem fine, until the next reboot.
- I then tried reinstalling the drivers, from the debian packages, from the run binary download from the Nvidia website, and from the
ppa:graphics-drivers/ppa
repository. The result was always the same. - I then shortly tried the nouveau drivers which allowed me to login to all window managers, but these drivers are slow and hang unexpectedly from time to time when playing video, so this was not acceptable for me. There are multiple bug reports on the net for this type of issues.
- I have since upgraded to 18.04 bionic and reinstalled the regular
nvidia-340
package with apt. (I had first uninstalled the nouveau drivers by blacklisting them in modprobe config.)
Now I am left with a system that does this:
I first see the Nvidia logo right after the Ubuntu splash screen, then gdm3
starts, and when I log in to unity or gnome, I then see a black screen. The mouse pointer does not show at all. If I go to a text console with Alt-F3, I can login and restart the gdm3
service or gdm
service. If I do this enough times, at some point the system suddenly starts to work fine, and I can login to unity or gnome. Sometimes if I leave the computer alone at the login screen for a long while, it will also get fixed, until the next reboot. This tells me that the drivers that I had been using for years without an issue, are still compatible with my system. I have not changed any BIOS settings at any time.I have copied my working /etc/X11/xorg.conf
file to /usr/share/X11/xorg.conf.d/20-nvidia.conf
but that didn't change anything. I have tried using nvidia-xconfig
to recreate the file and it works, but the problem remains the same after reboot. I do not have a CPU with integrated graphics so this is not the problem.
Here's some information about my system, in case it's relevant:
$ uname -a
Linux turbox 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0 ==
modalias : pci:v000010DEd00000A65sv00000000sd00000000bc03sc00i00
vendor : NVIDIA Corporation
model : GT218 [GeForce 210]
manual_install: True
driver : nvidia-340 - distro non-free recommended
$ prime-select query
nvidia
$ sudo lshw -c video
*-display
description: VGA compatible controller
product: GT218 [GeForce 210]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a2
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:26 memory:fb000000-fbffffff memory:c0000000-cfffffff memory:de000000-dfffffff ioport:ef00(size=128) memory:c0000-dffff
$ nvidia-smi
Wed Nov 20 12:01:15 2019
+------------------------------------------------------+
| NVIDIA-SMI 340.107 Driver Version: 340.107 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce 210 Off | 0000:01:00.0 N/A | N/A |
| N/A 50C P0 N/A / N/A | 630MiB / 1023MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Compute processes: GPU Memory |
| GPU PID Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
$ lsmod | grep nvidia
nvidia 10559488 198
drm 401408 10 nvidia
$ echo $XDG_SESSION_TYPE
x11
$ gnome-shell --version
GNOME Shell 3.28.4
My question:
Since I have console access (and usually also graphical access), is there anything I can do to determine what's causing this? I do not want to have to reinstall my system and all its software, since the graphic environment obviously sometimes works fine, just not predictably after boot.
I have looked at journalctl -k
and have googled any error that seemed suspicious to me but I haven't found a solution yet or any useful hints.
Any ideas are welcome. Thanks!
EDIT: Here's some more information: After each reboot, when I log in to a virtual console to try and fix this, at some seemingly random time, about 5 minutes after boot, the screen flashes and takes me away from the text console and into the login screen (desktop manager). It looks as if something has crashed and restarted, but I don't know what that could be. This does not seem to correlate with anything that I do. After this happens, I can login with no problems. At this point it's more of a nuisance than a real problem for me, but still somewhat frustrating. I feel like there should be some way to debug these things.
EDIT2: I am getting the following entries in the Xorg logs:
[ 926.271] (II) systemd-logind: got pause for 13:68
[ 926.272] (II) systemd-logind: got pause for 226:0
[ 926.272] (II) systemd-logind: got pause for 13:65
[ 926.272] (II) systemd-logind: got pause for 13:69
[ 926.272] (II) systemd-logind: got pause for 13:67
[ 926.272] (II) systemd-logind: got pause for 13:64
[ 926.272] (II) systemd-logind: got pause for 13:66
Looking on the web for these errors, I see that many people experience non-deterministic problems with the login screen, which leads me to believe that it's not the drivers that are at fault here. It seems it has something to do with systemd-logind
and maybe dbus
, but unfortunately I don't know what. Hopefully someone with better knowledge of Linux can help?