Higher CPU/GPU usage under light workload

Hi there,

I used to use KDE Plasma until version 6 released. Stopped doing it mostly because of freezes. With this kind of problem, I’ve had to use another DE’s, that don’t fit my needs, and put up with their limitations.

So I tried Plasma 6.05 and was glad about freezes being fixed, but noticed higher CPU/GPU consumption under light workload. Playing YouTube video with Firefox takes up to 20% of CPU with 40% of GPU load. So does mpv playback. Both pieces of software are using hardware acceleration. This behaviour occurs under both sessions X and W. I also noticed higher GPU usage when just moving Dolphin window across workspace. Can’t figure out what could’ve caused such a problem. At first I thought that it might be linked with mesa or intel drivers, but such a problem doesn’t come up with others DE’s.

Do you know what process is causing the higher usage. Something I have noticed is that just having youtube page open in firefox causes kwin_wayland process to use higher cpu usage even if I never start the video and this after a fresh boot to eliminate other factors.

Edit: To clarify when I say higher cpu usage. I just mean that it basically goes from 0% total cpu usage to like 2.5% total cpu usage and stays there regardless of whether not anything is happening on the page. Not to say that it using like 70% of my cpu or something. Htop has it bouncing around between 30% to 50% of a single logical cpu (AKA thread).

Edit 2: After re-reading the post. I saw that you mentioned that firefox and mpv are specifically using higher resource usage. In that case how are you measuring this? I remember seeing a similar post a few days ago.

Edit 3: Found the other thread, but in this case the user was talking about ram usage KDE Plasma 6 Ram usage - #12 by dalto. The thing is though is that problems like this are difficult to solve because resource usage of an application doesn’t usually change much from desktop environment to desktop environment because they don’t manage or assign resources. That is the kernels job. This is why I thought that you were experiencing an issue with kwin because that is a kde process that can go wrong under certain circumstances.

Yes, I think those were Kwin_Wayland and Kwin_x11 prossess that caused higher CPU/GPU usage (I tried both sessions). I noticed YouTube videos playing a bit slower and looked at btop and intel_gpu_top. There I discovered high CPU/GPU utilisation. I occasionally found out the same behaviour when I just opened Dolphin and moved its window across workspace with intel_gpu_top running. The only process utilising CPU (~10%) was kwin_wayland.

did u try using something else than kde? like sway for instance? See if the problem still occurs there?

Yes, I brought it up above that such a problem doesn’t come up with other DE’s.

I forgot to ask, but what hardware are you using?

I managed to solve my problem with some tweaks to the nvidia-vaapi-driver environment variables and making sure the appropriate firefox environment variables were set. I don’t think my issue was related to your problem though. Since you seem to have an intel gpu I’m guessing.

I’ve got a Thinkpad carbon x1 gen7. It shouldn’t have any problems with Linux compatibility. The issue is likely linked to kwin. Plasma took it out of me, but I can’t use any other DE.

I’ve got an old machine with an Intel GPU lying around. I’ll try and reproduce the issue on that.

It would be interesting to see if you come across the same issue.
Thank you!

well i mean… this iis a kde issue then, fairly safe to say, you could try resetting kde’s settings, asking around on the kde forums if you can make it through their retarded account system, yion is you can try replacing kwin with kwinft, or you can try installing kwin-git or a number of alternate kwin packages in aur, just make sure the version is 6.x if ur on plasma 6

Well, I’m just going to wait for the next point release. May they fix it soon.

I tried with my old intel laptop. Firefox hovers between 10-15% cpu usage during video playback while occasionally jumping to 22% before coming back down. kwin_wayland process was less than 10% the entire time. Moving windows did not see any significant bumps in performance either. Usually around 20% then going back down to practically nothing. In all honesty it performs better than my 3080 in that regards.

Edit: Wanted to add that I only tested on Wayland.

A-ha, it looks like you’re experiencing the same, but what about GPU? In my case, GPU is being used up to 40%.

I just tried 6.1 beta. All is the same.

I launched intel_gpu_top and not sure if their is an overall percentage, but Render/3D and Video Decode both hover around the 20% range.

Also when I reporting cpu usage above. That was per thread a.k.a vcpu. There are 2 ways to measure CPU usage for most programs. Say I have an 8 core CPU with two threads per core. Htop will show 16 logical CPU’s.

So 30% of one vcpu is recorded as like 2.5% of total CPU and I’m unsure whether that is good or bad.

However you say you don’t have this happen on different desktop environments, so that kinda leads me to believe it may be a problem. I’ll try and boot up Gnome in a live environment and see what the numbers look like there.

I finally got around to using a live environment of Gnome. I tested with Fedora 40 Workstation Live Environment. Here are the results:

Fedora 40 Gnome Live

Cpu:
Moving a window: 20%
MPV Video Playback: < 10%
Gnome Shell: < 11%
Firefox Video Playback ~45%

Gpu:
Moving a window: 10%
MPV Video Playback: Render 80%, Video Decode 27 - 32%
Firefox Video Playback: Render 11 - 13% Spikes to 40 - 50%, Video Decode 25%

EndeavourOS KDE


Cpu:
Moving a window: 14% - did not test without effects such as wobbly windows
MPV Video Playback: < 7%
plasma Shell: < 8%
Firefox Video Playback: 10 - 17% Spikes to 20 - 30%

Gpu:
Moving a window: 20%
MPV Video Playback: Render 80 - 90%, Video Decode 28 - 32%
Firefox Video Playback: Render  18%, Video Decode 17 - 21%

I don’t think the live environment effected the results much, but I’m not so sure Fedora was the best distro to test with. I didn’t install any codecs, and I’m not sure if that effected anything, but either way they were mostly the same.

Based on the numbers that I got on my test laptop Plasma used less cpu than Gnome to move windows, but used more gpu than gnome for the same task.

In mpv playback it was the same story. Less cpu on Plasma and more gpu on Plasma.

Firefox showed a change here using more cpu on Gnome than on Plasma, but less gpu on average. However, I did notice a larger gpu spike on gnome for some reason.

I would say based on the results. Plasma is clearly more gpu oriented than Gnome which makes sense with all of the fancy effects and everything, but it also consistently seemed to use less cpu for these desktop operations. The applications did show differences, but I don’t think the numbers were drastically different enough to warrant saying one had better performance than the other.

2 Likes

Thank you for your comprehensive answer and test! I find it weird that mpv utilises up to 80% of GPU rendering. I’d expected a significant reduction in CPU/GPU usage under GNOME, as was in my case.

Could be some kind of hardware specific kind of thing. This was on a 7th generation intel chip. There were many improvements to their integrated graphics since then. I recall reading about some desktop environments not playing well with at least one generation of intel chips as well (can’t remember which one).

This is just what I was able to gather on that machine in particular. I believe I have a more powerful intel laptop somewhere. Its still pretty old. The last dual core cpu intel made I believe, but should still be more powerful than my test machine. Maybe I’ll give that one a quick glance and see if it reacts any differently. This time, both desktops will be live environments though.

Alright, I tested again on a more powerful intel chip. Its an 7th generation i7 chip. Same generation but i7 instead of i3 and this time I got different results. Also I would like to note that this time both desktop environments were tested on Fedora 40 in a live environment. Instead of testing one on endeavour and the other on Fedora. Plasma was on version 6.0.3 on Fedora 40’s live environment.

Gnome:
Moving Windows:
cpu: 20% --- same as before
gpu: 7% render --- gnome used slightly less gpu here compared to the i3 chip.

Firefox Playback:
cpu: 45% --- same as before
gpu: alternated between 15% and 50% approximately every 5 seconds for render, 25% video decode. --- slightly higher than on the i3 chip plus I identified the frequency of the spikes to happen around every 5 seconds.

Mpv Playback:
cpu: < 11% --- negligible difference than before.
gpu: 60% render, 20% video decode --- this was the biggest change; 20% less on the more powerful chip.

KDE:
Moving Windows: 
cpu: 25% --- a good bit higher than on the i3 chip. This is 11% more than before.
gpu: 21% render --- negligible difference to the i3 chip.

Firefox Playback:
cpu: 22 % --- slightly higher than the i3 chip.
gpu: 35% render, 25% video decode -- this is quite a bit higher than before. Slightly more video decode, but twice as much render.

Mpv Playback:
cpu: < 8% -- negligible difference
gpu: 70% render, 20% video decode - a good bit less than before in terms of rendering, and slightly less in video decode.
kwin used a bit shy of 10% render here.

New conclusions. Kwin seemed to add an additional 10% of gpu usage to pretty much all tasks. Plasma is still more gpu heavy compared to Gnome as I concluded in the last test. Plasma used bit more cpu in desktop operations compared to Gnome unlike with the i3 chip where it used a bit less cpu. I considered 10% more to be a non-negligible difference.

Firefox consistently uses more cpu under Gnome compared to Plasma for some reason. This could be some bug in either Gnome or Firefox because I don’t understand why that happens. Firefox’s gpu utilization appeared to be a more consistent under Plasma than Gnome. I’m not sure if that is a good thing or not though. For all I know maybe its supposed to clock up and down the way that it appeared to do so on Gnome.

On the mpv side of things is where we saw the biggest change. Gnome used a considerable bit less gpu this time around. About 20% less than on the i3 chip. I saw the same dip for plasma, but it still uses about 10% more render than Gnome. Both appeared to use less decode. They both dropped about 5% in video decode usage.

As a quick summary, mpv performed better under Gnome and this seems to be directly caused by kwin. If you noticed above that mpv’s gpu usage was 10% higher on plasma. That extra 10% came from kwin. Gnome shell never showed up under intel_gpu_top. That is how negligible its impact was on the applications. I still don’t understand the higher firefox cpu usage under Gnome though. Mpv performed the same cpu wise.

Anyways, we can never rule out hardware issues, since I only have a finite amount of hardware. Some of the numbers are so close that they are within margin of error for recording. One thing that I can conlude is that kwin consistently uses more CPU and GPU than Gnome’s mutter. However, that did not seem to effect applications all that much.

1 Like