Input lag or freezes on Nvidia desktops with X11 after logging "MetaSyncRing: Sync object is not ready -- were events handled properly?"

Bug #2059847 reported by Marek
474
This bug affects 78 people
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
High
Daniel van Vugt
Jammy
In Progress
High
Daniel van Vugt
Mantic
In Progress
High
Daniel van Vugt
Noble
Fix Released
High
Daniel van Vugt

Bug Description

[ Impact ]

Input or the entire screen may freeze at times on systems using the Nvidia Xorg driver with GNOME.

[ Test Plan ]

0. Set up a desktop with Nvidia driver 545 or 550.
1. Log into Ubuntu, ensuring it's a Xorg session.
2. Open a Terminal, resize it vigorously, and type several lines of text.
3. Run: journalctl -b0 | grep MetaSyncRing
4. Verify the above command does NOT show "MetaSyncRing" messages such as:

Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
Window manager warning: MetaSyncRing: Too many reboots -- disabling

[ Where problems could occur ]

Anywhere in Nvidia (proprietary driver) Xorg sessions since the code being modified is only used with that driver.

[ Original Description ]

There is a noticeable delay in input while using the native terminal. I belive it was caused by a recent software update, as this issue is relatively new.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubiquity (not installed)
ProcVersionSignature: Ubuntu 6.5.0-26.26~22.04.1-generic 6.5.13
Uname: Linux 6.5.0-26-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia wl
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Mar 30 19:57:13 2024
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash ---
InstallationDate: Installed on 2024-03-30 (0 days ago)
InstallationMedia: Ubuntu 22.04.4 LTS "Jammy Jellyfish" - Release amd64 (20240220)
SourcePackage: ubiquity
Symptom: installation
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Marek (navitelogger5547) wrote :
affects: ubuntu → ubiquity (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

This bug is filed against ubiquity, which is an installer, not a terminal. It is unclear what you mean by a "native terminal". Please elaborate.

Revision history for this message
Marek (navitelogger5547) wrote : Re: [Bug 2059847] Re: Input lag in native terminal

I am deeply sorry - I must have selected the wrong option in 'ubuntu-bug'.
I am referring to the native terminal installed on ubuntu 22.04, which for
the last few days seems to be lagging due to some latest update. There is
an input delay, noticeable, and the deleting of input text comes with a
delay, too.

sob., 30 mar 2024 o 21:25 Steve Langasek <email address hidden>
napisał(a):

> This bug is filed against ubiquity, which is an installer, not a
> terminal. It is unclear what you mean by a "native terminal". Please
> elaborate.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2059847
>
> Title:
> Input lag in native terminal
>
> Status in ubiquity package in Ubuntu:
> New
>
> Bug description:
> There is a noticeable delay in input while using the native terminal.
> I belive it was caused by a recent software update, as this issue is
> relatively new.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 22.04
> Package: ubiquity (not installed)
> ProcVersionSignature: Ubuntu 6.5.0-26.26~22.04.1-generic 6.5.13
> Uname: Linux 6.5.0-26-generic x86_64
> NonfreeKernelModules: nvidia_modeset nvidia wl
> ApportVersion: 2.20.11-0ubuntu82.5
> Architecture: amd64
> CasperMD5CheckResult: pass
> CurrentDesktop: ubuntu:GNOME
> Date: Sat Mar 30 19:57:13 2024
> InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz
> file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash ---
> InstallationDate: Installed on 2024-03-30 (0 days ago)
> InstallationMedia: Ubuntu 22.04.4 LTS "Jammy Jellyfish" - Release amd64
> (20240220)
> SourcePackage: ubiquity
> Symptom: installation
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/2059847/+subscriptions
>
>

affects: ubiquity (Ubuntu) → gnome-terminal (Ubuntu)
Revision history for this message
Marek (navitelogger5547) wrote : Re: Input lag in native terminal

I believe it is related to one of those packages:

Revision history for this message
Marek (navitelogger5547) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Seems to be reported upstream at https://gitlab.gnome.org/GNOME/mutter/-/issues/3384.

The upstream bug unfortunately also made it into Ubuntu update packages in https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2054510.

Jeremy Bícha (jbicha)
tags: added: regression-update
Changed in mutter (Ubuntu):
importance: Undecided → Critical
status: New → Triaged
Changed in mutter (Ubuntu):
importance: Critical → High
summary: - Input lag in native terminal
+ Input lag in native terminal on Nvidia with X11
tags: added: nvidia
Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
no longer affects: gnome-terminal (Ubuntu)
summary: - Input lag in native terminal on Nvidia with X11
+ Input lag in native terminal on Nvidia desktops with X11
tags: added: noble
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Input lag in native terminal on Nvidia desktops with X11

If anyone experiences problems with Wayland then please subscribe to bug 1970389 instead.

Revision history for this message
Andreas Smas (andoma) wrote :

I can confirm the issue (I am on ubuntu 22.04 nvidia + x11). gnome-terminal, emacs and similar applications was lagging. Starting an application that updated the screen continuously (such as glxgears) seems to have alleviated the problem.

Downgrading mutter to from 42.9-0ubuntu7 (which I got in the latest upgrade yesterday) to 42.0-3ubuntu2 (release, which was easy to get hold of) seems to have fixed the problem.

Revision history for this message
amirsalarsafaei (amirsalarsafaei) wrote (last edit ):

So I'm on release 23.10 kernel 6.7.10-060710-generic x11 + nvidia 545 drivers + gnome 45.2
yesterday I upgraded these packages:

2024-03-31 14:25:59 upgrade mutter-common:all 45.2-0ubuntu3 45.2-0ubuntu4
2024-03-31 14:25:59 upgrade gir1.2-mutter-13:amd64 45.2-0ubuntu3 45.2-0ubuntu4
2024-03-31 14:25:59 upgrade libmutter-13-0:amd64 45.2-0ubuntu3 45.2-0ubuntu4
2024-03-31 14:25:59 upgrade mutter-common-bin:amd64 45.2-0ubuntu3 45.2-0ubuntu4
2024-03-31 14:25:59 upgrade libpulse-mainloop-glib0:amd64 1:16.1+dfsg1-2ubuntu4 1:16.1+dfsg1-2ubuntu4.1
2024-03-31 14:25:59 upgrade libpulse0:amd64 1:16.1+dfsg1-2ubuntu4 1:16.1+dfsg1-2ubuntu4.1
2024-03-31 14:25:59 upgrade libxnvctrl0:amd64 510.47.03-0ubuntu1 550.54.14-0ubuntu1
2024-03-31 14:25:59 upgrade nvidia-settings:amd64 510.47.03-0ubuntu1 550.54.14-0ubuntu1
2024-03-31 14:25:59 upgrade snapd:amd64 2.60.4+23.10.1 2.61.3+23.10

and the bug appeared afterward unfortunately I couldn't downgrade to mutter 45.2-0ubuntu3 as it was no longer available through package manager but I downgraded my mutter to 45.0-3ubuntu3 but the issues persists. 45.0-3ubuntu3.

an interesting thing is that the gnome-console is fine but other vte based terminals have severe lag. Does anyone know how to downgrade my mutter to specific version without apt? Do I just have to build it from the git and replace it? (I'm scared of breaking my environment)

Revision history for this message
Ian Flintoft (ian-flintoft) wrote :

I am seeing similar interactivity issues on fully updated 22.04 on a Dell Precision laptop with Nvidia + X11 that started a day or so ago. Most noticeable in the terminal with lag/stuttering and seemingly lost keyboard inputs, but also affecting other apps with stuttering keyboard inputs and sometimes seemingly lost mouse clicks.

I will try downgrading mutter and suggested.....

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote (last edit ):

> [amirsalarsafaei] I downgraded my mutter to 45.0-3ubuntu3 but the issues persists

Mentioning just in case:

You should downgrade all the packages built from mutter's source that you have installed, including libmutter-13-0, mutter-common, mutter-common-bin etc. (Or at least I don't know which one really matters.)

And then you need to log out of your graphical session and log back in, otherwise the previous mutter keeps running.

I'm pointing these out because this suspected mutter change is the only relevant that has a reasonable chance of causing the issues, and multiple people have reported that downgrading fixed the issue for them, yet you report that it didn't for you. At this point we have to consider that you might have made a mistake during downgrading, rather than the bug being somewhere else.

> how to downgrade my mutter to specific version without apt?

I'd download these older packages from packages.ubuntu.com (as you presumably already did with mutter), install them with `dpkg -i`, and put them on "hold" (something like: `echo "mutter hold" | sudo dpkg --set-selections`, and repeat for the other packages).

> an interesting thing is that the gnome-console is fine but other vte based terminals have severe lag.

gnome-console uses gtk4 (and in turn the gtk4 variant of vte), others use gtk3 (and in turn the gtk3 variant of vte). (I'm just stating this as a fact. Don't ask how it triggers the bug to manifest with one but not with the other, I don't know.)

Revision history for this message
amirsalarsafaei (amirsalarsafaei) wrote :

Egmont Koblinger
Thanks for your reply after my comment I found out the issue that there is other binary that contributes and I use hold method to downgrade and now the issue is gone:D. the issue is indeed with the package I just hope they remove the buggy version as soon as possible because it is still is available on my release.

Changed in mutter:
status: Unknown → New
Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

I have similar problem. I'm currently using Ubuntu 22.04.4 LTS (x86_64). Since some days (maybe three?) I see very odd behaviour from programs running in gnome-terminal (or xfce4-terminal if it does not matter, I guess the problem is not the terminal itself but VTE probably or similar? - no problem when using KDE's Konsole for example!). I also have nvidia's driver.

Some programs "only" have very significant input delay, sometimes like 1 sec or so. However interestingly some programs (most notably neomutt) has "infinite" delay, ie, it lags behind exactly one key. For example if I move upwards in the email list, then pressing down still moves up once. And so on, it seems to be true for all keys. Other applications running in terminal seems to "only" have more significant delay, but it's not always consistent. Especially ssh'ing to a remote machine is a very bad experience now, but even on the local host, without any ssh involved just the shell, it's very notable.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
$ dpkg -l | grep mutter
ii gir1.2-mutter-10:amd64 42.9-0ubuntu7 amd64 GObject introspection data for Mutter
ii libmutter-10-0:amd64 42.9-0ubuntu7 amd64 window manager library from the Mutter window manager
ii mutter-common 42.9-0ubuntu7 all shared files for the Mutter window manager

Changed in mutter (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It appears this is a recurrence of bug 1912246.

Revision history for this message
Charlie Page (lissom) wrote :

Same issue, I've noticed something very strange. If the below lines are commented out, the lag takes a few minutes to kick in (vs immediately when not commented out).
edit /usr/lib/udev/rules.d/61-gdm.rules
comment out the 2 lines:
RUN+="/usr/libexec/gdm-runtime-config set daemon PreferredDisplayServer xorg"
RUN+="/usr/libexec/gdm-runtime-config set daemon WaylandEnable false"
As a side note, Wayland does not well work for me, however, /etc/gdm3/custom.conf forces x11.
i.e.
echo $XDG_SESSION_TYPE
x11

Revision history for this message
Cristiano Fraga G. Nunes (cfgnunes) wrote (last edit ):

I'm experiencing the same issue. Lag persists across gnome-terminal, gnome-console (kgx), and terminator (all of which are based on VTE). To keep productivity up, I've switched to xterm until the bug is resolved.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

$ dpkg -l | grep "mutter" | tr -s " " | cut -d " " -f 1-3
ii gir1.2-mutter-10:amd64 42.9-0ubuntu7
ii libmutter-10-0:amd64 42.9-0ubuntu7
ii mutter-common 42.9-0ubuntu7

$ dpkg -l | grep " nvidia-" | tr -s " " | cut -d " " -f 1-3
ii linux-modules-nvidia-535-generic-hwe-22.04 6.5.0-26.26~22.04.1
ii nvidia-compute-utils-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-driver-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-firmware-535-535.161.07 535.161.07-0ubuntu0.22.04.1
ii nvidia-kernel-common-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-kernel-source-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-prime 0.8.17.1
ii nvidia-settings 510.47.03-0ubuntu1
ii nvidia-utils-535 535.161.07-0ubuntu0.22.04.1

Revision history for this message
Cristiano Fraga G. Nunes (cfgnunes) wrote (last edit ):

I've found a workaround:

I conducted a fresh installation of Ubuntu 22.04.4 and subsequently marked specific packages for holding using the following commands:

$ sudo apt-mark hold gir1.2-mutter-10
$ sudo apt-mark hold libmutter-10-0
$ sudo apt-mark hold mutter-common

Following this, I proceeded to update all packages.
So, I'm currently utilizing version "42.9-0ubuntu5" of the mutter packages, instead of version "42.9-0ubuntu7."

Now, my system is with packages:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

$ dpkg -l | grep "mutter" | tr -s " " | cut -d " " -f 1-3
hi gir1.2-mutter-10:amd64 42.9-0ubuntu5
hi libmutter-10-0:amd64 42.9-0ubuntu5
hi mutter-common 42.9-0ubuntu5

$ dpkg -l | grep " nvidia-" | tr -s " " | cut -d " " -f 1-3
ii linux-modules-nvidia-535-generic-hwe-22.04 6.5.0-26.26~22.04.1
ii nvidia-compute-utils-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-driver-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-firmware-535-535.161.07 535.161.07-0ubuntu0.22.04.1
ii nvidia-kernel-common-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-kernel-source-535 535.161.07-0ubuntu0.22.04.1
ii nvidia-prime 0.8.17.1
ii nvidia-settings 510.47.03-0ubuntu1
ii nvidia-utils-535 535.161.07-0ubuntu0.22.04.1

Revision history for this message
Mikael Wikman (mikabytes) wrote :

No need to reinstall the OS. I've posted a script for downgrading mutter packages for Ubuntu 23.10, 23.04, and 22.04 here:
https://askubuntu.com/a/1509288/96411

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

I've fetched some older versions (again, I am running 22.04.4) of packages gir1.2-mutter-10 libmutter-10-0 and mutter-common and made them into hold status. After a very ugly and dangerous move, namely editing /var/lib/dpkg/status by hand (to comply the dependencies of gnome-shell which was broken by forcing older versions of packages ... maybe I should have simply installed also older version of gnome-shell, hmm ...), now everything works perfectly again.

Revision history for this message
Cristiano Fraga G. Nunes (cfgnunes) wrote :

Based on mikabytes's answer, I've found another solution that not will not leave apt in a temporary broken state. For Ubuntu 22.04.4:

Download the packages:
$ wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/gir1.2-mutter-10_42.9-0ubuntu5_amd64.deb
$ wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/libmutter-10-0_42.9-0ubuntu5_amd64.deb
$ wget -nc https://launchpad.net/ubuntu/+source/mutter/42.9-0ubuntu5/+build/26711789/+files/mutter-common_42.9-0ubuntu5_all.deb

Install the packages:
$ sudo dpkg -i *mutter*.deb

Mark as hold:
$ sudo apt-mark hold gir1.2-mutter-10
$ sudo apt-mark hold libmutter-10-0
$ sudo apt-mark hold mutter-common

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

@ Daniel van Vugt,

The faulty change has a timestamp of 22 Feb, and the package began to arrive at users probably on 29 Mar. That's a difference of 5 weeks.

I'm not familiar with Ubuntu's internal procedures, I don't know how things work, which component (e.g. building packages, QA, somewhat wider testing in -proposed etc.) took how long, but overall 5 weeks is pretty long.

As I understand from comments in upstream mutter#3384, it's not immediately obvious to you guys what and why exactly goes wrong and how to properly fix all this. It needs investigation first.

This means that my rough guess is that, if everything goes well, it could take maybe 1-2 weeks to develop a fix and another 5 weeks for the regular release prodecure?

Do you have any wild estimate on how many people were affected by the old bug that this update fixed, and how many are affected by the new one? The old one seems to be about software rendering, i.e. when running inside a virtual machine. The new one seems to affect people using an NVidia video card with its proprietary driver. Sounds to me that the new issue probably affects way more people.

I'm wondering: Is there some guideline, best practice, runbook rule etc. describing how to handle such a situation? If so, what does it say?

Wouldn't the right thing be to release new updated packages that revert this change ASAP (like, in a day or two at most, skipping QA and -proposed etc.), and then start to work on the proper fix that fixes both issues at the same time?

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

The old issue could possibly affect more people because it was for a large commercial partner. Maybe, maybe not. But we don't need to pick and choose which is more important when we can fix everyone's bugs without reverting anything.

I proposed two fixes for this Nvidia bug yesterday:

  https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3685
  https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3684

and I intend to make a PPA available with a fix in the next day or so. That way no one is waiting for the slow process of getting an official update released.

summary: - Input lag in native terminal on Nvidia desktops with X11
+ Input lag on Nvidia desktops with X11
Changed in mutter (Ubuntu):
milestone: none → ubuntu-24.04-beta
Changed in mutter (Ubuntu Jammy):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Mantic):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mutter (Ubuntu Jammy):
importance: Undecided → High
Changed in mutter (Ubuntu Mantic):
importance: Undecided → High
Changed in mutter (Ubuntu Jammy):
status: New → Triaged
Changed in mutter (Ubuntu Mantic):
status: New → Triaged
description: updated
summary: - Input lag on Nvidia desktops with X11
+ Input lag or freezes on Nvidia desktops with X11
Revision history for this message
Filip M (nine-bit-nails) wrote : Re: Input lag or freezes on Nvidia desktops with X11

This one really affects my productivity. It's not only terminal it's also slack and some other apps.
Looking forward to @Daniel's PPA.
This also raises a question of testing upstream packages by Ubuntu team, as clearly this wasn't tested in all possible usage cases. I understand not everything can be tested in depth, but a bug of this magnitude needs to be triaged ASAP and not in weeks time frame. It's bad for enterprise users, and it's bad for all the newcomers. We decade old Ubuntu users are kinda used to this situations, not happy but used to it.

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

This bug was properly triaged one day after it was submitted. On a weekend and public holiday even.

The proposed fix is ready for testing on 22.04:
https://launchpad.net/~vanvugt/+archive/ubuntu/mutter

Unfortunately 23.10 is having issues with flaky test cases so hasn't been published yet.

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

And no I don't think we ever had much chance of catching this in early testing, because:

* I didn't know some of the code being moved is only used on Nvidia.

* Even after I started testing Nvidia in response to this bug and developing a fix, the problem is very subtle for me. Almost imperceptible other than the log messages. So I would not have noticed it as a bug myself.

* No one on the team who does use Nvidia has mentioned it to me yet.

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

Test fixes now published for both 22.04 and 23.10:

https://launchpad.net/~vanvugt/+archive/ubuntu/mutter

Revision history for this message
Mikael Wikman (mikabytes) wrote :

Amazing work @vanvugt, and thank you for the speedy update, holidays, and all. The fix is working great on my 23.10 system.

Is there any chance we might see a fix for 23.04 as well?

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

No 23.04 won't get a fix and also shouldn't have the bug, because it reached end-of-life in January;

  https://wiki.ubuntu.com/Releases

That said, I've seen evidence that there might be other ways to trigger similar issues on Nvidia so it's possible other releases could get into a similar state and need the same fix. But for now the only supported releases that definitely contain the bug are 22.04 and 23.10.

Revision history for this message
Mikael Wikman (mikabytes) wrote :

Great! Thank you for the information.

Revision history for this message
Filip M (nine-bit-nails) wrote :

Should we remove the ppa after the official packages are released?

Revision history for this message
Tais P. Hansen (taisph) wrote :

I can confirm the lag is gone on my 23.10 system using X11 with nvidia-driver-550 when using the PPA packages.

Thank you!

Revision history for this message
Marek (navitelogger5547) wrote :

To get rid of the terminal slowness, what should I do?

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

> Should we remove the ppa after the official packages are released?

When a higher official version number is available from the archive, your system should automatically start using that. So this particular PPA is harmless to keep active but that's not true for all PPAs.

You should still remove the PPA when you no longer need it because it will raise some annoying flags from bots if you try to report new Ubuntu bugs while using a PPA.

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

> To get rid of the terminal slowness, what should I do?

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade

and reboot should be enough.

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote (last edit ):

Probably not related, but "nvidia-driver-535" was mentioned above in a post. I'm now using ppa:vanvugt/mutter and it seems to be fine, but apt also upgraded nvidia driver from 525 to 535 (maybe not related at all just the new nvidia driver was presented now?). Since then I have hard lock-ups on my system what I've never seen before (no keyboard and mouse works). After forced power-off I see this in the kernel log file:

Apr 5 15:42:57 rygel kernel: [ 3282.354685] NVRM: GPU at PCI:0000:01:00: GPU-78091d7e-2007-c450-19a1-f764cae07b00
Apr 5 15:42:57 rygel kernel: [ 3282.354689] NVRM: Xid (PCI:0000:01:00): 79, pid='<unknown>', name=<unknown>, GPU has fallen off the bus.
Apr 5 15:42:57 rygel kernel: [ 3282.354691] NVRM: GPU 0000:01:00.0: GPU has fallen off the bus.
Apr 5 15:42:57 rygel kernel: [ 3282.354730] NVRM: A GPU crash dump has been created. If possible, please run
Apr 5 15:42:57 rygel kernel: [ 3282.354730] NVRM: nvidia-bug-report.sh as root to collect this data before
Apr 5 15:42:57 rygel kernel: [ 3282.354730] NVRM: the NVIDIA kernel module is unloaded.
Apr 5 15:43:02 rygel kernel: [ 3287.474709] NVRM: Error in service of callback
Apr 5 15:48:05 rygel kernel: [ 3590.071558] Asynchronous wait on fence NVIDIA:nvidia.prime:11cbb timed out (hint:intel_atomic_commit_ready [i915])

I've never seen anything similar before, though I have this very system/install with nvidia's driver since more than a year or so. Since it's probably a totally different issue (though I am not 100% sure), I've reported here: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-535/+bug/2060303

It seems now this hard lock up occurs several times per day :( Though the terminal slowness/keyboard input lag/etc is gone, which is good, of course!

Revision history for this message
Andrew Fernandes (andrew-fernandes) wrote :

Daniel (@vanvugt) Thank you very much for your hard work, out-of-band patch (the ppa!), and speed addressing this extremely subtle, yet annoying bug... much appreciated!

Changed in mutter:
status: New → Fix Released
Revision history for this message
Nathan Bryant (nbryant42) wrote :

The fix in the PPA is not working for me on Jammy: the lag may be gone, but some rendering is intermittently missed.

Some info:

linux-image-6.5.0-27-generic 6.5.0-27.28~22.04.1
nvidia-driver-550 550.67-0ubuntu1.22.04.1

Maybe related in journalctl:

Apr 06 09:47:33 alphasite gnome-shell[2505]: Can't update stage views actor <unnamed>[<MetaWindowGroup>:0x5b2bd9670320] is on because it needs an allocation.
Apr 06 09:47:33 alphasite gnome-shell[2505]: Can't update stage views actor <unnamed>[<MetaWindowActorX11>:0x5b2bdb6eb320] is on because it needs an allocation.
Apr 06 09:47:33 alphasite gnome-shell[2505]: Can't update stage views actor <unnamed>[<MetaSurfaceActorX11>:0x5b2bdb6eea60] is on because it needs an allocation.

I think something similar was happening on nvidia-driver-535; I upgraded to 550 in an attempt to fix this.

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

Comment #37 needs a new bug report please. It looks like hybrid GPUs?

Comment #39 should be discussed in bug 2007742. Not here.

Changed in mutter (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: fixed-in-mutter-46.1 fixed-upstream
Revision history for this message
Tais P. Hansen (taisph) wrote :

I can also confirm the lag is gone on my 22.04 laptop using X11 with nvidia-driver-550 when using the PPA packages.

Thanks!

Changed in mutter (Ubuntu Jammy):
status: Triaged → In Progress
Changed in mutter (Ubuntu Mantic):
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Here's the debdiff for jammy.

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

And here's the debdiff for mantic.

Revision history for this message
Nathan Bryant (nbryant42) wrote :

Everyone's been discussing bug 2007742 as something that causes only log spam, no other issues. My system is still failing to update the screen after keypresses in gnome-terminal. So maybe those log messages aren't relevant, but it looks like this bug 2059847 is not fully & correctly fixed.

Revision history for this message
threadbareobserve (threadbareobserve1234) wrote :

> sudo add-apt-repository ppa:vanvugt/mutter
> sudo apt update
> sudo apt upgrade

I have done the following above but still having lagging issues. Although the lag appears to be much better in the terminal window. But every other window it's quite apparent after a few minutes of using the OS after a reboot.

My Setup
- 2 monitor driven by NVIDIA (`GA104M [GeForce RTX 3070 Mobile / Max-Q]) running driver `server-open::550.54.14`
- 1 laptop screen driven by Intel graphics (`TigerLake-H GT1 [UHD Graphics`)

Revision history for this message
threadbareobserve (threadbareobserve1234) wrote :

I have no reverted back to downgrading mutter as per previous posted and lag has subsided however I can't use NVIDIA 550 driver with the old mutter for some reason so I am stuck using intel graphics which doesn't do a great job driving all 3 screens I have. NVIDA not downgrading is a different issue though mover the freezing/lagging still exist even though mutter was fixed.

Revision history for this message
Nathan Bryant (nbryant42) wrote :

threadbareobserve, the nvidia driver can be downgraded to 535 without too much work. I'd make sure all the related packages are removed before installing 535.

Might help the developers to know what version of Ubuntu you're running.

I'm running a 22.04 desktop with a 4070 card, and the PPA does *not* fix the problem for me. It removes the lag, but that means the corrupted screen just happens faster. This is a bit intermittent and hard to pin down, but I've particularly noticed this after attempting to paste text into Gnome-Terminal; only the first few pasted characters might be echoed, then it gets into a state where keyboard input is processed but not all of it is echoed.

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

Are the unresolved issues only occurring with multi-monitor or multi-GPU systems?

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

Nathan, if you experience corruption then please see bug 1876632.

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

I've now tested everything I can reasonably test:
  - Nvidia 545
  - Nvidia 550
  - Nvidia-only, single monitor
  - Nvidia-only, dual monitors
  - Nvidia+Intel hybrid, one monitor each

Confirmed the bug occurs in Nvidia-only configurations when the fix is not present. And confirmed the bug does not occur in any configurations when the fix is present.

So I suspect threadbareobserve is experiencing a different issue. Maybe using Wayland instead of X11?

P.S. Nathan, please report your "corrupted screen" in a new bug if it is not already covered by bug 1876632.

Changed in mutter (Ubuntu Noble):
milestone: ubuntu-24.04-beta → ubuntu-24.04
Revision history for this message
Nathan Bryant (nbryant42) wrote :

Hi Daniel,

No, not multi-GPU. It's an AMD system with no integrated graphics and only one Nvidia card. One monitor plugged in, one TV plugged in to that card via HDMI. But the TV is usually turned off, and disabled in Settings | Displays. Running Xorg, not Wayland.

This doesn't look like bug 1876632; it's not suspend- or VT-switch-related. Maybe I shouldn't have called it "corruption"; what I'm seeing looks like gnome-terminal just... deciding not to render something that it should; characters don't echo. No wild colors or randomized textures or anything like that. Seems like either a problem within gnome-terminal, or GPU command buffers just getting dropped on the floor. Awfully similar to this bug.

Revision history for this message
Nathan Bryant (nbryant42) wrote :

Dropped all the `savoury1` PPAs from my system and will keep an eye on this to see if I can find a way to reproduce it.

Revision history for this message
threadbareobserve (threadbareobserve1234) wrote :

- Ubuntu 22.04.4 LTS (5.15.0-56-generic)
- I am using X11 when nvidia driver is in use.
    - Checked via observing `XDG_SESSION_TYPE` variable
- I am using on-demand feature for nvidia but switching to performance mode only does not help.

My primary issue is keyboard input lag. It is not as bad as it used to be but it exist.
- I notice it in terminal window and vscode as these are the applications I use mostly
- Sometimes it take a few minutes to appear after a reboot sometimes it appears right away.

Other than the keyboard input lag I notice some lagging when scrolling in Chrome. However this is less apparent.

I can't downgrade nvidia driver, this is likely an unrelated to this bug though.
- Debian package manager just install nvidia 550 regardless of the package I choose.
- `ubuntu-driver` think drivers are already installed if I try to install a specific version.
- `ubuntu-driver` autoinstall/install just install 550

Revision history for this message
Nathan Bryant (nbryant42) wrote :

Upstream Gnome 46 made a lot of changes recently to improve performance and input lag in Gnome-Terminal. Those changes are separate from this bug. I don't know whether those changes were backported to Ubuntu 22.04, which ships Gnome 42. That's a question for Daniel or someone else at Canonical.

See https://bxt.rs/blog/just-how-much-faster-are-the-gnome-46-terminals/ and note that the graphs are only talking about lag in the neighborhood of 40-50ms, which is probably just barely perceptible.

Revision history for this message
threadbareobserve (threadbareobserve1234) wrote :

I wasn't having any issue until I did a software update about 2 weeks back when this issue starting appearing for others. I am slowly accepting that I need to wipe my system and spend a day setting up my dev environment it is frustrating but this lag is killing my productivity.

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

See also bug 1777708 for those using multiple keyboards or other input devices.

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

I'd like to resolve any confusion from the last 10 comments or so. This bug is only for people who have "MetaSyncRing" messages in their system log:

  journalctl -b0 | grep MetaSyncRing

like:

  Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
  Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
  Window manager warning: MetaSyncRing: Sync object is not ready -- were events handled properly?
  Window manager warning: MetaSyncRing: Too many reboots -- disabling

If you don't have any MetaSyncRing messages then please open new bugs.

summary: - Input lag or freezes on Nvidia desktops with X11
+ Input lag or freezes on Nvidia desktops with X11 after logging
+ "MetaSyncRing: Sync object is not ready -- were events handled
+ properly?"
description: updated
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> Upstream Gnome 46 made a lot of changes recently to improve performance and input lag in Gnome-Terminal. Those changes are separate from this bug.

Exactly.

> I don't know whether those changes were backported to Ubuntu 22.04, which ships Gnome 42.

They weren't, and almost certainly won't be.

> the graphs are only talking about lag in the neighborhood of 40-50ms, which is probably just barely perceptible.

Exactly. If anyone's having latency problems big enough that make them follow this bug and try mutter packages from a PPA, then upgrading the terminal won't fix them.

Revision history for this message
Thierry MACHICOANE (thierry-on-ubuntu) wrote :

Running "journalctl -b0 | grep MetaSyncRing", I confirm having this bug, which appeared roughly 2 w-ago after classical update.

This implies lack of responsiveness (up to 2 seconds lags) in terminal as well as in GUI, especially when dragging objects, scrolling, double-clicking and so on.

Configuration:
 * 6.5.0-27-generic #28~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 15 10:51:06 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
 * NVIDIA-SMI 535.161.07

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

Everyone should also pay attention to the date and time shown in the output from 'journalctl -b0 | grep MetaSyncRing'. If you have installed the PPA then we only care about timestamps after the PPA was installed and after you logged in again to apply the change.

Changed in mutter (Ubuntu Jammy):
status: In Progress → Fix Released
Changed in mutter (Ubuntu Jammy):
status: Fix Released → In Progress
Revision history for this message
gazhay (gazhay) wrote :

Came here to say that either there is another bug than the "MetaSyncRing" bug or that is not a clear indicator of this bug.

Like others I had upgraded a couple of days ago and had horrible stutter in vte based terminals, other apps were fine. Wayland resolved the issue, but there are huge problems with Wayland in other ways so back to x11 I had to go.

Installed the ppa from Daniel (vanvugt) with the versions of mutter there and all problems have ceased.

But to re-itterate, I never had MetaSyncRing issues in any logs.

Just wanted to say thanks though, a very speedy fix from Daniel on something which was impacting daily usability. Top work.

Revision history for this message
threadbareobserve (threadbareobserve1234) wrote :

@gazhay
`
I agree. The input lag has not been fixed I am using X11 I don't even know what `MetaSyncRing` is I don't have any these logs.

I've tried various NVIDIA drivers with no luck.

After a reboot it seems ok but over time it quickly starts to lag much more.

Revision history for this message
Nickson Kaigi (nickaigi) wrote :

@vanvugt

I can confirm that the ppa solves the input lag on my system:

Ubuntu 22.04.4 LTS, using X11 and NVIDIA Driver Version: 525.147.05

Thank you.

Revision history for this message
JK (m0d) wrote :

Just want to add that the bug also affects GnuCash and basically makes it unusable. The updated mutter from the PPA fixed it.

Ubuntu 22.04, Xorg and NVidia 535.171.04.

Revision history for this message
Cristiano Fraga G. Nunes (cfgnunes) wrote :

Hello Daniel van Vugt (@vanvugt)!

Would you mind applying your latest patches to your PPA? So we can test the new packages.

- mutter_42.9-0ubuntu8.debdiff
- mutter_45.2-0ubuntu5.debdiff

Thanks,

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

There are no more "latest patches". The PPA is already the latest as it contains the same fix as 42.9-0ubuntu8 and 45.2-0ubuntu5 will.

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

@vanvugt

I can confirm that the ppa solves the input lag on my system:

Ubuntu 22.04.4 LTS, using X11/GNOME and NVIDIA Driver Version: 535.147.05

Thank you.

Revision history for this message
Donn Ingle (donn-ingle) wrote :

Will this fix come out for 22.04.04 LTS ?

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

The fix will come as an automatic update in future.

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

On second thoughts, 46.1 might not make it into the main release so let's patch this in for Noble.

Changed in mutter (Ubuntu Noble):
status: Fix Committed → In Progress
Revision history for this message
Robin Bonicel (rbonicel) wrote (last edit ):

I opened a similar bug and @vanvugt advised me to come here.
I do have the MetaSyncRing messages that pop up in the journalctl command, so my bug indeed relates
I read everything and will try the PPA if need be.

But I'm using a driver that nobody mentioned, which was selected by Dell who assembled the machine and installed the OS.
On Nvidia driver section, I'm using "Set the power ondemand mode by default from oem-fix-gfx-nvidia-ondemandmode". I also have drives 535 and 470 available in the menu, but when I install them, my default setting disappears. I had to fully reinstall the OS to get it back. Nvidia themselves advise on their download page to not necessarily use their proprietary drivers on some Linux distribs, so I stuck with my default driver.

Will the PPA and the mutter downgrade be of use with this default setting ?
Also, installing proprietary pilot from the Software & update menu raised an error, so I aborted the process.

I'm running :

- Ubuntu 22.4.04 LTS
- GNOME 42.9 (latest official update)
- X11
- NVIDIA T400 4GB

Thank you

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

The Nvidia driver version and Mutter version are unrelated to each other so that doesn't sound like a problem.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mutter (Ubuntu Noble):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 46.0-1ubuntu7

---------------
mutter (46.0-1ubuntu7) noble; urgency=medium

  [ Daniel van Vugt ]
  * debian/control: mutter-common now breaks libmutter back to focal.
    Because we have dropped X11 fractional scaling support for now,
    `org.gnome.mutter.x11.gschema.xml` is no longer shipped and those
    older versions of libmutter will fail to start(LP: #2060423)
  * Add compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch
    to fix lag and freezes on the Nvidia Xorg driver (LP: #2059847)

 -- Jeremy Bícha <email address hidden> Tue, 16 Apr 2024 08:46:54 -0400

Changed in mutter (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Donn Ingle (donn-ingle) wrote :

$apt update .. etc.
$apt search mutter ...
mutter/jammy-updates,now 42.9-0ubuntu7 amd64 [installed,automatic]
  Example window manager using GNOME's window manager library

Seems I have "42.9". How do I get the new 46.0 release on Ubuntu 22.4.04 LTS?

Thanks!

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

> How do I get the new 46.0 release on Ubuntu 22.4.04 LTS?

You don't. Please use this instead:

https://launchpad.net/~vanvugt/+archive/ubuntu/mutter

Revision history for this message
Donn Ingle (donn-ingle) wrote :

Thanks. Things feel better now.

Revision history for this message
Brad Jascob (bjascob) wrote :

This does appear to fix the issue for me on 22.4.04 LTS

sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
Then upgrade mutter-common, libmutter-10-0 and gir1.1-mutter-10 (I'm not certain if all 3 of these are required or not).
This will get you version 42.9-0ubuntu7
Reboot !! (required)

Revision history for this message
Slobodan Pavlic (guybrush77) wrote :

Hello Daniel,

Thank you so much for your hard work. I can confirm that, with your fix, my machine is back to its usual snappy self.

OS:

Ubuntu 22.04.4 LTS
Gnome Version: 42.9
X11
Nvidia Driver 535.171.04

Hardware:

Lenovo ThinkPad P15 Gen 1
NVIDIA Corporation TU117GLM [Quadro T1000 Mobile]

Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

Just as a datapoint, the PPA has resolved my lag issues on my Nvidia/xorg setup.

Thanks!

Details:

Ubuntu 22.04.4 LTS

modinfo nvidia
...
version: 535.171.04

I had those `MetaSyncRing: Sync object is not ready -- were events handled properly?` journal entries as well, and did not reappear after PPA upgrade

Revision history for this message
Sergio Belevskij (sergiobelevskij) wrote :

This does appear to fix the issue for me on 23.10

```
sudo add-apt-repository ppa:vanvugt/mutter
sudo apt update
sudo apt upgrade
sudo shutdown -R now
```

Thanks a lot for this fix!

Revision history for this message
Peter Ryan (peterx14) wrote :

Thanks - this fix appears to have resolved my lag issues.

OS: Ubuntu 22.04.04 LTS
$XDG_SESSION_TYPE: x11
nVidia: 535.171.04

Mobo/CPU: MSI MAG B550M BAZOOKA / AMD Ryzen 5 5600X
Video card: MSI GeForce GT1030 2GB PCI Express

Mostly this was affecting Gnome terminal for me, but just prior to applying this patch (thanks again!!) I used GnuCash and that lagged too.

Revision history for this message
Marsh (marsh) wrote :

I have been experiencing this problem since I updated on 4/22, been away. After the update gnome-term is very slow to echo.

Dpkg:
||/ Name Version Architecture Description
+++-====================-=============-============-===========================>
ii libmutter-10-0:amd64 42.9-0ubuntu7 amd64 window manager library from>
in libmutter-14-0 <none> amd64 (no description available)

Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

Nvidia version 535.171.04

The PPA referred to in previous posts as a potential fix seems to have done the trick.

Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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