Gnome initiates session, blank screen after login

As per following the guidelines from this thread:

https://devtalk.nvidia.com/default/topic/995110/linux/oops-something-went-wrong-and-the-system-can-t-recover/

The issue is that I get to the gdm3 login screen, however after entering login details the screen stays blank.

journal -b 0 --no-pager log: https://pastebin.com/FG5Znsay
Xorg.0.log: https://pastebin.com/mAATPHC4

Anyone can point me on a possible fix or how to debug this? Dual GPU configuration with geforce gtx960m and intel graphics. Also I have logger setOptimus in the optimus autostart file. Running kernel 4.16 and the last beta driver (the stable does not get even to the gdm login screen).

You have ‘nomodeset’ kernel parameter set, so nothing works. Just remove.

@generix I have just nvidia-drm.modeset=1 in my kernel options. The nomodeset entry is probably from a previous configuration. I have tried all possible options at boot time - nomoeset, nvidia-drm.modeset=1,
nomodeset i915.modeset=0 nouveau.modeset=0.

Any clue on what to try next? I’ll be ok with just getting a graphical environment so far, even with no dual gpu support set on.

Yes, the Xorg log must be old, looked at the journal output and there only nvidia-drm.modeset=1 is set.
But I noticed that the output enabler (setOptimus) is only called on gdm start but not on user session start. Is the autostart file in /etc/xdg/autostart missing/incorrect?

Here’s a more recent journal log: https://pastebin.com/Vns38Lxa

The optimus.desktop is in /root/.config/autostart/ and /usr/share/gdm/greeter, /etc/xdg/autostart as well. It’s the same file I’ve always used with previous kernels, used to work fine.

Since the GDM login screen is shown, I suppose the xrandr commands are not running.

Another thing that cought my attention within the journal log:

Jul 05 14:17:05 linuxbox /usr/lib/gdm3/gdm-x-session[1584]: mesg: ttyname failed: Inappropriate ioctl for device
Jul 05 14:17:05 linuxbox /usr/lib/gdm3/gdm-x-session[1584]: /etc/gdm3/Xsession: Executing default failed, will try to run x-terminal-emulator
Jul 05 14:17:06 linuxbox dbus-daemon[1580]: [session uid=0 pid=1580] Activating via systemd: service name=‘org.a11y.Bus’ unit=‘at-spi-dbus-bus.service’ requested by ‘:1.3’ (uid=0 pid=1605 comm="/usr/bin/zenity --info --text I could not start yo")

Those errors are just the symptom, gdmo tries to display the ‘oh no, something went wrong’ message, failing to do so either.
The problem is that the setOptimus script isn’t run o login, I can’t see a trace of it. Which gnome version and distro are you running?

Linux 4.16.0-kali2-amd64 #1 SMP Debian 4.16.16-2kali1 (2018-06-25) x86_64 GNU/Linux
GDM: GDM 3.28.2
xserver-xorg is 1:7.7+19

nvidia-xconfig: version 396.18 (buildmeister@swio-display-x86-rhel47-02) Fri Apr 6 00:58:07 PDT 2018

optimus.desktop (in /root/.config/autostart and /usr/share/gdm/greeter):
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c “xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto; logger setOptimus”
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

xorg.conf file: https://pastebin.com/9Wz0EgcP

Does it work if you login as normal user, not root?
Does
sh -c “xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto; logger setOptimus”
report any error about paths if you run it as root on console?

As normal user it responds “Cannot create session: Already running in a session”
Journal log: https://pastebin.com/KPuTNb44 (please note that I have substituted the actual user with the string “user”)

I’m not able to run the xrandr commands manually as it states “Can’t open display”.

Ok, this gets confusing. I suspect the autostart files never get started because no gnome-session is started at all.

Jul 05 17:15:07  /usr/lib/gdm3/gdm-x-session[1688]: /etc/gdm3/Xsession: Beginning session setup...

That file is one of the old gdm startup files which afaik don’t exist anymore since gdm 3.20 or so. That file sets up a very basic generic xsession.
Please check which gdm version you’re running, it’s either a very old one or some debian patched one. You could also add the xrandr command line to that script though you probably won’t get a gnome-session.
Also trying to remove that script would be worth a try.

GDM version is stated above: GDM 3.28.2 (using gdm --version command)

Maybe check if the correct session is available and set as default for your user:
in the directory /usr/share/xsessions the available user sessions are stored in .desktop file format, so there should be a gnome.desktop or similar file containing at least

[Desktop Entry]
Name=GNOME
Exec=gnome-session
TryExec=gnome-session
Type=Application
DesktopNames=GNOME

The file /var/lib/AccountsService/users/ then contains the name of the default session from above to start:

[User]
Language=
XSession=gnome
SystemAccount=false

Those should be read and started accordingly by gdm-session but in your case not.
gnome-session is then the part which starts gnomeshell and the .desktop file in the autostart directories.
Please check.

both files exist, however the /var/lib/Accounts/Service/users/root file has XSession set as an empty value. Tried changing it to the value “gnome” (as in the /usr/share/xsessions/gnome.desktop file), however still getting a blank screen. Not sure if case should match but I tried both lowercase and uppercase.

Actually it seems that after reboot the file variable is with a blank value again. When should I change it since service gdm3 restart doesnt work as well? Or prior logging in?

Tried changing it manually to XSession=gnome, still getting a blank screen. Also tried to put the xrandr in /etc/gdm3/XSession and it didnt work. Wonder if it’s a gnome/kernel related bug already as I can’t even get the nouveau driver to work with this kernel version.

Kernel, driver and xorg work fine, it’s just the session management of gdm that’s strangely broken. Instead of starting gnome-session, it’s trying to start something else. Did this work earlier on this system? Did you upgrade anything gdm related recently? Is gnome-session installed?

@generix thanks for following this.

Yes, it used to work with an older driver and kernel version. Everything messed up after the last dist-upgrade and kernel 4.16. I did a reinstall of gnome-session but it didnt help, I have also tried purging all xserver-xorg, gdm and gnome-session packages. May be it’s a kernel related bug, however strange thing is it actually manages to get to the login screen, so it is able to render graphics. Have in mind that the nouveau driver is not working and not even getting to the login screen. At this point I’ll be ok with just having a GUI with whatever driver, however this is as far as I could get using this kernel version. What are all the packages involved into this? May be I could try to purge them again.

xserver-xorg, gdm3, gnome-session, anything else? Or may be just gnome-session? (and gnome-shell?)

Tried purging gnome-shell and gnome-session, still no luck. Any other suggestions to somehow get xrandr to execute?

One thing to check would be the packages accountservice and dbus, check if accounts-daemon is running. Those are the parts which tell gdm what session to use.
To check if gnome-session is working in general, create ~/.xinitrc containing

exec gnome-session

then use
startx – :2
to start an xserver with gnome session.

Worked! The xinit package was missing (found this out after executing the startx command). Will now try to reboot and see if the session would be initiated.

Update: Ok it doesn’t work by itself so I still have to type the startx command. Any idea if we could debug this any further and inspect the exact reason to make it work as it should? If you need any kind of bug reports let me know.

Last journal log (after a successful session via startx): https://pastebin.com/9PExyc3J
~/.xsession-errors (prior starting a session using startx): https://pastebin.com/WJGtx3UJ