Bug 384402 - KWin compositing performance anomaly
Summary: KWin compositing performance anomaly
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.8.7
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 20:52 UTC by rnet723
Modified: 2021-12-06 04:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
rnet723: Wayland?
rnet723: X11+


Attachments
KWin support information (5.58 KB, text/plain)
2017-09-05 21:09 UTC, rnet723
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rnet723 2017-09-05 20:52:52 UTC
I'm experiencing strange performance issues when using KWin + Desktop Effects + VSync (suspending of desktop effects is disabled). I'm not sure how to describe it correctly, but sometimes it looks like the framerate is really low (around 20fps), despite that various framerate counters may show 160+ fps. The worst thing about it, I cannot reliably reproduce it, most of time the picture is nice and smooth, but sometimes the "visual" framerate would drop for a few seconds and then restore. Switching window focus usually restores the performance. I've also noticed it's somehow related to system's uptime, the longer it runs, the higher is chance to hit the problem. But it's not necessary, sometimes it starts just after boot.
It's very annoying, especially if you're playing video games, or watching 60fps videos.
There is no framerate drops if I disable VSync, enable desktop effects suppression, or use another window manager, so my guess it that frames get dropped somewhere in the composition pipeline.

Hardware: AMD RX480 with amdgpu X driver & Mesa
OS: openSUSE 42.3 with Plasma 5.8

Currently, I have Mesa-git, but the problem is also reproducible with Mesa 17.1
I'd like to provide more information, but I don't know what you may need.
Comment 1 rnet723 2017-09-05 21:09:31 UTC
Created attachment 107709 [details]
KWin support information
Comment 2 Martin Flöser 2017-09-06 14:59:59 UTC
please watch your dmesg output and maybe xorg log for whether there are infos like "hung gpu"
Comment 3 rnet723 2017-09-07 18:38:39 UTC
Nothing abnormal in dmesg and Xorg.log. Some advanced games do produce GPU VM FAULTs on start, but it's hardly related to the problem.
Comment 4 Martin Flöser 2017-09-07 18:53:04 UTC
you could try enabling the showfps effect. One of it's side effects is that it triggers constant repaints. Thus a stutter in the compositing engine would be noticeable. Right now it could be e.g. the applications performing a stutter or the compositor.
Comment 5 rnet723 2017-09-09 13:46:37 UTC
I've been using the 'showfps' effect for some time now, and it looks like stutter does not happen if you have it enabled.
However, I've noticed that with vulkan apps and unigine superposition benchmark KWin's framerate is half of framerate of application. E.g., if in Talos Principle you have 90 fps, you'll get 45 in kwin's showfps effect, and it actually feels like you have 45 fps. There is no difference if you have Vsync enabled or disabled. Should I report another bug for that?
Comment 6 rnet723 2017-09-09 14:35:02 UTC
Another random observation: on long uptimes minimizing & restoring windows causes stutter. Killing and restarting plasmashell fixes it.
Comment 7 Martin Flöser 2017-09-10 07:19:08 UTC
(In reply to network723 from comment #5)
> E.g., if in
> Talos Principle you have 90 fps, you'll get 45 in kwin's showfps effect, and
> it actually feels like you have 45 fps.

KWin never renders faster than your screen, which is at 60 Hz. If an app renders at 90 Hz, KWin will restrict it to the refresh rate of the screen. More is just physically not visible anyway.

It might be that the system is under stress and due to that KWin is not able to render at 60 Hz.
Comment 8 rnet723 2017-09-10 08:04:23 UTC
>It might be that the system is under stress and due to that KWin is not able to render at 60 Hz.

Well, I you run the same application in OpenGL mode, KWin would show you 60Hz even if framerate of the application drops to 20Hz. Radeontop shows 100% gpu utilization in both cases.
But like I said, it was a random observation, GPU-heavy vulkan apps is not something I use daily, while random can stutters happen in any opengl program while you have KWin's VSync enabled.
Comment 9 Steffen Coenen 2017-10-31 15:28:30 UTC
This sounds like it may be a duplicate of this bug:
https://bugs.kde.org/show_bug.cgi?id=344433

Maybe try out if setting KWIN_TRIPLE_BUFFER=0 helps.
Comment 10 kde.org 2021-11-06 19:53:09 UTC
This issue report is quite old. Can you please confirm, that it still persists with KDE 5.23?
Comment 11 Bug Janitor Service 2021-11-21 04:39:55 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 12 Bug Janitor Service 2021-12-06 04:39:14 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!