solus-project / budgie-desktop

I Tawt I Taw A Purdy Desktop
https://solus-project.com/
2.33k stars 158 forks source link

budgie-wm excessive CPU use with current nvidia drivers installed #1379

Open CorvusRuber opened 6 years ago

CorvusRuber commented 6 years ago

Operating System: Solus 3.999 Budgie version: Budgie 10.4

The issue encountered budgie-wm cpu usage over 80% and CPU temperature over 70°C straight out of login, with no signs of decreasing ...

Steps to reproduce the issue Install nvidia-glx-driver-current on a fully updated system, reboot and then login. Additional info can be found here

fossfreedom commented 6 years ago

I understand there has been a whole host of updates in this area (kernel/drivers) for Solus - is this still reproducible?

CorvusRuber commented 6 years ago

Sadly yes. I try installing the drivers at every kernel update, but so far the results are always the same: budgie-wm eats CPU like candy and the temperature starts spiking. This weird behaviour doesn't happen with other DEs: I've installed Gnome alongside Budgie on the same machine, and under Gnome Shell everything goes well. But if I log out of Gnome and then back into Budgie....... meltdown :(

kvark commented 6 years ago

I started getting this after a force-reboot (because of the sleep issues with NV, d'oh). Budgie takes a ton of CPU, and the UI feels quite laggy. This is very different from the previous experience (with Solus+Budgie+NV), where everything was snappy.

dreamcat4 commented 5 years ago

Hi there. Just upgrade to 18.10. And I can confirm the issue still persists. Even with the latest version of budgie there.

Do we know what the problem is being caused by yet? Obviously the budgie-wm process. But what is going on in there. If its some polling thing. Or if you are calling out to libevent or epoll. And that is not right.

What some people said was:

Because what I can very easily observe, is that any programs which update to the screen regularly will lead to drastically increased CPU usage. By the budgie-wm process itself.

Which is to say: any web browsers (yes, we already know about those). But also, for example: my DAW program that is written in java, and display VU audio meters. Or kodi. Which is (like vlc) a video player. Any such programs.

CPU usage usually varies from 27% to 72%. And this cpu is no slouch. On a different machine with slower cores, it would be much worse. Perhaps ?double that? on some ULV ultrabook.

Exactly as commented by the other guy:

This issue is not present with other window managers. If you exclude Gnome 3, which is slow for other reasons. Due to its javascript and extensions architecture. But Gnome 2, in MATE. With same (latest) nvidia 410.xx drivers. This I also have tried myself as per the other guy. All the best. This is on a modern nvidia Pascal architecture GPU (GT 1030).

So what is the problem here? My force full composition pipeline is on. Its not that. And its not any of the the other commonly suggested things. Do we have any inkling whatsoever what it is? Or can we narrow it down at all? Best of 3 perhaps?

My main questions are:

Because one thing is for certain:

What I can say is that:

I want to buy a laptop, and put budgie onto it! ...so if anyone else is using optimus, and can let us know if using intel IGPU only (completely disabling the nvidia GPU). If that avoids this high cpu usage scenario. Then that would at least tide me over until this bug is eventually fixed later on.

In fact I may switch over to my Intel GPU right now to try to see for myself. However probably all those nvidia drivers will still probably be loaded in memory. Just moving the monitor cable, and plugging into the intel display outputs instead of the ones of the nvidia graphics card. Not sure if that is the proper way to 'test' for this. Maybe if I also remove the graphics card from the pci express slot. Then perhaps it won't load up those nvidia kernel modules?

ghost commented 5 years ago

This really needs to be looked at.

@dreamcat4 I talked to Ikey about it a long time ago and he said it's an nvidia+mutter issue, not a Budgie problem. I'm not so sure he was right about that though. GNOME uses mutter by default too and I don't see anyone complaining about this problem.

An nvidia update several months ago broke the force full composition pipeline workaround. I discovered that removing the 32-bit nvidia drivers made the force composition trick work again. But, disabling 32-bit means you can't run Steam.. so that's a problem.

It seems to be significantly worsened by high resolution/high refresh rate displays from other things I've read. I use 1440p/144hz

My CPU ramps up to 60%+ on all cores if I drag a window around the desktop.

vitorhugods commented 5 years ago

Yeah, same problem here.

Dell XPS15 P56F (9570), Ubuntu Budgie 18.04, all up-to-date. Running on 80% CPU usage most of the time when doing absolutely nothing. Fan on high-speed, making a lot of noise.

Changing the driver to nouveau. Instead of rebooting to change the driver, I think I will reboot to Windows when playing =(

DataDrake commented 5 years ago

Feels related to this: https://phabricator.kde.org/D19867

Can someone experiencing this try adding the following to either their .bashrc or a shell script in /etc/profile.d/ to see if it helps after a reboot or relogin?:

export __GL_MaxFramesAllowed=1
bliles commented 5 years ago

Confirmed, setting export __GL_MaxFramesAllowed=1 in the environment greatly reduces the CPU usages for budgie-wm with nvidia 418 drivers.

Just to provide further details. I can still see around 60% CPU usage when budgie-wm is doing something like if I drag a window around in circles. But the huge improvement for me is that budgie now consistently drops down to background levels (less that 1%) when it is not busy. Previously after the session was running for just a few minutes I would see that budgie-wm staying at around 60-80% CPU.

dreamcat4 commented 5 years ago

Yeah I have tried also (with nvidia 415.27). And now the budgie-wm process stays at some varying levels nearly always below 12% (at max), for the vast majority of the time. This is whilst playing back video in firefox, and also with other program(s) graphical UIs which are updating regularly. The same workload on my machine would previously cause budgie-wm task to spend a lot of it's time above 30%.

Hopefully someone else with a laptop can also comment, especially in regards to mobile power usage / battery drain.

alecbcs commented 5 years ago

I can confirm this issue on Solus 4.0 with a Nvidia 980ti and an Intel Core i7-7700k. budgie-wm consistantly peaks above 60% when I move windows or watch videos. Inserting export __GL_MaxFramesAllowed=1 into my .bashrc has had no observable impact on fixing this for me.

fossfreedom commented 5 years ago

Note - GNOME Mutter are aware of high CPU usage with nvidia cards - https://gitlab.gnome.org/GNOME/mutter/merge_requests/363

Proposal there to resolve. As yet, has not been accepted. But if you are up-to-it, worth seeing if a locally compiled mutter with those merge patches resolves your issues.

pablott commented 5 years ago

I'm running mutter 3.34.1-55 and I think I have the same issue. budgie-wm spikes somewhere 40-70% along firefox when playing a video inside firefox. It does not happen if I play the same video in Gnome MPV (using SMplayer to find and start the video stream). How may I know for sure that is budgie-wm having an issue and not firefox itself? Maybe firefox is spiking budgie-wm's CPU usage? Both high CPU goes hand in hand though.

@fossfreedom I checked your message and the thread and in theory any fix should have been merged in 3.41. I don't see anything to be checked or toggled in my configuration.

rbreaves commented 4 years ago

I apologize, this was purely my fault, I had not enabled 3d acceleration in my VM and that had a severe impact obviously.

~I may be experiencing this too in my VM after having changed the dpi scaling for my retina display (2880x1800). I am not sure that this issue was always present however. So I will be rebooting and monitoring this more closely. My even revert my VM snapshot so that I can see what it looked like earlier.~

~These are the 2 commands I ran to change my resolution~

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]"
gsettings set org.gnome.desktop.interface scaling-factor 2

VirtualBox_UB2_28_07_2020_19_52_42

Particularly bad near a fresh boot as it pegs it a good bit, but I try not to hold that against it. VirtualBox_UB2_28_07_2020_19_57_59

rbreaves commented 4 years ago

I apologize, this was purely my fault, I had not enabled 3d acceleration in my VM and that had a severe impact obviously.

~UPDATE So I decided to remove all the scaling and this install is pretty clean, disabled the app & system tray app I was working on before reporting any of this.~

~I actually having Budgie resting at a cool 8-15% percent most of the time at a normal 1x scale. I am seriously wondering if there is something to the links I posted below where a resize bug of some kind is occurring with programs open because the resting CPU usage appears to increase with more applications open and yet at 1x it is all just meh.. it is normal.~

Screenshot from 2020-07-29 22-18-48


Also levels out once I bring down the scale to 1..

Going to collect all possibly related bugs filed in this post as it appears to be directly related to this command

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]"

https://bugs.launchpad.net/ubuntu/+source/d-conf/+bug/1283448 https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1299054

VirtualBox_UB2_29_07_2020_19_37_58