Score:0

Desktop "freezing" on Kubuntu 22.04 LTS

tz flag

I have three Dell laptops, all running Kubuntu 22.04 LTS. Two are Precision 5530's and one is a slightly older Precision 5520. The KDE desktop "freezes" on all three within about 1 to 2 days of use, after which I can ssh into the machine to check the logs and reboot it.

To try to isolate the cause, on one of the 5530's I upgraded the kernel from 5.15.0 to 5.19.17, but that didn't help. I also installed and ran with Wayland instead of Xorg, but that didn't help either. In all variants on all machines, dmesg shows errors like this (and some other errors too):

[17732.600620] i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe A (start=840731 end=840732) time 1273 us, min 1073, max 1079, scanline start 1016, end 1103

but I've no idea if they are pointing to the cause of the problem.

I described the problem as "freezing", but when running Xorg what actually happens is that all the windows lose their borders and nothing responds to mouse clicks (although I can still move the mouse cursor). When running Wayland all the windows disappear entirely so that I'm left with just the KDE panel and, again, the system stops responding to mouse clicks.

By the way, until very recently I used to run CentOS 7 on the 5520, and it ran flawlessly, so I don't think the current problem is caused by the hardware.

Does anyone have any suggestions on how I could track down and fix the problem whilst still running Kubuntu 22.04 LTS.

Edit on 2023-03-10:

@popey's suggestion of adding intel_idle.max_cstate=1 to GRUB_CMDLINE_LINUX_DEFAULT didn't work for me. My machine failed again after about 2 days of uptime. I was running kernel 5.19.17 and Xorg (not Wayland). All the windows lost their boarders and, although I could move the mouse cursor, the system was unresponsive to mouse clicks.

Here is the relevant output from journalctl:

2023-03-10T00:52:48+0000 bat dbus-daemon[873]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.10' (uid=0 pid=875 comm="/usr/sbin/NetworkManager --no-daemon ")
2023-03-10T00:52:49+0000 bat systemd[1]: Starting Network Manager Script Dispatcher Service...
2023-03-10T00:52:49+0000 bat dbus-daemon[873]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
2023-03-10T00:52:49+0000 bat systemd[1]: Started Network Manager Script Dispatcher Service.
2023-03-10T00:52:54+0000 bat wpa_supplicant[910]: wlp59s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-66 noise=9999 txrate=130000
2023-03-10T00:52:59+0000 bat systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
2023-03-10T00:53:01+0000 bat wpa_supplicant[910]: wlp59s0: CTRL-EVENT-BEACON-LOSS
2023-03-10T01:14:51+0000 bat systemd[1435]: Started Brave Web Browser - Web Browser.
2023-03-10T01:14:52+0000 bat vncserver-x11-serviced[2795]: X Error of failed request:  BadWindow (invalid Window parameter)
2023-03-10T01:14:52+0000 bat vncserver-x11-serviced[2795]:   Major opcode of failed request:  2 (X_ChangeWindowAttributes)
2023-03-10T01:14:52+0000 bat vncserver-x11-serviced[2795]:   Resource id in failed request:  0x1000013
2023-03-10T01:14:52+0000 bat vncserver-x11-serviced[2795]:   Serial number of failed request:  2279
2023-03-10T01:14:52+0000 bat vncserver-x11-serviced[2795]:   Current serial number in output stream:  2281
2023-03-10T01:14:54+0000 bat vncserverui[388941]: Unable to locate theme engine in module_path: "adwaita",

# Machine failed around here

2023-03-10T01:17:01+0000 bat CRON[389377]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
2023-03-10T01:17:01+0000 bat CRON[389378]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
2023-03-10T01:17:01+0000 bat CRON[389377]: pam_unix(cron:session): session closed for user root
2023-03-10T01:17:41+0000 bat sshd[389505]: pam_unix(sshd:session): session opened for user xxxxx(uid=1000) by (uid=0)
2023-03-10T01:17:41+0000 bat systemd-logind[906]: New session 94 of user xxxxx.
2023-03-10T01:17:41+0000 bat systemd[1]: Started Session 94 of User xxxxx.
2023-03-10T01:17:44+0000 bat sudo[389648]:   xxxxx : TTY=pts/32 ; PWD=/home/xxxxx ; USER=root ; COMMAND=/usr/bin/su -l
2023-03-10T01:17:44+0000 bat sudo[389648]: pam_unix(sudo:session): session opened for user root(uid=0) by xxxxx(uid=1000)
2023-03-10T01:17:44+0000 bat su[389650]: (to root) root on pts/33
2023-03-10T01:17:44+0000 bat su[389650]: pam_unix(su-l:session): session opened for user root(uid=0) by xxxxx(uid=0)
2023-03-10T01:18:24+0000 bat dbus-daemon[873]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.57' (uid=1000 pid=1799 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev") (using servicehelper)
2023-03-10T01:18:24+0000 bat dbus-daemon[873]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'

I don't see anything in the logs that is helpful. The message, just prior to the problem, about

Unable to locate theme engine in module_path: "adwaita"

had already occurred 58 times in the logs, so it's unlikely to be associated with the problem.

Edit on 2023-03-22:

@Sevinnex's suggestion of KDE > System Settings > Display and Monitor > Compositor > Enable on startup: off didn't work for me.

I considered entering a bug against KDE because my KDE panel stops updating (e.g., the clock doesn't update the time), but to submit a bug on the KDE Bug Tracker requires knowledge of the precise KDE component and a way to reproduce the bug.  I have neither.  It's pretty bad that I have three different machines, all requiring a reboot every few days when the desktop becomes unresponsive to mouse clicks, and no useful information is being reports by journalctl.

The machine has the following two graphics cards (from lspci):

00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
01:00.0 3D controller: NVIDIA Corporation GP107GLM [Quadro P1000 Mobile] (rev a1)

Could the problem be something to do with those? I don't know what else to try, so I'd be very grateful for any suggestions.

Edit on 2023-04-05:

I've switched to using Xfce instead of KDE Plasma. It's a shame as the latter is by far my preferred desktop environment.

Edit on 2023-04-13:

I've now been running Xfce for 10 days with no problems, so I'm pretty sure the issues discussed above are problems with the version of KDE Plasma that's shipped with Kubuntu 22.04 LTS.

Edit on 2023-06-03:

Based on @TruismsHounds suggestion below, I've been running Plasma on Kubuntu 23.04 for 26 days without any problems.

waltinator avatar
it flag
System "freezes" are often caused by running too many, too large programs and running out of available memory. Use `free` to see if you have swap space, read `man mkswap swapon fstab fallocate` to create some. Swap space must be contiguous. use `mkswap` or `fallocate`, not `dd`. Traditionally, swap space of 1.5 × RAM has been recommended, but YMMV. If you don't plan to hibernate your system, you can have less than 1.0 × RAM.
waltinator avatar
it flag
Look at your logs with `journalctl` - read `man journalctl`. It combines all the logs, so you don't have to guess which log, offers many ways of selecting log entries, and more. `journalctl` is the modern tool, replacing `cat /var/log/*.log`
Paul avatar
tz flag
@waltinator, thanks for your comment, but I don't think its a memory problem as each machine has 32 GB of RAM and 16 GB of swap, and the machines freeze with low RAM usage (I monitor these continuously with `xosview`).
Paul avatar
tz flag
@waltinator, I shall monitor logs with `journalctl`, which I didn't previously know about, thanks.
Solrak Rainbowarrior avatar
ph flag
I'm having the same problem since a few days, but I'm on Kubuntu 20.04. The Desktop freezes when it starts. Lenovo Legion i5 Pro. 32Gb RAM. What I'm doing is restarting it: Alt+Space key and "reboot" + enter.
nicocorvo avatar
il flag
i'm facing also the same issue, and is really frustrating. I was noticing that seems to have started once i subscribed to UbuntuPro, might be something with the background updates? Pc Specs: Dell Precision with Intel i7-1280P and integrated graphics. Kubuntu 22.04. No high usage or other signs. Mouse stop clicking and i cannot switch applications/windows. Still able to use Yakuake to reboot. No apparent errors in the logs either.
Aaron avatar
sr flag
It won't let me post an answer because I don't have high enough reputation for this "highly active question". I believe this is an issue with MESA 22.2.x. It can be resolved by upgrading to MESA 22.3.0 or later. See: https://askubuntu.com/a/1463322/702934 https://bugs.launchpad.net/ubuntu/+source/kwin/+bug/2018671
Paul avatar
tz flag
@TruismsHounds, thanks very much for the info. I'll test if I still have the problem with Kubuntu 23.04 (which uses MESA 23.0.2).
in flag
I've been experiencing similar freezes as the described about daily for a time. It have seemed to be quite regular although I haven't measured it. This week however it seems like something has been fixed. Has anybody else experienced the same?
Paul avatar
tz flag
Hello @thoredge, I see that new MESA packages were made available just over a week ago, so I guess it's possible.  However, I've not tested them as I switched to using Plasma on Kubuntu 23.04 or using Xfce on Kubuntu 22.04, both of which run fine.
Score:0
pt flag

I restart sddm, without rebooting, when this bug occurs but didn't find out where it comes from... Another workaround is to switch to tty2 and Xorg back, the KDE main bar is still frozen yet the whole desktop seems to work.

Paul avatar
tz flag
The problem happened again just now, but restarting sddm (using `systemctl restart sddm`) was functionally equivalent to logging out in terms of my workflow.  What happened this time was that all my windows lost their borders so I couldn't navigate my desktop.  However, the panel still worked, so I could start a new borderless terminal window.  Xorg didn't stop running.  Is there a way I can restart whatever it is that controls the window borders and window placement without having to log out so I can recover by working session?
Paul avatar
tz flag
The problem just happened a second time.  I was automatically logged out of my KDE session while using Zoom.  When I logged back in I had none of my usual windows.  When I opened a window using the panel it had no border and couldn't receive focus.  Focus was stuck on the panel so that every time I typed it triggered the panel's search bar.  At this point I had to reboot the laptop.
Bader Lejmi avatar
pt flag
No idea of what process really crashed and what to restart exactly... Looks for me like the KDE WM crashed. Sorry I'm like you, looking for a solution.
Score:0
pl flag

One reported workaround for this is to add intel_idle.max_cstate=1 to GRUB_CMDLINE_LINUX_DEFAULT in your /etc/default/grub then run sudo update-grub and reboot.

Paul avatar
tz flag
I'll try that and let you know if it works, thanks.
Paul avatar
tz flag
I implemented the `intel_idle.max_cstate=1` (the value was previously set to 9), however I'm still getting the `i915 [drm] *ERROR* Atomic update failure on pipe A` errors on both kernels (5.15 and 5.19), but I have no freezing yet.
Paul avatar
tz flag
This suggestion didn't help. For details, see the text after "Edit on 2023-03-10" in my question above.
Score:0
gp flag

I had the same problem with Kubuntu 22.04 LTS on HP ProBook 455 G8 with Ryzen 7 5800u.

Also once per few days, my desktop freezes completely which can be recovered by killing Plasma processes from the Linux terminal at Ctrl+Alt+F2 but essentially it's a system reboot.

Note that while the desktop is completely frozen - there is still music playing in headphones by Youtube opened in Chromium, and it even switches tracks once finished.

I also can add that sometimes I also see some glitches with windows - like unresponsive key events that are 'fixed' by closing the unresponsive window and reopening it. Not sure that this issue is linked to desktop freezing, but it's also a KDE problem, as this randomly happens with very different apps.

Also, it's not a system RAM overuse - I have 32GB of RAM and in Ctrl+Alt+F2 terminal 'top' command shows the same numbers.

Paul avatar
tz flag
The CPUs for the machines I reported "freezing" above are Intel Xeon E3-1505M and two Intel i7-8850H. I also have a lower spec machine with an AMD Ryzen 5 2500U that froze every day or so when running Kubuntu 22.04 LTS.
Paul avatar
tz flag
I also have a desktop with an Intel i7-10700 that often froze when running Kubuntu 22.04 LTS.
Score:0
gp flag

6 days ago I've disabled Display and Monitor/Compositor/Enable compositor on startup and rebooted and since that didn't experience any visual glitches or stucks that looks like a longest time without desktop freeze so far for me. Note that this prevents many visual effects and animations, but anyway i've disabled all that things before cause i don't like them. However this also improved subjective responsiveness - apps GUI now seem to react faster on keyboard etc, that i really like.

Paul avatar
tz flag
Thanks Sevinnex, I till try that too as I've not found another solution. (I've been rebooting every couple of days to reduce the chances of my system freezing while I'm the middle of something important).
Paul avatar
tz flag
Sevinnex's suggestion did not work for me. I'm still having to reboot every few days. See "Edit on 2023-03-22" in my question above.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.