linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.55k stars 742 forks source link

Cinnamon CPU usage reaches 100% after lock screen #11754

Open snr-lab opened 1 year ago

snr-lab commented 1 year ago

Distribution

Linux Mint 21.1 Cinnamon Desktop

Package version

5.6.8

Graphics hardware in use

None

Frequency

Always

Bug description

Recently I have converted my Laptop to a Proxmox server and I am running Linux Mint Cinnamon in a container. When the screen is unlocked and no specific application is running, the CPU usage is 2-5%. As soon as lock the screen it reaches 96-98% even though I am not running any application. Once I unlock the screen again it goes down to 2-5%.

This issue is replicable only in Linux Mint Cinnamon Desktop. Linux Mint XFCE Desktop works fine.

I have provided more details about the system in this forum https://forums.linuxmint.com/viewtopic.php?p=2348954

Steps to reproduce

  1. Install Proxmox on a desktop.
  2. Install Linux Mint Cinnamon OS in a VM and update it.
  3. Log in to the system and the lock the screen.

Expected behavior

The CPU usage should be similar for both Locked and Unlocked screen.

Additional information

https://forums.linuxmint.com/viewtopic.php?p=2348954

*mtwebster - edit: fixed forum links

mtwebster commented 1 year ago

Hi,

Are you using any type of display scaling inside the vm? If so can you set it back to 100% temporarily and test this again?

snr-lab commented 1 year ago

Yes, display scaling was 125% inside the VM. Setting it to 100% improves CPU usage. Now the screen is locked CPU usage is 30-45% when no application is running. Unlocking the screen CPU usage is still 2-3%.

One more observation, when I am trying to change the scaling from 125% to 100% after pressing apply button the screen gets black. It recovers after some time but the Display application not responding. I was able to change the scale after multiple trials and errors.

It seems there are some issues in display scaling.

snr-lab commented 1 year ago

Any suggestion to fix it?

mtwebster commented 1 year ago

The 100% cpu with scaling is fixed in cinnamon-screensaver 5.8. As for it still being 30%, I'm not sure - I can't reproduce this in virtualbox, there it's 0-1% while active.

The display settings issue, I can't reproduce either, it works reliably.

You can run the screensaver with debugging output:

cinnamon-screensaver --debug --hold

The debug flag will print a lot of extra info, the hold flag keeps the screensaver running indefinitely (it normally exits after 30 seconds of non-use).

You can also try running it with the --no-fallback flag (this disables a separate backup window that takes over in the event the main process dies).

You can activate the screensaver normally, or from the command line - cinnamon-screensaver-command --lock or --activate

I can have a look at the output from that. I would also suggest trying out the new Mint 21.2 iso, mainly for the fact that any fixes or updates are going to be to Cinnamon's 5.8+ line, not 5.6.

snr-lab commented 1 year ago

Hi @mtwebster Thanks for your response.

I tried with Mint 21.2 (Cinnamon 5.8.4) and it has same problem. Please find attachment fot the output of "cinnamon-screensaver --debug --hold" debug.txt

Please let me know if I can provide any more details.

snr-lab commented 1 year ago

Any update on this bug?

mtwebster commented 1 year ago

No I'm not sure yet what might be causing this.

I realize this may be tedious, but it might be worth trying Mint 20.3

Starting with Mint 21, there was a major rework of the window manager (muffin) and cinnamon. It has caused some ongoing issues with the screensaver (mainly when using fractional scaling) - these are mostly fixed now, but there could be some other behavior that was introduced, but less common.

If it works ok, it may be worth sticking with it for now, if the screensaver is a blocker for you using this system. Obviously this would result in an older package base overall, so it'd be a tradeoff.

snr-lab commented 1 year ago

I tried Mint 20.3 and it does not have a problem. But I don't want to use it as the packages are too old.

In my use case, I do not need the screen saver at all. I just want to lock the screen with CPU usage is normal. It is fine if the screen turns off or black once I lock the screen. It should give me a password field when I press enter or click.

If you can help me with that it will be great.

snr-lab commented 1 year ago

@mtwebster any help?

mtwebster commented 1 year ago

For now, no, unfortunately. I planned to set Proxmox up in the next few days to hopefully try and reproduce this. If you're seeing it I'm sure others are as well though they may not be aware of it.

mtwebster commented 1 year ago

Ok I got it set up and made a mint 21.2 guest, it seems to run fine when the screensaver is active. I'm not sure what the rest of your configuration was (and I've never used this hypervisor before), but this is working ok: image image image

I tried a couple of different graphic cards - default, vmware-compatible, VirtIO-GPU, and they all seem to behave the same. I didn't try this with any scaling, just at 1920x1080 and under. Also pretty much the same with only 1 core configured.

snr-lab commented 1 year ago

Thanks @mtwebster for taking the effort. Yes, it is working fine in your system. In my case even the scaling is 100%, the CPU usage is 30-40%. Unfortunately, I got some issue in power supply in my hardware. I will share my configuration or any other useful information as soon as the hardware issue is resolved.

dceldran commented 1 year ago

I have the same problem, i have a mini-pc with linux mint 21.2 and cinnamon 5.8.4 installed. When the lock screen activates, cpu raises to 60-70%.

I don't have any monitor attached to the mini-pc, i only connect through xrdp.

The steps to reproduce (in my case) are:

1º Connect throught rdp to linux mint 2º Enable lock screen

And cpu goes to 60-70%. If i reconnect with rdp and i put my password to disable the lock screen, cpu downs to normal.

The only thing i can say is i only can reproduce the problem if i don't have any apps opened and then lock the screen. If i have opened, for example, system settings and then i lock the screen, the cpu don't raise to 60-70% and stays down, but when i have all apps closed and i lock screen, problem appears.

My workaround is to disable lock screen in System settings -> Screen Saver

snr-lab commented 1 year ago

Hi @mtwebster

My older system faced motherboard failure. I have purchased a new system with decent hardware configuration. The new system have capability to passthrough the GPU.

SystemResource

With the new hardware system performs much better. But the core issue remain same. When system is idle the cpu usage is 0.15% - 0.22%. But as soon as the screen saver is appears the cpu usage reaches to 7%-7.2%. Yes, with my new hardware I have lots of CPU bandwidth available for other works. But I strongly believe a screen saver should not take 7% CPU usage with Intel i9500T Processor and 4 cores.

MintResource
snr-lab commented 1 year ago

Additionally I wanted to mention that when I am scaling the display to 125% the cpu usage is less than 1% as usual. But once the screen is locked the CPU usage reaches 80-90%.

nima-1102 commented 11 months ago

+1

snr-lab commented 10 months ago

Hi @mtwebster

The problem is not about display scaling. It is understandable that display scaling consumes higher CPU.

Issue is screen saver consuming huge CPU irrespective of display scaling on or off. Using GPU things get better but problem remains same. As per me screen saver should be a very light weight program and it should consume tinny amount of resources.

I am eagerly waiting to hear from you.

kylehase commented 10 months ago

My workaround is to disable lock screen in System settings -> Screen Saver

This dropped the CPU usage for my VMs instantly. I was expecting to have to restart or at least logout and log back in but the effect was immediate.