[radeon] gnome-shell Wayland sessions fail to start on legacy Radeon systems (Failed to lock front buffer on /dev/dri/cardN: drmModeAddFB2WithModifiers failed: Invalid argument)

Bug #1966808 reported by Prajjwal Devkota
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
High
Daniel van Vugt

Bug Description

Wayland started crashing for me on upgrade to Jammy, which I'm aware is currently in alpha.

gdm was crashing, and changing to lightdm addressed this issue. If I select 'Ubuntu on Xorg' - I can login without problems.

If I select Wayland instead, I just get a black screen, and I have to kill gnome-session from a virtual console.

WORKAROUND:

Add this to /etc/environment: MUTTER_DEBUG_USE_KMS_MODIFIERS=0

---

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gnome-shell 42~beta-1ubuntu3
ProcVersionSignature: Ubuntu 5.15.0-23.23-generic 5.15.27
Uname: Linux 5.15.0-23-generic x86_64
ApportVersion: 2.20.11-0ubuntu79
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Mar 28 15:23:51 2022
DisplayManager: lightdm
InstallationDate: Installed on 2022-03-19 (9 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220318)
RelatedPackageVersions: mutter-common 42~beta-1ubuntu2
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like the main issue is in the radeon driver as logged by mutter through the gnome-shell process:

[ 41.402230] perseverance gnome-shell[1980]: Running GNOME Shell (using mutter 42.beta) as a Wayland display server
[ 41.541617] perseverance gnome-shell[1980]: Device '/dev/dri/card0' prefers shadow buffer
[ 41.706004] perseverance gnome-shell[1980]: Added device '/dev/dri/card0' (radeon) using non-atomic mode setting.
[ 41.712482] perseverance gnome-shell[1980]: Device '/dev/dri/card1' prefers shadow buffer
[ 41.794534] perseverance gnome-shell[1980]: Added device '/dev/dri/card1' (radeon) using non-atomic mode setting.
[ 41.862439] perseverance gnome-shell[1980]: Created gbm renderer for '/dev/dri/card0'
[ 41.874842] perseverance gnome-shell[1980]: Created gbm renderer for '/dev/dri/card1'
[ 41.875169] perseverance gnome-shell[1980]: Boot VGA GPU /dev/dri/card1 selected as primary
...
[ 76.556487] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 76.572662] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 76.585261] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 76.620348] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 76.635119] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 76.652753] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
[ 77.141353] perseverance gnome-shell[1980]: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument

summary: - Wayland crashes on Jammy (was fine on Impish)
+ [radeon] gnome-shell: Failed to lock front buffer on /dev/dri/card1:
+ drmModeAddFB2WithModifiers failed: Invalid argument
Changed in gnome-shell (Ubuntu):
importance: Undecided → High
tags: added: radeon
Changed in mutter (Ubuntu):
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: [radeon] gnome-shell: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument

Also if there are any "crashes" then please follow these instructions:

https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: [amdgpu][radeon] gnome-shell: Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument

Also seen in bug 1966781.

tags: added: amdgpu
summary: - [radeon] gnome-shell: Failed to lock front buffer on /dev/dri/card1:
- drmModeAddFB2WithModifiers failed: Invalid argument
+ [amdgpu][radeon] gnome-shell: Failed to lock front buffer on
+ /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
summary: - [amdgpu][radeon] gnome-shell: Failed to lock front buffer on
- /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument
+ [amdgpu][radeon] gnome-shell Wayland sessions fail to start (Failed to
+ lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed:
+ Invalid argument)
tags: added: rls-jj-incoming
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: [amdgpu][radeon] gnome-shell Wayland sessions fail to start (Failed to lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed: Invalid argument)

I wonder if this fix (coming in 42.rc) is needed?

https://gitlab.gnome.org/GNOME/mutter/-/commit/690b8806d

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Please wait until you receive mutter version 42.0-1ubuntu1 in updates and then try adding this to /etc/environment:

  MUTTER_DEBUG_DISABLE_TRIPLE_BUFFERING=1
  MUTTER_DEBUG_USE_KMS_MODIFIERS=0

and then reboot.

If that fixes the bug then please try each line separately to identify which one has fixed it.

Changed in gnome-shell (Ubuntu):
status: Confirmed → Incomplete
Changed in mutter (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

 MUTTER_DEBUG_USE_KMS_MODIFIERS=0

fixes the issue. gdm3 also works now.

Changed in gnome-shell (Ubuntu):
status: Incomplete → New
Changed in mutter (Ubuntu):
status: Incomplete → New
Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

Thank you for the quick investigation into this. Once the patch you listed: https://gitlab.gnome.org/GNOME/mutter/-/commit/690b8806d is available, would I have to comment out the KMS_MODIFIERS line for completeness?

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

You don't need to, but we would like to know if that fix removes the need for the workaround MUTTER_DEBUG_USE_KMS_MODIFIERS=0

If you still need MUTTER_DEBUG_USE_KMS_MODIFIERS=0 after mutter 42.0-1ubuntu1 is released then we should open a new bug in https://gitlab.gnome.org/GNOME/mutter/-/issues

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Triaged
Changed in gnome-shell (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

Noted, thank you. I'll check after 42.0-1ubuntu1 is released. I am a bit unsure of this though, this is what I currently see:

$# dpkg -l|grep -i mutter
ii gir1.2-mutter-10:amd64 42~beta-1ubuntu2 amd64 GObject introspection data for Mutter
ii libmutter-10-0:amd64 42~beta-1ubuntu2 amd64 window manager library from the Mutter window manager
ii mutter-common 42~beta-1ubuntu2 all shared files for the Mutter window manager

Out of these, should I be looking at the mutter-common (or libmutter?) version to change to 42.0-1ubuntu1?

Thanks

Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

I also *just* installed mutter, as it seems there was a package that provides a mutter binary, that seems to have a similar version (42~beta-1ubuntu):

$ mutter --version
mutter 42.beta

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The middle line "libmutter-10-0" is the important one for gnome-shell, but all three of the packages shown in comment #12 need to keep the same version number to function correctly.

The package named "mutter" and the "mutter" binary are confusingly not relevant here. It's not used in Ubuntu and not installed by default.

Revision history for this message
Joseph Maillardet (jokx) wrote :

MUTTER_DEBUG_USE_KMS_MODIFIERS=0
fixes the issue for me too.
I will give a new try without this variable after update 42.0-1ubuntu1 is released.

Revision history for this message
Marian Rainer-Harbach (marianrh) wrote :

I installed 22.04 today on a machine with an AMD GPU. I have libmutter-10-0 42.0-1ubuntu1 and I still encountered the problem. Setting MUTTER_DEBUG_USE_KMS_MODIFIERS=0 is still necessary in 42.0-1ubuntu1.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Comment #16 is surprising. Can anyone else confirm?

description: updated
Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

I just tried commenting out MUTTER_DEBUG_USE_KMS_MODIFIERS=0 and get the original problem again, so the issue is still happening without the workaround.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
summary: - [amdgpu][radeon] gnome-shell Wayland sessions fail to start (Failed to
- lock front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed:
+ [radeon] gnome-shell Wayland sessions fail to start (Failed to lock
+ front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed:
Invalid argument)
tags: removed: amdgpu
summary: - [radeon] gnome-shell Wayland sessions fail to start (Failed to lock
- front buffer on /dev/dri/card1: drmModeAddFB2WithModifiers failed:
- Invalid argument)
+ [radeon] gnome-shell Wayland sessions fail to start on legacy Radeon
+ systems (Failed to lock front buffer on /dev/dri/cardN:
+ drmModeAddFB2WithModifiers failed: Invalid argument)
Revision history for this message
Joseph Maillardet (jokx) wrote :

Same for me, I steel need MUTTER_DEBUG_USE_KMS_MODIFIERS=0 to get GDM/Mutter working properly.
I attach the result of journalctl -e (during failed session), in case it can be useful ?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Upstream already know about the problem and have a plan: https://gitlab.gnome.org/GNOME/mutter/-/issues/2210

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Triaged → Fix Committed
no longer affects: gnome-shell (Ubuntu)
tags: added: fixed-in-42.1 fixed-upstream
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The fix is also coming in the next Ubuntu update:

https://salsa.debian.org/gnome-team/mutter/-/commit/c0222e9b

Revision history for this message
Joseph Maillardet (jokx) wrote :

Hello, I just upgraded to 42.0-3ubuntu1 and everything works without workaround.
Thanks !

Changed in mutter (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Prajjwal Devkota (pdinthecloud) wrote :

Also confirmed in my system now with update - no workaround required in /etc/environment now. Thank you!

Changed in mutter:
status: Unknown → Fix Released
Revision history for this message
mabovo (mabovo) wrote :

Not Running in GNOME Shell (using mutter 42.3) as a Wayland display server
Failed to setup: Could not take control: GDBus.Error:System.Error.EBUSY: Device Radeon HD 6870

Revision history for this message
mabovo (mabovo) wrote :

Kernel: 5.19.0-rc6-amd64
Intel i7-2600 (8) @ 3.800GHz XPS 8300

Revision history for this message
Mahmoud Farouk (mf-kasim) wrote :

Me as well still have the issue using libmutter 42.5

Revision history for this message
Tobias (seppeeel) wrote :

Yesterday i upgraded mutter:amd64 (42.5-0ubuntu1 to 42.9-0ubuntu1) and suddenly experienced the problem described in this thread. (black screen and logs like in #2)

After some investigation and finally finding this bug here adding
MUTTER_DEBUG_USE_KMS_MODIFIERS=0
to
/etc/environment

fixed it for me, too.
Seems like the bug was brought back somehow?

Thanks
Tobias

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That sounds like an important regression, but since this bug is closed we will need you to open a new one by running:

  ubuntu-bug mutter

and add the tag 'regression-update'. Please also attach output from 'drm_info' to the new bug.

Revision history for this message
Tobias (seppeeel) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.