Bug 423817 - KWin/KDE freezes with Steam Proton
Summary: KWin/KDE freezes with Steam Proton
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.19.0
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-03 00:14 UTC by and_s52
Modified: 2020-11-09 23:57 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description and_s52 2020-07-03 00:14:10 UTC
SUMMARY
Kwin/KDE freezes horribly when a game with Steam's Proton is running and some other KDE GUI element comes in (notifications) or when attempting to minimize/switch to other windows (switching is impossible as each frame takes almost 30 sec to render. 

This effectively makes KWin/KDE unusable for anyone wishing to run games on Steam Proton. 

STEPS TO REPRODUCE (FULLSCREEN)
1. Start any game with Wine/Steam Proton
2. Attempt to minimize the window/change to other windows OR any interaction with KDE which causes the window to lose focus (receiving notifications for instance).

STEPS TO REPRODUCE (WINDOWED MODE)
1. Anything that involves interacting with KDE and causes the window do lose focus while the window is maximized (if the window isn't maximized, this doesn't seem to happen so much, it initially freezes but then I can drag the window once it finally loses focus after some painfull 20seconds)

OBSERVED RESULT
The entire system freezes. It does not stop working, audio is still completely audible and has no lag, but all GUI becomes unresponsive for a lot of time (almost a minute). After clicking in the game and regaining focus (some 1-2 mins later) everything goes away.

EXPECTED RESULT
The desktop environment should not freeze at all. Other Linux native games don't do this regardless of whether they are in windowed mode or full screen mode.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 5.7.2
(available in About System)
KDE Plasma Version: 5.19.0
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Disabling the compositor has no effect. I'm not entirely sure this is a KWin error or if it's an error in KDE, but I am inclined to think the problem is in KWin. I'll put this in general because I have no idea where the bug occurs.

Is there anything to fix this? Is the fix too complex to implement? I'd love to help if I could since I really love KWin but this bug makes it unusable with Steam Proton.
Comment 1 and_s52 2020-07-03 00:31:33 UTC
I can't seem to edit my original report so I'll add two things here:

- I am aware there's a similar bug report, out there (https://bugs.kde.org/show_bug.cgi?id=415286) but my problem is slightly different as disabling the compositor does not fix the bug in my case.

- I'm using an MSI Laptop (GP73 Leopard 8RF) and my GPU is an Nvidia GTX 1070 (I confirm I was running Nvidia, not Intel Graphics)
Comment 2 and_s52 2020-07-03 17:13:32 UTC
I have tried to update to the Nvidia beta drivers (450.1) and the problem still persists (I was previously using the stable 440 drivers). This is very likely a bug in how KWin handles Wine window buffers. Is there something I can do to try to fix this bug? Changing the backend of the compositor (XRender or OpenGL) has no effect.
Comment 3 David Edmundson 2020-08-06 10:22:45 UTC
>but my problem is slightly different as disabling the compositor does not fix the bug in my case.

>This is very likely a bug in how KWin handles Wine window buffers

If compositing is off we're not handling the video buffers. So what makes you say that?
Comment 4 David Edmundson 2020-08-06 11:02:11 UTC
But we definitely have various issues with the new Nvidia update.

Can you confirm if you see the same results running on openbox? I will try to do the same.
Comment 5 David Edmundson 2020-08-06 12:09:52 UTC
For me in Openbox and tabbing in/out of "World of Warplanes", a proton game seemed to result in the symptoms you described.
Comment 6 David Edmundson 2020-08-06 12:15:28 UTC
What does seem to help is compositing being always enabled (which gives you a personal workaround, you can just disable "Allow applications to block compositing")
Comment 7 and_s52 2020-08-09 22:25:54 UTC
Those issues also happen in openbox so maybe this is not even a KDE/Kwin bug? I sincerely can't seem to find the source of this.

I also already have "Allow applications to block compositing" disabled. 

Oh by the way, it seems PPSSPP (a PSP emulator) also has similar symptoms when using the Vulkan backend. They are similar but quite more serious: all of a sudden PPSSPP freezes and causes the compositor to crash, which doesn't happen in Steam Proton. Once KDE starts working again after the freeze, PPSSPP stops responding completely. 

Due to what you describe, it can also be an Nvidia driver bug.
Comment 8 and_s52 2020-08-22 15:43:31 UTC
Solved for most games after updating to Nvidia driver 450.66
Comment 9 Murphy 2020-10-04 16:53:38 UTC
(In reply to and_s52 from comment #1)
> I can't seem to edit my original report so I'll add two things here:
> 
> - I am aware there's a similar bug report, out there
> (https://bugs.kde.org/show_bug.cgi?id=415286) but my problem is slightly
> different as disabling the compositor does not fix the bug in my case.
> 
> - I'm using an MSI Laptop (GP73 Leopard 8RF) and my GPU is an Nvidia GTX
> 1070 (I confirm I was running Nvidia, not Intel Graphics)

I believe its Powerdevil. I've had the same issue for ever. Uninstalled Powerdevil and now Plasma/ Steam work without freezing. I reinstalled Powerdevil and had the issue within 15minutes. Then re-uninstalled PowerDevil and issue was gone again.Check your Logs for it. Steam Devs said it was Powerdevil on Steam Forum.
Comment 10 Murphy 2020-10-04 16:58:17 UTC
(In reply to and_s52 from comment #7)
> Those issues also happen in openbox so maybe this is not even a KDE/Kwin
> bug? I sincerely can't seem to find the source of this.
> 
> I also already have "Allow applications to block compositing" disabled. 
> 
> Oh by the way, it seems PPSSPP (a PSP emulator) also has similar symptoms
> when using the Vulkan backend. They are similar but quite more serious: all
> of a sudden PPSSPP freezes and causes the compositor to crash, which doesn't
> happen in Steam Proton. Once KDE starts working again after the freeze,
> PPSSPP stops responding completely. 
> 
> Due to what you describe, it can also be an Nvidia driver bug.

Its Powerdevil. I havent had a Steam issue since removing it. When I reinstall. The issue reappears.
Comment 11 David Edmundson 2020-10-05 11:45:27 UTC
>Steam Devs said it was Powerdevil on Steam Forum.

Please link.

>Its Powerdevil.

I can well believe powerdevil is triggering something. I would be *extremely* surprised if that's where a bug actually lies. 

>and causes the compositor to crash,

So kwin crashes? Do you have a backtrace?

Can you also confirm your nvidia version number
Comment 12 Bug Janitor Service 2020-10-20 04:33:15 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 13 Bug Janitor Service 2020-11-04 04:33:35 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 14 and_s52 2020-11-04 04:36:25 UTC
I said above it was solved by upgrading the nvidia driver to version 450.66

What more info should I provide?
Comment 15 Christoph Feck 2020-11-09 23:57:09 UTC
Thanks for the update; changing status.