Black screen on GDM3 login Ubuntu 18.04.1 Nvidia 396.54 with 4k monitor

After upgrading from 17.10 to 18.04.1 everything was fine (means my X-session came up in mode 3840x2160_30) when I had installed the Nvidia 390 driver.
After a second reboot the GDM3 login screen was still fine but when logging in into my userid (501) screen went black and did not recover. This is reproducible.
Reverting to Nouveau driver seemed to solve the problem, but after a couple of reboots (3-5) Nouveau comes up with mode 1024x768 without any choice.
Now I updated to Nvidia 396.54 downloaded from PPA, it works up to GDM3 login screen but after the login it goes black again.

Following is the Xorg.1.log

Any help or advice much apprechiated.

Karl

root@lnx54srv14:/var/log# cat Xorg.1.log
[    27.970] _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
[    27.970] _XSERVTransMakeAllCOTSServerListeners: server already running
[    27.970] (--) Log file renamed from "/var/log/Xorg.pid-2846.log" to "/var/log/Xorg.1.log"
[    27.971] 
X.Org X Server 1.19.6
Release Date: 2017-12-20
[    27.971] X Protocol Version 11, Revision 0
[    27.971] Build Operating System: Linux 4.4.0-119-generic x86_64 Ubuntu
[    27.971] Current Operating System: Linux lnx54srv14 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64
[    27.971] Kernel command line: BOOT_IMAGE=/vmlinuz-4.15.0-33-generic root=UUID=634e378b-6aa0-4a93-8922-abece17ec21a ro quiet splash vt.handoff=1
[    27.971] Build Date: 13 April 2018  08:07:36PM
[    27.971] xorg-server 2:1.19.6-1ubuntu4 (For technical support please see http://www.ubuntu.com/support) 
[    27.971] Current version of pixman: 0.34.0
[    27.971] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    27.971] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    27.972] (==) Log file: "/var/log/Xorg.1.log", Time: Fri Sep  7 22:12:56 2018
[    27.972] (==) Using config file: "/etc/X11/xorg.conf"
[    27.972] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    27.972] (==) ServerLayout "Layout0"
[    27.972] (**) |-->Screen "Screen0" (0)
[    27.972] (**) |   |-->Monitor "Monitor0"
[    27.973] (**) |   |-->Device "Device0"
[    27.973] (**) |-->Input Device "Keyboard0"
[    27.973] (**) |-->Input Device "Mouse0"
[    27.973] (==) Automatically adding devices
[    27.973] (==) Automatically enabling devices
[    27.973] (==) Automatically adding GPU devices
[    27.973] (==) Automatically binding GPU devices
[    27.973] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    27.973] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    27.973] 	Entry deleted from font path.
[    27.973] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    27.973] 	Entry deleted from font path.
[    27.973] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    27.973] 	Entry deleted from font path.
[    27.973] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    27.973] 	Entry deleted from font path.
[    27.973] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    27.973] 	Entry deleted from font path.
[    27.973] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/Type1,
	built-ins
[    27.973] (==) ModulePath set to "/usr/lib/xorg/modules"
[    27.973] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[    27.973] (WW) Disabling Keyboard0
[    27.973] (WW) Disabling Mouse0
[    27.973] (II) Loader magic: 0x55fd7a20a020
[    27.973] (II) Module ABI versions:
[    27.973] 	X.Org ANSI C Emulation: 0.4
[    27.973] 	X.Org Video Driver: 23.0
[    27.973] 	X.Org XInput driver : 24.1
[    27.973] 	X.Org Server Extension : 10.0
[    27.974] (++) using VT number 2

[    27.978] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_32
[    27.978] (II) xfree86: Adding drm device (/dev/dri/card0)
[    27.979] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 13 paused 0
[    27.983] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
[    27.989] (--) PCI:*(0:2:0:0) 10de:1287:1043:8525 rev 161, Mem @ 0xc1000000/16777216, 0xc8000000/134217728, 0xc4000000/33554432, I/O @ 0x00003000/128, BIOS @ 0x????????/131072
[    27.989] (II) LoadModule: "glx"
[    27.989] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/libglx.so
[    27.994] (II) Module glx: vendor="NVIDIA Corporation"
[    27.994] 	compiled for 4.0.2, module version = 1.0.0
[    27.994] 	Module class: X.Org Server Extension
[    27.994] (II) NVIDIA GLX Module  396.54  Tue Aug 14 22:37:05 PDT 2018
[    27.994] (II) LoadModule: "nvidia"
[    27.994] (II) Loading /usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so
[    27.994] (II) Module nvidia: vendor="NVIDIA Corporation"
[    27.994] 	compiled for 4.0.2, module version = 1.0.0
[    27.994] 	Module class: X.Org Video Driver
[    27.994] (II) NVIDIA dlloader X Driver  396.54  Tue Aug 14 22:15:03 PDT 2018
[    27.994] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    27.994] (II) systemd-logind: releasing fd for 226:0
[    27.995] (II) Loading sub module "fb"
[    27.995] (II) LoadModule: "fb"
[    27.995] (II) Loading /usr/lib/xorg/modules/libfb.so
[    27.995] (II) Module fb: vendor="X.Org Foundation"
[    27.995] 	compiled for 1.19.6, module version = 1.0.0
[    27.995] 	ABI class: X.Org ANSI C Emulation, version 0.4
[    27.995] (II) Loading sub module "wfb"
[    27.995] (II) LoadModule: "wfb"
[    27.995] (II) Loading /usr/lib/xorg/modules/libwfb.so
[    27.995] (II) Module wfb: vendor="X.Org Foundation"
[    27.995] 	compiled for 1.19.6, module version = 1.0.0
[    27.995] 	ABI class: X.Org ANSI C Emulation, version 0.4
[    27.995] (II) Loading sub module "ramdac"
[    27.995] (II) LoadModule: "ramdac"
[    27.995] (II) Module "ramdac" already built-in
[    27.996] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[    27.996] (==) NVIDIA(0): RGB weight 888
[    27.996] (==) NVIDIA(0): Default visual is TrueColor
[    27.996] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    27.996] (II) Applying OutputClass "nvidia" options to /dev/dri/card0
[    27.996] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration"
[    27.996] (**) NVIDIA(0): Enabling 2D acceleration
[    27.998] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:2:0:0
[    27.998] (--) NVIDIA(0):     CRT-0
[    27.998] (--) NVIDIA(0):     DFP-0
[    27.998] (--) NVIDIA(0):     DFP-1 (boot)
[    28.000] (II) NVIDIA(0): NVIDIA GPU GeForce GT 730 (GK208) at PCI:2:0:0 (GPU-0)
[    28.000] (--) NVIDIA(0): Memory: 2097152 kBytes
[    28.000] (--) NVIDIA(0): VideoBIOS: 80.28.b8.00.13
[    28.000] (II) NVIDIA(0): Detected PCI Express Link width: 8X
[    28.000] (EE) NVIDIA(GPU-0): Failed to acquire modesetting permission.
[    28.000] (EE) NVIDIA(0): Failing initialization of X screen 0
[    28.001] (II) UnloadModule: "nvidia"
[    28.001] (II) UnloadSubModule: "wfb"
[    28.001] (II) UnloadSubModule: "fb"
[    28.001] (EE) Screen(s) found, but none have a usable configuration.
[    28.001] (EE) 
Fatal server error:
[    28.001] (EE) no screens found(EE) 
[    28.001] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[    28.001] (EE) Please also check the log file at "/var/log/Xorg.1.log" for additional information.
[    28.001] (EE) 
[    28.040] (EE) Server terminated with error (1). Closing log file.

nvidia-installer.log (4.75 KB)
nvidia-uninstall.log (12.7 KB)
nvidia-bug-report.log.gz (129 KB)

Solved - But not understood why!

After the next reboot when the system again presented a black screen upon me trying to login, I ssh’d from remote and did the following as root (this protocol written down from memory):

Since I suspected the GDM3 is not properly starting the user session on a user login, I purged GDM3.
(This purges all the depending gnome packages as well.)

apt-get purge gdm3

As I was unable to install any other login manager I installed GDM3 again. (Don’t recall If I did a reboot in between. I don’t think so.)

apt-get install gdm3

(The other gnome packages which were uninstalled as they depend from gdm3 were installed manually as well as they are not automatically installed as prerequisites of gdm3.)

After a reboot the GDM3 screen came up as before. Logging in did not lead to a black screen but started the user session cleanly and with the correct native screen resolution. The Xorg.1.log file did not contain any EE messages.

Shortly the software updater popped up and offered a bunch of updates which I accepted and installed.

All the following reboots went cleanly and GDM3 always started my user sessions flawlessly.

What should I say? Nobody knows what went wrong before.

Karl

I encountered the same issue recently. One month ago I updated my nvidia-driver from 410 to 418 via sudo apt update & upgrade. Then every time when I logined in, I would encounter a black screen. I was forced to use the recovery mode of Ubuntu to bypass this issue. My initial suspection was the display manager gdm3 not working properly, but now I suspect that the issue was from nvidia-driver 418.

Here is what I did to solve the black screen issue.

  1. My PC is currently using Nvidia-driver 418. I install PPA with latest drivers
sudo add-apt-repository ppa:graphics-drivers/ppa 
sudo apt-get update

My solution at this step is from here:
https://askubuntu.com/questions/1048274/ubuntu-18-04-stopped-working-with-nvidia-drivers

  1. Then I do
sudo apt update
sudo apt upgrade

It shows that I need to update a bunch of nvidia-driver 418 version. These updates are not shown before I do the step one, so my guess is connected to the PPA repository the compute can find the latest update (fix patch). Once I update it, I reboot and everything works now!

Who know what had happen before… my work with nvidia driver 410 is ok (not perfect!), but these weird things start to show up as I upgraded to 418. Maybe my previous version of nvidia-driver 418 is indeed broken.

Please see this:
https://devtalk.nvidia.com/default/topic/1050238/linux/freeze-after-login-screen-in-ubuntu-18-04-with-1050ti-mobile/