[Bug 1716857] Re: nvidia-drm.modeset=1, gdm3 and optimus laptop results in no external monitors detected by Xorg
Jean-Pierre van Riel
1716857 at bugs.launchpad.net
Sun May 3 13:40:23 UTC 2020
Apologies, continuing the comment above (mistakenly posted when adding
the log attachment). Let me retry.
Failure loop observed:
- Failed to blit shared framebuffer: EGL failed to allocate resources for the requested operation.
- Failed to set CRTC mode 3840x2160: No such file or directory
To summarise and share my experience of it on a Lenovo P53 and some
quirks/workarounds:
- `sudo ubuntu-drivers autoinstall` got Nvidia 440.59 drivers installed.
- However, Nvidia modeset was not enabled as yet.
$ sudo cat /sys/module/nvidia_drm/parameters/modeset
N
- Blank external screen occurs with modeset=0 (disabled)
- Then, using `prime-select nvidia`, I tried to ensure nvidia was primary
- `prime-select nvidia` sets `options nvidia-drm modeset=1` but it's not effective, even after I rebooted
~$ cat /lib/modprobe.d/nvidia-kms.conf
# This file was generated by nvidia-prime
# Set value to 0 to disable modesetting
options nvidia-drm modeset=1
- To make it effective, because modeset is done during initramfs part of boot, I ran `sudo update-initramfs -u -k all`.
- It seems the prime-select option fails to trigger a intiramfs update (probably should be filed as a separate bug)
- Regardless, the blank screen issue occured on my Lenovo P53 with or without Nvidia KMS modeset enabled
- But one benefit of KMS modeset for Nvida is now the external display gets properly recognised. /sys/class/drm/card1-HDMI-A-1/ now exists (was missing with Ubuntu 18.04.4 LTS default proprietary install) including the EDID data being read properly and X getting the actual DPI of the screen correctly.
Without nvidia modeset, as seen in `journalctl -b _COMM=gdm-x-session |
grep -C2 -E '(EE)|(WW)'`:
(WW) NVIDIA(0): Unable to get display device for DPI computation.
With nvidia modeset:
(II) NVIDIA(0): Validated MetaModes:
(II) NVIDIA(0): "DFP-3:nvidia-auto-select"
(II) NVIDIA(0): Virtual screen size determined to be 3840 x 2160
(--) NVIDIA(0): DPI set to (139, 140); computed from "UseEdidDpi" X config
I've also found two workarounds to my issue.
1. Run a script that sets the frequency to 30HZ and then back to 60HZ
2. Switch to discrete only graphics in the BIOS
In most cases, when one is using a 2nd display, there's usually a
powersource available so the complexity of hybrid graphics isn't worth
it and I went with simply disabling hybrid graphics in the BIOS.
It's quite interesting that toggling the display refresh rate down to
30HZ and then back up to 60HZ seems to work around the problem of gnome-
shell mutter's "EGL failed to allocate resources for the requested
operation" bug.
To conclude, even with the root access workaround in place:
$ tail -n 2 /etc/X11/Xwrapper.config
# Added by xserver-xorg-video-nvidia-440
needs_root_rights=yes
I still had external display connection issues with 4K 60Hz.
This might need to be logged as different bug? I'm unsure it's GDM3s
fault given the root workaround was in place, but it's highly
related/similar.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1716857
Title:
nvidia-drm.modeset=1, gdm3 and optimus laptop results in no external
monitors detected by Xorg
Status in gdm3 package in Ubuntu:
Opinion
Status in nvidia-graphics-drivers-375 package in Ubuntu:
Confirmed
Status in nvidia-graphics-drivers-418 package in Ubuntu:
Confirmed
Status in nvidia-graphics-drivers-430 package in Ubuntu:
Confirmed
Status in nvidia-graphics-drivers-435 package in Ubuntu:
Confirmed
Status in systemd package in Ubuntu:
Confirmed
Bug description:
Context:
17.10 development packages, nvidia binary driver 375, modeset=1 for the nvidia driver.
ubuntu desktop (gnome shell), fresh install
ThinkPad W520 in Nvidia Optimus bios mode.
Nvidia profile.
Result:
no external monitors are detected.
xrandr does not even list them as disconnected (normally it would list five external disconnected monitors)
lsmod
shows that nvidia driver is loaded
and the modesetting is working at some level because there is no tearing on the laptop panel
Note: modeset=1 is the only way to get flicker-free graphics on the laptop panel. modeset=1 is not the default setting but it is highly desirable.
It works if lightdm is used which is why I have reported this against gdm3
My sessions in this configuration have mostly crashed after a few minutes with a gdm3 fail whale message in syslog but nothing else looks interesting.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1716857/+subscriptions
More information about the foundations-bugs
mailing list