Comment 57 for bug 1716857

Revision history for this message
Jean-Pierre van Riel (jpvr) wrote :

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.