Bug 240360 - KWin blur effect eats 30% CPU while machine is idle
Summary: KWin blur effect eats 30% CPU while machine is idle
Status: RESOLVED DUPLICATE of bug 242985
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 16:27 UTC by Andreas Kuhl
Modified: 2010-08-28 12:18 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kwin memory usage (123.38 KB, image/jpeg)
2010-06-01 21:13 UTC, Andreas Kuhl
Details
Sysprof results with the blur plugin enabled (113.42 KB, application/octet-stream)
2010-07-18 10:21 UTC, Max
Details
sysprof profile without the blur effect enabled (103.40 KB, application/octet-stream)
2010-07-18 10:22 UTC, Max
Details
Sysprof results with the blur plugin enabled (36.50 KB, image/png)
2010-07-18 10:22 UTC, Max
Details
sysprof profile without the blur effect enabled (36.78 KB, image/png)
2010-07-18 10:22 UTC, Max
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kuhl 2010-06-01 16:27:00 UTC
Version:           unspecified (using Devel) 
OS:                Linux

My machine (Core Duo T7200@2GHz CPU, 2GB RAM, 512 MB ATI MobilityRadeon X1800 512MB graphics adapter with legacy fglrx driver) consumes 2% CPU while idle and with desktop effects enabled. If I also enable the blur effect, the CPU consumption raises to 30% while idle.

Seems way to high and makes working noticeable slow. I do not think that my machine is spec'ed to low for this, is it?

Found with KDE SC 4.4.81 and Qt 4.6.70+ on openSUSE 11.1.

Reproducible: Always
Comment 1 Thomas Lübking 2010-06-01 17:08:38 UTC
- on what process?
- do you experience similar issues when eg. enabling the sharpen plugin (w/o the blur plugin enabled, of course)

the desktop is btw. unlikely idle, but if you enable the "show paint" plugin you'll notice some updates.

did you try the radeon/hd driver?
Comment 2 Andreas Kuhl 2010-06-01 21:10:02 UTC
Xorg process is eating up 30% CPU, KWin another 15%. I attached the KWin memory details (only as image as the markup cannot be saved).

From time to time it drops to reasonable 3% while doing nothing but a simple window movement (with medium wobble) boosts it up to 50% which is new.

Unfortunally, neither does the radon driver work (drmOpenDevice not found, I am working on this) nor does the sharpen plugin (not supported with my legacy fglrx).

I REALLY hope this is caused by my f*$%§! legacy fglrx driver. I'll buy a new laptop on end of june, whose ATI card will run with the latest fglrx driver. I'll see if the problem still persists. If not, blame it on the legacy fglrx driver which really gave me more than one headache under Linux.

Until then, let this bug open. I'll push it as soon as there is something to tell.
Comment 3 Andreas Kuhl 2010-06-01 21:13:02 UTC
Created attachment 47574 [details]
kwin memory usage
Comment 4 Thomas Lübking 2010-06-01 21:54:40 UTC
w/o actually knowing the implemetation details of the blur plugin i'm pretty sure that it uses stencil shaders - as does the sharpen plugin.
so i'm a bit confused why you can use blur but not sharpen.

however, if you *do* have direct rendering enabled (advanced tab) please disable it, deactivate the blur plugin and watch the cpu load (esp. on the X11 process, kwin has other things to do while you move around a window ;-)
Comment 5 Martin Flöser 2010-06-01 22:38:40 UTC
> --- Comment #4 from Thomas Lübking <thomas luebking web de>  2010-06-01
> 21:54:40 --- w/o actually knowing the implemetation details of the blur
> plugin i'm pretty sure that it uses stencil shaders - as does the sharpen
> plugin.
> so i'm a bit confused why you can use blur but not sharpen.
<dev note>Sharpen requires GLSL while blur also works with just 
GL_ARB_FRAGMENT_PROGRAM - it contains embedded assembler.

I'm just thinking about how we could disable blur for the legacy drivers 
without disabling it for all users. Maybe use KGlobalSettings::effectsLevel()?
Comment 6 Andreas Kuhl 2010-06-02 08:51:31 UTC
Most times, a simple "kwin --replace" fixes the problem. In rare cases, it does not, but dis- and reeabling an effect does. So I am now unsure wether the villain really is the blur plugin: The load could have also been lowered by incident while disabling the blur plugin.

I enabled the effect that shows me, which parts of the screen are redrawn by KWin. No blurred parts are redrawn while ideling (only process list of the systemmonitor like it should), and right now the load is only 3%.

I'll try to investigate some more.
Comment 7 Lars Scheiter 2010-06-14 14:51:54 UTC
Same problem here. While the blur effect is enabled, kwin constantly takes ~50% CPU. After disabling, everything is like it should be :)

The odd thing is, that my machine is equipped with an nVidia NVS 3100M, so the problem are not only legacy fglrx.
Comment 8 Max 2010-06-14 20:35:38 UTC
Same issue here. Running Kubuntu 10.4, kde sc 4.5 beta2.
Hw Specs: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+, nvidia 8600gt with the proprietary driver.

Kwin runs at 30% with the blur effect activated. 2-3% without blur
Comment 9 Alejandro Nova 2010-06-15 17:35:06 UTC
The blur plugin seems to be guilty here. A cycle of kwin --replace didn't solve this.

IMHO, and without knowing much about this... is this linked to bug 173556 ? Is the blur plugin permanently blurring? (I see blurred images, but I don't know if there is a process blurring and blurring the same things again). Also, I'm running with a puny 6150 IGP running at 100 MHz (I ensured myself it's slow so I can faithfully test, and I'm still running fast will all other KDE desktop effects...)
Comment 10 Alejandro Nova 2010-06-20 06:42:45 UTC
At last I could try this with my main desktop machine. And my suspicions were true: my mileage is varying heavily depending on the method used to draw the screen and what do I do after that. My main desktop machine has a GeForce 8500, Core 2 Duo E4400.

Fresh start, direct rendering and texture from pixmap: NORMAL IDLE FIGURES. This is amazing, because we were linking this to the CPU load caused directly by the blur. But KWin is at 1.0% and X is at 0.3%, WITH BLUR ENABLED. No window is opened apart from a Konsole window with top.

Switch to Indirect rendering, texture from pixmap. X jumped from 0.3% to 2.7%. No other window is opened. A bigger load is noticed.

After opening and closing a lot of windows, I could obtain 27% of CPU usage on idle under Direct Rendering, and more than 50% if I switched to Indirect Rendering. Switching to Direct Rendering made the idle figures lower after a period of time, but if I kept opening and closing windows, the CPU usage climbed and climbed slowly. So, this looks like a leak. Can anybody confirm?
Comment 11 Alejandro Nova 2010-06-20 06:44:24 UTC
Also, I'm citing indirect versus direct rendering because of bug 173556. I think KWin has access to shaders when I'm on direct rendering, and so it's a lot faster under a hardware supporting shaders.
Comment 12 Alejandro Nova 2010-06-29 01:38:07 UTC
Guys, it's me or this is fixed with KDE 4.5 RC1? With my puny laptop's graphic system (6150 SE) KWin idles now at a solid 5%, even less sometimes, and there's nothing moving it from there. Also, I'm not using NVidia 256 series drivers.
Comment 13 Max 2010-07-01 19:08:47 UTC
It's not really fixed in 4.5 RC1. I'm not even sure if it's the same bug, but the fact is that the blur plugin slows my system down quite a bit. While it might be true that it eats somewhat less CPU than before, it still has a highly significant negative impact upon the graphical performance.

Without the blur plugin my frame rate idles at 100fps and drops, under heavy load, to 45fps. It normally doesn't go lower than that.

With the blur plugin enabled, the idling fps count becomes 33 and pretty much stays there, regardless of the level of stress the system is subjected to. Weirdly, it occasionally rises back to 100fps, when it is "presenting windows."

That's about it. Is this a new bug? Or is it just a different aspect of the same  issue, namely: "the blur plugin f**ks up my performance up to the point where it becomes rather annoying, almost impossible to live with?"
Comment 14 Alejandro Nova 2010-07-02 03:47:41 UTC
You are right, Max, it's still there. The strange thing is: I enable the blur plugin and I have a massive CPU usage. I change the composition system from Indirect to Direct Rendering (or vice versa) and it still skyrockets. I reboot and I watch a blur having a negligible impact in my system (GF 8500).
Comment 15 Martin Flöser 2010-07-02 22:30:56 UTC
> Without the blur plugin my frame rate idles at 100fps and drops, under
> heavy load, to 45fps. It normally doesn't go lower than that.
> 
> With the blur plugin enabled, the idling fps count becomes 33 and pretty
> much stays there, regardless of the level of stress the system is
> subjected to. Weirdly, it occasionally rises back to 100fps, when it is
> "presenting windows."
The show fps effect is pretty much useless for benchmarking. E.g. 100 fps is 
the maximum it shows - even more frames are rendered. Anything more than 60 
FPS is just stupid. The way blur works causes fps effect to show only half the 
frame rate. In Present Windows effect blur is disabled, so you get the also 
wrong numbers from before.
Comment 16 Max 2010-07-04 16:04:11 UTC
> The show fps effect is pretty much useless for benchmarking. E.g. 100 fps is 
> the maximum it shows - even more frames are rendered. Anything more than 60 
> FPS is just stupid. The way blur works causes fps effect to show only half the 
> frame rate. In Present Windows effect blur is disabled, so you get the also 
> wrong numbers from before.

Thank you for the explanation. It certainly makes sense. Unfortunately this doesn't make the blur plugin any more usable on my machine. Any pointers on how to properly benchmark the performance?
Comment 17 Thomas Lübking 2010-07-04 16:19:19 UTC
a) "top" (cpu load monitor, telling "what")
b) "sysprof" (it's a profiler, telling "why")

you have top, but you'll likely have to install sysprof (and it requires to load a kernel module)
Comment 18 Max 2010-07-18 10:20:51 UTC
I finally got round to running sysprof on my system. I did 6 tests, 3 with
blur, 3 without, under the same stress conditions(5 open windows, a bit of
moving them about, resizing, etc). I'll only attach two files here, because
the others are almost identical.  The conclusion of the tests?

Kwin stays at about 34% under normal load, without the blur plugin. With it
enabled, it skyrockets to 55%(a good 70% more than without blur.) I'll also
attach some screenshots of the test results, in order for you to be able to
catch an easier glimpse of them.
Comment 19 Max 2010-07-18 10:21:45 UTC
Created attachment 49278 [details]
Sysprof results with the blur plugin enabled
Comment 20 Max 2010-07-18 10:22:07 UTC
Created attachment 49279 [details]
sysprof profile without the blur effect enabled
Comment 21 Max 2010-07-18 10:22:30 UTC
Created attachment 49280 [details]
Sysprof results with the blur plugin enabled
Comment 22 Max 2010-07-18 10:22:48 UTC
Created attachment 49281 [details]
sysprof profile without the blur effect enabled
Comment 23 adibudeen 2010-07-22 23:42:32 UTC
*** This bug has been confirmed by popular vote. ***
Comment 24 markuss 2010-07-23 00:30:21 UTC
"Fixed" in bug 242985 by adding a blacklist that disables the blur effect on hardware/drivers that don't support it.

*** This bug has been marked as a duplicate of bug 242985 ***
Comment 25 Gunther Piez 2010-08-11 10:23:11 UTC
I am using KDE 4.5.

KWin idles at 15-20% for me with the blur plugin enabled and 1% with blur disabled. So this is in no way "fixed".

Core 2 Quad @3,6 GHz with an Nvidia 8800 GT/driver 256.44. So you can add this to your blacklist too.