Bug 461848 - With AMS on, KWin freezes after leaving monitor off for awhile
Summary: With AMS on, KWin freezes after leaving monitor off for awhile
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.26.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-15 01:11 UTC by poperigby
Modified: 2023-01-08 03:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Output of `journalctl --user-unit plasma-kwin_wayland --boot 0` (6.15 KB, text/plain)
2022-11-24 02:20 UTC, poperigby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description poperigby 2022-11-15 01:11:33 UTC
SUMMARY
Ever since the update to 5.26, I've been dealing with KWin freezing when I turn off my monitor for a bit. It will unfreeze if I leave it for a little bit (but I've only tested this twice.) I'm still able to switch TTYs, and I see this output in the systemd journal:

Nov 14 16:57:01 snowy kwin_wayland[890]: kwin_core: precision lost! floating value sent to X 7755.5
Nov 14 16:57:01 snowy kwin_wayland[890]: kwin_core: precision lost! floating value sent to X 8265.15
Nov 14 16:57:01 snowy kwin_wayland[890]: kwin_core: precision lost! floating value sent to X 7755.5
Nov 14 16:57:01 snowy kwin_wayland[890]: kwin_core: precision lost! floating value sent to X 8294.15
Nov 14 16:57:01 snowy kwin_wayland[890]: libkwinglutils: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Nov 14 16:57:01 snowy kwin_wayland[890]: libkwinglutils: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Nov 14 16:57:29 snowy kwin_wayland[890]: kwin_wayland_drm: Atomic commit failed! Permission denied

The time it gives for those errors is the exact time I turned on the monitor and found KWin frozen.

I've also noticed that Electron apps will be frozen after KWin unfreezes (they have to be restarted), and WezTerm crashes and sends a notification saying this: "Viewport dimensions are too large."

STEPS TO REPRODUCE
1. Turn off monitor
2. Leave for awhile (I can't figure out how long)

OBSERVED RESULT
KWin freezes when I leave my monitor turned off for awhile.

EXPECTED RESULT
KWin doesn't freeze when I leave my monitor turned off for awhile.

Operating System: Arch Linux
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Kernel Version: 6.0.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT
Manufacturer: ASUS
Comment 1 Nate Graham 2022-11-15 18:51:52 UTC
Does it stop happening if you set "KWIN_DRM_NO_AMS=1" in /etc/environment and reboot?
Comment 2 poperigby 2022-11-17 01:59:32 UTC
(In reply to Nate Graham from comment #1)
> Does it stop happening if you set "KWIN_DRM_NO_AMS=1" in /etc/environment
> and reboot?

I think that might have fixed it. It hasn't happened for two days now. It doesn't prevent the Electron app freezing, and WezTerm crashing though, so those might be from a separate problem.
Comment 3 Nate Graham 2022-11-18 17:10:31 UTC
Thanks. It does sound like those are separate issues, yeah.
Comment 4 Zamundaaa 2022-11-18 18:47:58 UTC
Please remove the environment variable again, reboot, cause the problem again and then attach the complete output of
> journalctl --user-unit plasma-kwin_wayland --boot 0
Comment 5 poperigby 2022-11-22 02:04:51 UTC
Just wanted to let you know that I'm still wait for the issue to resurface. It might have not even been a Plasma bug, and the environment variable you gave me was unrelated. I'll just wait and see.
Comment 6 poperigby 2022-11-24 02:19:21 UTC
(In reply to Zamundaaa from comment #4)
> Please remove the environment variable again, reboot, cause the problem
> again and then attach the complete output of
> > journalctl --user-unit plasma-kwin_wayland --boot 0

Nevermind, just had it happen.
Comment 7 poperigby 2022-11-24 02:20:21 UTC
Created attachment 153985 [details]
Output of `journalctl --user-unit plasma-kwin_wayland --boot 0`
Comment 8 Zamundaaa 2022-11-30 16:09:14 UTC
ok, no new information there. You can enable more verbose logging by putting
> QT_LOGGING_RULES="kwin_wayland_*.debug=true"
into /etc/environment, maybe that'll help find some more information.
Comment 9 poperigby 2022-12-01 02:42:24 UTC
(In reply to Zamundaaa from comment #8)
> ok, no new information there. You can enable more verbose logging by putting
> > QT_LOGGING_RULES="kwin_wayland_*.debug=true"
> into /etc/environment, maybe that'll help find some more information.

Alright, I'll just have to wait for it to freeze it again now. Thanks.
Comment 10 poperigby 2022-12-12 18:10:47 UTC
Just wanted to say, I didn't forget about this, it just hasn't happened again for some reason.
Comment 11 poperigby 2022-12-15 01:54:09 UTC
(In reply to Zamundaaa from comment #8)
> ok, no new information there. You can enable more verbose logging by putting
> > QT_LOGGING_RULES="kwin_wayland_*.debug=true"
> into /etc/environment, maybe that'll help find some more information.

It finally happened again! I've attached the log.
Comment 12 poperigby 2022-12-15 01:56:14 UTC
It was too big, but there's a link to the gist: https://gist.github.com/poperigby/7199474a700571d18d0831421bb28adc
Comment 13 Bug Janitor Service 2022-12-26 13:30:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3363
Comment 14 Zamundaaa 2022-12-26 13:33:07 UTC
The MR is unlikely to fix the KWin freezing, but it might help with the applications running through Xwayland freezing and crashing
Comment 15 poperigby 2022-12-27 22:06:23 UTC
(In reply to Zamundaaa from comment #14)
> The MR is unlikely to fix the KWin freezing, but it might help with the
> applications running through Xwayland freezing and crashing

Thanks! I'm having some trouble testing it, because both kdesrc-build and building it from the AUR aren't working.
Comment 16 Zamundaaa 2022-12-29 23:16:39 UTC
Git commit 40ca578bd0cee5797ee77a5b469eca2ec82e15aa by Xaver Hugl.
Committed on 29/12/2022 at 21:19.
Pushed by zamundaaa into branch 'master'.

workspace: don't make the placeholder output too big

The size is used in NETRootInfo::setDesktopGeometry, which seems to cause
some applications to misbehave or even crash because they attempt to create
a texture larger than what the GPU supports

M  +1    -1    src/workspace.cpp

https://invent.kde.org/plasma/kwin/commit/40ca578bd0cee5797ee77a5b469eca2ec82e15aa
Comment 17 Zamundaaa 2022-12-29 23:25:51 UTC
Git commit dafb220e55b0ac1b13b19a6f4e9741a9947fd29b by Xaver Hugl.
Committed on 29/12/2022 at 23:25.
Pushed by zamundaaa into branch 'cherry-pick-40ca578b'.

workspace: don't make the placeholder output too big

The size is used in NETRootInfo::setDesktopGeometry, which seems to cause
some applications to misbehave or even crash because they attempt to create
a texture larger than what the GPU supports


(cherry picked from commit 40ca578bd0cee5797ee77a5b469eca2ec82e15aa)

M  +1    -1    src/workspace.cpp

https://invent.kde.org/plasma/kwin/commit/dafb220e55b0ac1b13b19a6f4e9741a9947fd29b
Comment 18 Bug Janitor Service 2022-12-29 23:26:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3377
Comment 19 Zamundaaa 2022-12-30 15:22:43 UTC
The commit will be in 5.26.5, you can test it once that releases in a few days
Comment 20 poperigby 2022-12-30 17:58:00 UTC
(In reply to Zamundaaa from comment #19)
> The commit will be in 5.26.5, you can test it once that releases in a few
> days

Ah, okay. Great!
Comment 21 poperigby 2022-12-31 19:44:41 UTC
Another note, I don't think KWIN_DRM_NO_AMS is actually doing anything. It's still freezing with that enabled.
Comment 22 poperigby 2023-01-03 02:09:03 UTC
It's also happening almost every time I leave my computer for a bit, when it wasn't before.
Comment 23 poperigby 2023-01-08 03:19:28 UTC
I've been trying out the new release and both Plasma and the applications freezing seems to be fixed. Thank you!