Bug 1192751

Summary: Regression: suse-prime's nvidia mode broken since xorg-server 21.1.x
Product: [openSUSE] openSUSE Tumbleweed Reporter: Stefan Dirsch <sndirsch>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: Gfx Bugs <gfx-bugs>
Severity: Critical    
Priority: P1 - Urgent CC: Andreas.Grupp, axel.braun, balping314, computingburner, ilgaz, iqgrande, jeroen.olde.monnikhof, jeroenmathonmac, leandro.ldc345, malcolmlewis, manuelkrause, marcin.bajor, martin.jedamzik, opensuse, pujos.michael, snettlet, vignesh0025
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
URL: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1254
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: X.Org X Server 1.20.13 log
X.Org X Server 1.21.1.1 log
Xorg.log

Description Stefan Dirsch 2021-11-16 13:47:08 UTC
Apparently suse-prime's "nvidia" mode broke with the update to xorg-server 21.1.x. The screen remains black. Even when just running

  X -retro

My current guess is, that it's related to this change:

- disabled n_xserver-optimus-autoconfig-hack.patch, which I believe is 
  superseded by:
  commit 078277e4d92f05a90c4715d61b89b9d9d38d68ea
  Author: Dave Airlie <airlied@redhat.com>
  Date:   Fri Aug 17 09:49:24 2012 +1000

    xf86: autobind GPUs to the screen

Mabye I can revert the upstream change and use again our version/patch.

At least the "offload" mode still works.
Comment 1 Stefan Dirsch 2021-11-16 17:09:50 UTC
Ok. Meanwhile I figured out, that if one runs

  xrandr --auto 

on the DISPLAY the screen lightens up and everything is fine again. Hmm.
Comment 2 Marcin Bajor 2021-11-16 18:09:11 UTC
I can confirm this issue.
I observe black screen in display manager after the upgrade (20211110-0 -> 20211111-0)
I use NVIDIA proprietary driver (470.86) and the nvidia config from suse-prime package.
Operating System: openSUSE Tumbleweed 20211110
Kernel Version: 5.14.14-2-default (64-bit)
Graphics Platform: X11
NVIDIA GeForce GTX 1060 with Max-Q Design on Dell G3 3779

The problem I'm having after the update is that my laptop screen goes blank when the display manager (tested SDDM and lightdm) is started. The output is visible only on an external monitor connected via HDMI, but it must be connected before the system boots. After logging in and starting the KDE Plasma, the image is visible on both monitors.

I am also able to enter the password (despite black screen) in SDDM and lightdm and login to the desktop (Plasma) without connected external monitor, so the display manager is fully operable.
Immediately after entering and confirming the password, the Plasma splash screen is shown.
Comment 3 Marcin Bajor 2021-11-16 18:11:32 UTC
Created attachment 853793 [details]
X.Org X Server 1.20.13 log
Comment 4 Marcin Bajor 2021-11-16 18:12:05 UTC
Created attachment 853794 [details]
X.Org X Server 1.21.1.1 log
Comment 5 Marcin Bajor 2021-11-16 18:13:37 UTC
I've attached the logs from X.Org X Server. To compare the differences before and after the update.
Comment 6 Stefan Dirsch 2021-11-16 18:28:50 UTC
Thanks for confirmation and input! Same issue here. Seems GNOME session somehow does some RANDR calls during login/setup. Now I also understand why I haven't seen this  issue when I tested this the first time with xorg-server 21.1.0. I used gdm autologin feature with a GNOME as Xsession. For example you're lost with xdm and icewm as Xsession. (well you can login via ssh and then run 'XAUTHORITY=<...> DISPLAY=:0 xrandr --auto" ;-) )
Comment 7 Stefan Dirsch 2021-11-16 18:30:16 UTC
So using autologin feature of sddm might be a viable worlaround for you for now.
Comment 8 Marcin Bajor 2021-11-16 19:17:08 UTC
(In reply to Stefan Dirsch from comment #7)
> So using autologin feature of sddm might be a viable worlaround for you for
> now.

I can't, because I use pam_mount to mount encrypted hard drives.
Comment 9 Bernard 2021-11-17 12:05:54 UTC
Hi, I can confirm that this issue happens to me too with nvidia driver and Intel + GeForce MX450 hybrid laptop (sddm crashes in 20211111 according to journalctl). Gdm works fine. I am using gdm now as a 'workaround', looking forward to seeing this got fixed soon.
Comment 10 Axel Braun 2021-11-17 14:43:35 UTC
Created attachment 853813 [details]
Xorg.log

and here is one more log of failing nvidia-card
Comment 11 Stefan Dirsch 2021-11-17 17:33:33 UTC
Reported upstream

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1254
Comment 12 Stefan Dirsch 2021-11-17 17:33:33 UTC
Reported upstream

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1254
Comment 13 Jeroen Mathon 2021-11-22 18:29:44 UTC
Temporary workaround is reverting to a pre update snapshot and protecting all xorg packages until a fix is in place
Comment 14 garry fielding 2021-11-23 17:00:28 UTC
Am not sure whether it is the same issue but I have lost 'auto login' ability with Plasma KDE with Suse-Prime (0.8.5-1.1).  If I remove Suse-Prime or install an old version (say 0.7.1.7-1.3), auto login works again )although with a raft of error messages on booting.   

Fresh install today - System info:

Operating System: openSUSE Tumbleweed 20211121
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.2-1-default (64-bit)
Graphics Platform: X11
Processors: 16 × Intel® Core™ i7-10700 CPU @ 2.90GHz
Memory: 15.2 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2060/PCIe/SSE2
Comment 15 Stefan Dirsch 2021-11-23 17:59:28 UTC
@Garry Yes, could be the same issue. Could be that KDE desktop doesn't run any of these RANDR calls which initializes the internal Laptop screen. So that the screen remains black. You might add some session autostart, which runs 'xrandr --auto ' as workaround
or use 'offload' mode.
Comment 16 garry fielding 2021-11-23 20:02:05 UTC
Thanks Stefan

My p/c is a desktop not a laptop.  I do not have any of the other issues like the black screen, just the auto-login not working - although all the settings (like the setting in the file in etc / sysconfig / displaymanager is: DISPLAYMANAGER_AUTOLOGIN="xxx") appear correct.
Comment 17 Stefan Dirsch 2021-11-23 20:09:52 UTC
Hmm. What does mean the autologin does not work exactly?
Comment 18 garry fielding 2021-11-23 21:12:17 UTC
Although my system is set to auto-login, it stops at the sddm screen. I then have to add my password before the plasma session starts.

If I remove the 'suse-prime' rpm or roll back to an earlier version of suse-prime (say 0-7-17-1.3) my p/c then boots to the plasma desktop (athough it shows a raft of error messages whilst booting).

Hope this makes sense?  Is there are system data/ reports that I can gather that may help?
Comment 19 Stefan Dirsch 2021-11-23 21:36:33 UTC
This sounds weird. Autologin (display manager configuration) should not be related to which driver is being used.
Comment 20 Stefan Dirsch 2021-11-23 21:37:22 UTC
I suggest to handle this in a separate ticket.
Comment 21 Jeroen Mathon 2021-11-24 11:42:48 UTC
(In reply to Stefan Dirsch from comment #20)
> I suggest to handle this in a separate ticket.

Can the ticket be be mentioned here after creation so that people following this issue can know when it is resolved? for now i protected all packages regarding this issue on my work stations, i'm pretty sure others did too
Comment 22 Stefan Dirsch 2021-11-24 12:49:04 UTC
(In reply to Jeroen Mathon from comment #21)
> (In reply to Stefan Dirsch from comment #20)
> > I suggest to handle this in a separate ticket.
> 
> Can the ticket be be mentioned here after creation so that people following
> this issue can know when it is resolved? for now i protected all packages
> regarding this issue on my work stations, i'm pretty sure others did too

Feel free to add it here once you've opened the new ticket.
Comment 23 Stefan Dirsch 2021-11-25 19:27:23 UTC
*** Bug 1192923 has been marked as a duplicate of this bug. ***
Comment 24 Stefan Dirsch 2021-12-02 19:46:07 UTC
*** Bug 1193341 has been marked as a duplicate of this bug. ***
Comment 25 Axel Braun 2021-12-15 08:58:25 UTC
(In reply to Stefan Dirsch from comment #12)
> Reported upstream
> 
> https://gitlab.freedesktop.org/xorg/xserver/-/issues/1254

There is no real progress upstream, except the link back to this bug report. Is it an option to revert X-Server to 1.20.x in TW until this is fixed?
Comment 26 Jeroen Mathon 2021-12-15 09:00:09 UTC
(In reply to Axel Braun from comment #25)
> (In reply to Stefan Dirsch from comment #12)
> > Reported upstream
> > 
> > https://gitlab.freedesktop.org/xorg/xserver/-/issues/1254
> 
> There is no real progress upstream, except the link back to this bug report.
> Is it an option to revert X-Server to 1.20.x in TW until this is fixed?

I second this, i currently have packages on protected to prevent them from updating, but not everyone is so lucky
Comment 27 Michael Pujos 2021-12-15 10:39:32 UTC
What about adding 'xrandr --auto' in /usr/share/sddm/scripts/Xsetup ?

I've tested it and it works as a workaround, until this is eventually fixed in Xorg.
I cannot see any possible problematic side effect of invoking this command in Xsetup. Although it will only work for SDDM.
Comment 28 Jeroen Mathon 2021-12-15 11:24:18 UTC
(In reply to Michael Pujos from comment #27)
> What about adding 'xrandr --auto' in /usr/share/sddm/scripts/Xsetup ?
> 
> I've tested it and it works as a workaround, until this is eventually fixed
> in Xorg.
> I cannot see any possible problematic side effect of invoking this command
> in Xsetup. Although it will only work for SDDM.

Is full functionality(HDMI Port active) with this workaround achieved?:
[P1]: A display session can be started with or without the HDMI/Graphics card working(This means integrated graphics do the job)
[P2]: HDMI Port works and the second graphics card can be used for a second screen as well as ofloading graphics

P1 is the minimal asked functionality on this bug since some users cant even start sddm/DM's
Comment 29 Axel Braun 2021-12-15 11:40:52 UTC
(In reply to Michael Pujos from comment #27)
> What about adding 'xrandr --auto' in /usr/share/sddm/scripts/Xsetup ?

tried this, and does not work for me:
X1E:~ # update-alternatives --display default-displaymanager
default-displaymanager - auto mode
  link best version is /usr/lib/X11/displaymanagers/sddm
  link currently points to /usr/lib/X11/displaymanagers/sddm
  link default-displaymanager is /usr/lib/X11/displaymanagers/default-displaymanager
Comment 30 Michael Pujos 2021-12-15 12:41:38 UTC
Hmmm, I use a non standard /etc/sddm.conf, so you might have to add 'xrandr --auto' at the end of /usr/etc/X11/xdm/Xsetup instead.
Comment 31 Stefan Dirsch 2021-12-15 13:58:47 UTC
Another workaround would be to use suse-prime's "offload mode".
Comment 32 Jeroen Mathon 2021-12-15 14:08:37 UTC
(In reply to Stefan Dirsch from comment #31)
> Another workaround would be to use suse-prime's "offload mode".
Wouln'd that impair functionality, Does this mean people can use both the internal screen as well as the HDMI port or does this mean people can only use either the internal screen or the HDMI screen
Comment 33 Stefan Dirsch 2021-12-15 14:17:41 UTC
Hmm. Not sure how suse-prime is related to additional outputs. It just makes use of the discrete nVidia GPU for rendering. It does not help to drive outputs connected to the nVidia GPU. It only supports Optimus systems (everything connected to internal GPU).
Comment 34 Michael Pujos 2021-12-15 14:24:10 UTC
The only thing that should be necessary to handle external outputs (HDMI, DP, TB3) managed the the NVIDIA dGPU is a Xorg config using the nvidia Xorg driver (and kernel modules of courses).
So offload should work just fine for this use case (though I did not try it).
Comment 35 Axel Braun 2021-12-20 11:06:57 UTC
(In reply to Michael Pujos from comment #30)
> Hmmm, I use a non standard /etc/sddm.conf, so you might have to add 'xrandr
> --auto' at the end of /usr/etc/X11/xdm/Xsetup instead.

That does not work either. Still a black screen, restarting X-Server does not change result
Comment 37 Dura-Kovács 2022-01-04 00:10:20 UTC
(In reply to Stefan Dirsch from comment #36)
> but I haven't tested it yet. Maybe somebody else affected could ....

I installed the patched version and it solved the issue for me. Thank you very much!
Comment 38 Stefan Dirsch 2022-01-04 00:42:32 UTC
Thanks @Dura-Kovács This sounds at least promising! :-)
Comment 39 Axel Braun 2022-01-04 08:47:18 UTC
(In reply to Stefan Dirsch from comment #36)

> https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server
> 
> but I haven't tested it yet. Maybe somebody else affected could ....

Works for me as well! Thanks!
Comment 40 Stefan Dirsch 2022-01-04 17:28:28 UTC
Nice. I just submitted this to factory/Tumbleweed. So let's close this one as FIXED.
Comment 41 OBSbugzilla Bot 2022-01-04 18:00:04 UTC
This is an autogenerated message for OBS integration:
This bug (1192751) was mentioned in
https://build.opensuse.org/request/show/943815 Factory / xorg-x11-server
Comment 42 Dura-Kovács 2022-01-04 20:12:11 UTC
The only issue this patch introduced is that mate-panel wouldn't start at login when connected to an external monitor. I shall open a new ticket for this.
Comment 43 Manuel Krause 2022-01-07 16:36:22 UTC
I also want to leave a sincere huge "Thank You!" to all people involved to solve this issue.
Having been about to fiddle around with the lot of non-working hints found with too simple google searches I found this solution on here just in time.
The Xserver provided @ https://bugzilla.opensuse.org/show_bug.cgi?id=1192751#c36 saved my recent Tumbleweed update.

Nice work from all of you!

Best regards,
Manuel