Bug 340489 - All windows in KDE 5 starts glitching after some usage time
Summary: All windows in KDE 5 starts glitching after some usage time
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 5.1.0
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-30 09:38 UTC by RJ
Modified: 2018-06-05 09:55 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
glxinfo HD3200 (59.05 KB, text/plain)
2014-10-30 09:44 UTC, RJ
Details
qdbus org.kde.KWin /KWin supportInformation (6.25 KB, text/plain)
2015-04-27 19:45 UTC, RJ
Details
glitch screenshot (98.22 KB, image/png)
2015-06-03 22:04 UTC, RJ
Details
An example of a glitch (201.83 KB, image/png)
2015-09-24 22:23 UTC, Filip Fila
Details
kwin variables (408.19 KB, image/png)
2015-12-19 19:26 UTC, Filip Fila
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJ 2014-10-30 09:38:44 UTC
Just after KDE 5 start all going fine. But after some minutes when I use firefox watchings videos or doing other stuff there were LOT's of various glitches appears on my screen. When move, scale, scroll any window.

Reproducible: Always

Steps to Reproduce:
1. use HP 615 notebook with ATI HD3200 or I think other win same chip.
2. install Ubuntu 14.10 with KDE 5
3. start using it with about 10 minutes
Comment 1 RJ 2014-10-30 09:44:53 UTC
Created attachment 89372 [details]
glxinfo HD3200

Some technical info:

1. Linux sniper-Compaq-615 3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
2. xorg-radeon driver 7.4 and Mesa 10.3.0

Do you need video from my desktop?
Comment 2 Christoph Feck 2014-10-30 12:45:56 UTC
Does disabling compositing, or switching compositing mode (e.g. to XRender) any difference?
Comment 3 Thomas Lübking 2014-10-30 12:51:14 UTC
glamor acceleration?
"grep -i glamor /var/log/Xorg.0.log" ?
Comment 4 zless 2014-10-30 20:21:45 UTC
(In reply to Thomas Lübking from comment #3)
> glamor acceleration?
> "grep -i glamor /var/log/Xorg.0.log" ?

There's nothing in that log regarding 'glamor'. 
I do have '/usr/lib/xorg/modules/libglamoregl.so' which loaded some time ago (xorg log from May).

In Kwin compositor settings GLX is selected.

This is with the Intel i7 video card with the package xf86-video-intel 2.99.916-3
Comment 5 Thomas Lübking 2014-10-30 21:10:19 UTC
As already mentioned on bug #340493, Arthur's problem is very specific and entirely unrelated to this bug. Please ignore comment #4
Comment 6 RJ 2014-12-09 05:48:49 UTC
I tested this long long time and I have to say that if you start Plasma with OpenGL 2.0 or OpenGL 3.0 after quite short time it starts glitching.

With Xrender it works fine constantly. Would you like some more logs or something?
Comment 7 RJ 2014-12-09 05:51:21 UTC
And one more if it's glitching you can change OpenGL 2.0 -> OpenGL 3.0 OR OpenGL 3.0 -> OpenGL 2.0 then for short time it works fine but after some time it starts glitching again.
Comment 8 Thomas Lübking 2014-12-09 13:39:27 UTC
Please see and answer comment #3:

> glamor acceleration?
> "grep -i glamor /var/log/Xorg.0.log" ?
Comment 9 Martin Flöser 2015-01-14 09:02:04 UTC
could you please also provide the output of:
qdbus org.kde.KWin /KWin supportInformation
Comment 10 RJ 2015-04-27 19:45:26 UTC
Created attachment 92291 [details]
qdbus org.kde.KWin /KWin supportInformation

Kubuntu 15.04 x86
Comment 11 RJ 2015-04-27 19:46:10 UTC
$grep -i glamor /var/log/Xorg.0.log
$

so this command output nothing
Comment 12 Thomas Lübking 2015-04-27 20:10:17 UTC
Can you make a screenshot of such "glitches" so that we've a better idea what we're talking about?

Do those "glitches" also occur when forcing full scene repaints ("kcmshell5 compositing", tearing prevention)
Comment 13 RJ 2015-06-03 22:04:54 UTC
Created attachment 92985 [details]
glitch screenshot

I just maximize this window (double click on header) and then put it back again with double click on header
Comment 14 Thomas Lübking 2015-06-03 22:54:16 UTC
Insufficient updates.

run "kcmshell5 kwincompositing" - is the animation speed set to instant or fast (first two slider values)?
Comment 15 RJ 2015-06-28 19:52:45 UTC
(In reply to Thomas Lübking from comment #14)
> Insufficient updates.
> 
> run "kcmshell5 kwincompositing" - is the animation speed set to instant or
> fast (first two slider values)?

I carefully tested this. And I have to say a word.

After I move slider somewhere, doesn't matter where, glitching stops! But after restart with this option glitching starts again. Then I move slider somewhere again, then glitching stops and restart and repeat like in a cycle... (restart->start glitching->kwincompositing->move slider->stop glitching->restart->start glitching...

And one more! If I try to fix this *before* it starts glitching (like just after computer starts and I move slider somewhere), moving slider doesn't help. Such an Interresting bug...
Comment 16 RJ 2015-06-28 19:55:49 UTC
(In reply to Thomas Lübking from comment #14)
> Insufficient updates.
> 
> run "kcmshell5 kwincompositing" - is the animation speed set to instant or
> fast (first two slider values)?

And answering in a questing... by default value was in a center.
Comment 17 Thomas Lübking 2015-06-28 21:17:27 UTC
Maybe tearing prevention (or rather framebuffer re-usage) after all.
Can you please try to set the tearign prevention to "none" and check whether the issue re-occurs?
If not, re-enable it and run "KWIN_USE_BUFFER_AGE=0 kwin_x11 --replace &"
Comment 18 Sebastian 2015-07-28 07:29:30 UTC
KWin version: 5.3.2
I experience the same Problem: After some usage I get visual glitches as described by RJ. Also radeon driver here.

But setting tearing prevention to none seems to fix the issue - the glitches stop immediately.
Comment 19 Thomas Lübking 2015-07-28 07:31:17 UTC
See comment #17
Comment 20 Sebastian 2015-07-28 07:33:03 UTC
sorry, I was referring to your comment.
Comment 21 Thomas Lübking 2015-07-28 07:35:59 UTC
Ok, sorry ;-)
I was predominantly referring to the secons part:
> If not, re-enable it and run "KWIN_USE_BUFFER_AGE=0 kwin_x11 --replace &"
Since deactivating the tearing prevention works, there's good chance that radeon now supports the buffer_age feature, but it's buggy (in the driver)

You can also check the support:
   glxinfo | grep -i buffer_age

but it needs to be matched 2 or 3 times (1 is *not* sufficient for support)
Comment 22 Sebastian 2015-07-28 08:19:07 UTC
Ah, I misread your comment at the first time ;)
According to glxinfo GLX_EXT_buffer_age is supported by radeon v7.5.0, but setting KWIN_USE_BUFFER_AGE=0 and restarting kwin didn't help. The glichtes still occur with tearing prevention enabled.

On a sidenote: The breeze decoration seems to crash constantly when changing compositing settings - where can I look for breeze error messages?
Comment 23 Thomas Lübking 2015-07-28 08:38:44 UTC
If the breeze decoration "crashes" (like "segfaults") this would segfault all kwin and you should get a debug dialog.
Otherwise you need to specify what you mean by "crash" - but I doubt there's an error message for whatever you see.
Comment 24 Sebastian 2015-07-28 08:59:10 UTC
Then I guess kwin segfaulted - the decoration disappeared. I could still move my Thunderbird window around, so I was assuming there still was some kind of window management running. But I didn't get a debug dialog.
Anyway, I can't reproduce this right now.
Comment 25 Filip Fila 2015-09-24 22:22:18 UTC
This exact bug happens to me as well, with the addition of lagging when typing. 

Tweaking in the compositor settings removes the glitches, but only temporarily -> Turning off tearing prevention does not solve the issue for me (I did however have to thus turn AMD's TearFree on). Open Gl 2.0 vs 3.0 makes no difference as well. Switching to XRender made the situation even worse as the whole system started lagging massively. I did not notice the glitches with EGL, but effects do not work when the option is turned on. 

System info: 
kernel - linux-41-x64
kwin version - 5.4.1
gpu driver - fglrx 

I will post an attachment with an example of the glitch.
Comment 26 Filip Fila 2015-09-24 22:23:27 UTC
Created attachment 94713 [details]
An example of a glitch

Glitch occurs when scrolling.
Comment 27 Filip Fila 2015-10-25 22:37:32 UTC
Update: The problems still persist, but changing the settings doesn't help anymore. Glitches have not occurred so far when using XFCE with KWin.
Comment 28 Thomas Lübking 2015-10-26 09:21:41 UTC
> Glitches have not occurred so far when using XFCE with KWin.

Smells like fencing, try to disable
https://community.kde.org/KWin/Environment_Variables#KWIN_EXPLICIT_SYNC
Comment 29 Filip Fila 2015-10-30 23:20:47 UTC
I've been running the machine with that variable disabled for a few days now and haven't noticed any glitching. One of my friends has the same issue so I'll tell him to try it out as well. Thank you!
Comment 30 Filip Fila 2015-10-31 00:31:43 UTC
Unfortunately it seems that I've spoken prematurely since it's started happening again.
Comment 31 Thomas Lübking 2015-10-31 09:50:55 UTC
Sure it's the same glitch?

You could also try to disable
https://community.kde.org/KWin/Environment_Variables#KWIN_USE_BUFFER_AGE

or enforce full scene repaints ("kcmshell5 kwincompositing", tearing prevention strategy)
Comment 32 Filip Fila 2015-11-01 21:40:41 UTC
Yes, exactly the same - portions of the screen remaining when I scroll.

Enabling full scene repaints had no effect, but I'll try to disable that variable.
Comment 33 Filip Fila 2015-11-19 21:21:49 UTC
It's been quite for quite some time now, but the exact same glitching occurred again today, even with those two suggested variables disabled.
Comment 34 xdmx 2015-12-18 07:13:21 UTC
I'm experiencing this bug as well under Arch linux with all packages updated.
I have an Intel video card with xf86-video-intel 1:2.99.917+478+gdf72bc5-3
Comment 35 Thomas Lübking 2015-12-18 09:56:36 UTC
Run
KWIN_USE_BUFFER_AGE=0 KWIN_EXPLICIT_SYNC=0 kwin_x11 --replace &

and see what happens.
Comment 36 Filip Fila 2015-12-19 19:25:51 UTC
I am experiencing a significant increase in glitching since I started playing Xonotic (the game also crashes Kwin in most cases). One thing I forgot to mention was that I did not experience these issues in KDE 4, on the same hardware. As I mentioned before, disabling the two suggested variables and enabling full scene repaints does not help, but since I might not have set things up properly, I will attach a screenshot.
Comment 37 Filip Fila 2015-12-19 19:26:57 UTC
Created attachment 96201 [details]
kwin variables
Comment 38 Thomas Lübking 2015-12-19 21:46:20 UTC
Proper way to check environment:
   tr '\0' '\n' < /proc/`pidof kwin_x11`/environ | grep KWIN

I'd propose to block/suspend (SHIFT+Alt+F12) compositing to play xonotic (notably if that's the major/only trigger of problems) and please attach the output (with running compositor!) of
   qdbus org.kde.KWin /KWin supportInformation

Looking at your screenshot, this however looks more like a fglrx tiling issue (the diagonal split is not due to insufficient repaints)
If you still have EnableTearFreeDesktop on, I'd start by disabling that again.
Comment 39 Filip Fila 2015-12-19 23:31:09 UTC
The output of the "tr '\0' '\n' < /proc/`pidof kwin_x11`/environ | grep KWIN" command is:
KWIN_USE_BUFFER_AGE=0
KWIN_EXPLICIT_SYNC=0

Here is the kwin support information output: https://paste.kde.org/plzsdobvz/kjb7lq

Hmm, I had not considered TearFree as the suspect, but I will now turn it off, set kwin's tearing prevention to Automatic and try to see if the glitches will appear. The reason why I didn't think it was AMD was: 1) no glitches in KDE 4 with TearFree on; 2) no glitches in XFCE with kwin and TearFree; 3) fiddling with kwin's options made them go away sometimes; 4) I think I remember seeing those exact glitches in a live Kubuntu image with Plasma 5.1, which definitely had open source AMD drivers (but can't be 100% sure, of course). Puzzling. I'm not exactly sure why I even switched to TearFree way back in KDE 4, but I think might have experienced a rare case of tearing that made me do it. 

Anyway, I will report back if I've experienced the glitching. Unfortunately with TearFree off, tearing now appears in Xonotic regardless of the in-game Vsync option being turned on, but that is a much more preferable situation than experiencing workspace glitches, however, still not ideal since it seems like TearFree works ok with KDE 4 and XFCE. 

Thanks for the quick reply and the Shift+Alt+F12 tip!
Comment 40 Thomas Lübking 2015-12-19 23:43:23 UTC
>  2) no glitches in XFCE with kwin and TearFree
What basically means "it's not kwin" - the problem will be the pleathora of GL contexts in KDE5 which knock out the driver :-(
Comment 41 Filip Fila 2015-12-20 01:07:44 UTC
Sadly the scrolling glitches and typing lag have appeared again now even with TearFree disabled - it's the same glitches as before so that wasn't the cause.

I guess the next question would be why some users don't experience this. It seems like these scrolling glitches are perhaps not exactly the same thing as what RJ (OP) experienced. Two of my friends described something more along the lines of  glitches around windows, but I've found a thread on Manjaro forums also about scrolling glitches specifically so there are others experiencing it like I do. 

Is there any other Plasma component for which it would be good to submit this bug?
Comment 42 xdmx 2016-01-04 11:45:56 UTC
I've added the two ENV vars in .config/plasma-workspace/env/kwin_env.sh and rebooted the system, but I still get those glitches sometimes

#!/bin/bash
export KWIN_EXPLICIT_SYNC=0
export KWIN_USE_BUFFER_AGE=0
Comment 43 Kethen Chui 2016-05-18 12:27:33 UTC
http://askubuntu.com/questions/672007/flickering-in-kde-plasma-5-4
Are you talking about this issue? The 3rd method in the selected answer seems to have fixed opengl 2.0 for me.
Using Ubuntu 16.04
Comment 44 Filip Fila 2016-06-21 18:20:26 UTC
^ Probably not the same - that was about flickering. I tried the third solution anyway and am still getting these diagonal glitches and system slowness along with it.
Comment 45 Martin Flöser 2016-08-29 08:06:12 UTC
This could also be a case of bug #361154 - are you still experiencing with Plasma 5.7.4 or later?
Comment 46 Filip Fila 2016-09-01 09:23:52 UTC
Still on 5.7.3 and haven't seen the glitches I had in a while, but it seems that from this release or perhaps just the 5.7 series I've been getting nasty glitching and flickering of windows - can't switch between them, can't re-size or maximize, if I'm watching video it completely stutters... "kwin_x11 --replace" leaves me only with a desktop background, changing of compositor settings does nothing, I can only restart sddm or disable the compositor to address this.
Comment 47 Filip Fila 2016-09-19 09:56:15 UTC
(In reply to Martin Gräßlin from comment #45)
> This could also be a case of bug #361154 - are you still experiencing with
> Plasma 5.7.4 or later?

I can confirm that this diagonal glitches bug + system slowness when it occurs is still present even now in Plasma 5.7.5, as well as the new bug I described in my previous post.
Comment 48 Filip Fila 2018-06-04 13:42:42 UTC
I don't know about the other users in this bug report, but the problem completely went away from me when I switched from fglrx to radeon. Now, given that there was no bug with KWin in XFCE with fglrx, there might still be an underlying bug somewhere, but if other users who had different graphics cards chime in and also confirm that the bug does not happen anymore maybe we can close it.
Comment 49 Sebastian 2018-06-05 07:46:16 UTC
(In reply to Filip from comment #48)

I didn't experience this bug in ages, either. According to me this ticket can be closed.
Comment 50 Christoph Feck 2018-06-05 09:55:10 UTC
Thanks for the update; let's close this old issue. If you get this again with a recent KWin version (5.12 or newer), I suggest to report it as a new ticket.