Bug 512805

Summary: Kwin freezes while gaming
Product: [Plasma] kwin Reporter: Diyou <diyou.dev>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: ilikefoss, nicolas.fella, xaver.hugl
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Log1
Log2
When not frozen yet
drm_info while frozen
drm_info after trying to move the mouse around

Description Diyou 2025-11-30 18:22:20 UTC
SUMMARY
While playing any game via proton kwin sporadically freezes seemingly at random but regularly enough to be an issue.

STEPS TO REPRODUCE (i can reliably get a kwin freeze by:)
1. Starting a game like Soulframe
2. Setting Volumetric Fog detail to high (causes freeze quicker and reliably) or medium
3. Run around for ~1-2 minutes in the overworld

OBSERVED RESULT
tty1 freezing and after a few seconds an old screencap that is minutes old becomes finally displayed (some memory leak?). The game's sound also stops but resumes every now and then while other processes like media playing in a browser are unaffected. I can switch to another tty via ctrl+alt+f3 and enter commands but that's that.

EXPECTED RESULT
Not freezing

SOFTWARE/OS VERSIONS
❯ kinfo
Operating System: Arch Linux 
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Kernel Version: 6.17.9-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 32 GB of RAM (31.3 GB usable)
Graphics Processor: NVIDIA GeForce GTX 1080


ADDITIONAL INFORMATION
I have not confirmed that this also may happen with linux native games but shouldn't matter regardless.
I don't remember this happening before plasma 6 and proton 10 but is consistent across different distros and proton versions (proton-cachyos proton-ge proton-tkg).

"journalctl -b -1|tail -n 100" is not showing anything during that freeze and 
nvidia-bug-report.sh also is not reporting any errors what so ever.

The underlying issue probably is caused by nvidia as always but regardless should not result in an unrecoverable kwin freeze that forces a reboot.

I'm not sure how to properly trace this issue down as it's not a crash.
Comment 1 Zamundaaa 2025-12-01 13:05:12 UTC
If you can switch ttys, then KWin is at least not complete frozen, it's still processing inputs.
Please attach the output of
> journalctl --user-unit plasma-kwin_wayland --boot 0
from after such a freeze happens.

Also, does running
> kwin_wayland --replace
afterwards un-freeze the session?
Comment 2 Diyou 2025-12-01 15:28:42 UTC
Created attachment 187288 [details]
Log1

Here the last 2 entries are within 1 minute of the freeze but seem unrelated as I could not reproduce them in further tests
Comment 3 Diyou 2025-12-01 15:45:17 UTC
Created attachment 187289 [details]
Log2

On this one i could restore kwin with
> kwin_wayland --replace
but it took 3-4 minutes until the frozen session got shut down. Until then I could not switch ttys at all and attempting to switch froze tty3 where i entered the command

This line:
> Dez 01 15:55:29 DiyouPC kwin_wayland[958]: QProcess: Destroyed while process ("/usr/bin/Xwayland") is still running.
is the the closest to the freeze and probably caused by the above command.
Comment 4 Zamundaaa 2025-12-05 16:43:38 UTC
Only thing I find suspicious there are these lines
> Dez 01 15:36:17 DiyouPC kwin_wayland[958]: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could not register app ID: Unable to open /proc/958/root")
> Dez 01 15:36:38 DiyouPC kwin_wayland[958]: 0x501: GL_INVALID_VALUE error generated. <levels>, <width> and <height> must be 1 or greater.
> Dez 01 15:36:38 DiyouPC kwin_wayland[958]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
> Dez 01 15:36:38 DiyouPC kwin_wayland[958]: Failed to create an offscreen framebuffer
but it's way before the qprocess warning, so probably not relevant.

Only other thing I can think of to check is whether or not drm_info output changes. Like, run drm_info from ssh while the screen is frozen, try to move the mouse around, and run drm_info again. If it's still the same, it's definitely in KWin, if it changed but the screen didn't, then it's somewhere in the driver.
Comment 5 Diyou 2025-12-05 20:24:13 UTC
Created attachment 187373 [details]
When not frozen yet
Comment 6 Diyou 2025-12-05 20:25:17 UTC
Created attachment 187374 [details]
drm_info while frozen
Comment 7 Diyou 2025-12-05 20:27:36 UTC
Created attachment 187376 [details]
drm_info after trying to move the mouse around

Diffing with the previous log shows some minor changes:
diff --git a/home/diyou/onfreeze.log b/home/diyou/aftermousemove.log
index c6ff54a..12ea251 100644
--- a/home/diyou/onfreeze.log
+++ b/home/diyou/aftermousemove.log
@@ -75,7 +75,7 @@ Node: /dev/dri/card1
 │   │   │   ├───640×480@72.81 nhsync nvsync 
 │   │   │   └───640×480@59.94 nhsync nvsync 
 │   │   └───Properties
-│   │       ├───"EDID" (immutable): blob = 115
+│   │       ├───"EDID" (immutable): blob = 124
 │   │       │   ├───Manufacturer: Samsung Electric Company
 │   │       │   ├───Model: S22D300
 │   │       │   └───Serial: 0x5A5A3848
@@ -181,7 +181,7 @@ Node: /dev/dri/card1
 │   │   │   └───Gamma size: 1024
 │   │   └───Properties
 │   │       ├───"ACTIVE" (atomic): range [0, 1] = 1
-│   │       ├───"MODE_ID" (atomic): blob = 120
+│   │       ├───"MODE_ID" (atomic): blob = 115
 │   │       │   └───1920×1080@60.00 preferred phsync pvsync 
 │   │       ├───"OUT_FENCE_PTR" (atomic): range [0, UINT64_MAX] = 0
 │   │       ├───"VRR_ENABLED": range [0, 1] = 0
Comment 8 Diyou 2025-12-05 22:27:39 UTC
(In reply to Zamundaaa from comment #4)
> Only thing I find suspicious there are these lines
> > Dez 01 15:36:17 DiyouPC kwin_wayland[958]: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could not register app ID: Unable to open /proc/958/root")
> > Dez 01 15:36:38 DiyouPC kwin_wayland[958]: 0x501: GL_INVALID_VALUE error generated. <levels>, <width> and <height> must be 1 or greater.
> > Dez 01 15:36:38 DiyouPC kwin_wayland[958]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
> > Dez 01 15:36:38 DiyouPC kwin_wayland[958]: Failed to create an offscreen framebuffer
> but it's way before the qprocess warning, so probably not relevant.

These occured around the launch of the game and did not cause any irregularities and in most repros these aren't happening at all.
Comment 9 Bug Janitor Service 2025-12-20 03:46:25 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!