8

Whenever I lock the screen, after a certain amount of time, the CPU and the CPU fan go to their limits, and they return back to normal the moment I unlock the screen again (as shown by psensor).

How can I find out what process is responsible for this?

I've tried with "top -S", and the result is this...

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND    
 2114 me       20   0  326m 104m  40m R   16  2.6  66:50.03 compiz     
 1234 root     20   0  396m 152m  98m R    6  3.8  20:23.88 Xorg       
 2204 me       20   0  160m  38m  30m S    4  1.0   0:33.35 yakuake    
 2446 me       20   0  206m  18m  12m S    4  0.5   6:32.18 psensor    
 2280 me       20   0  220m  18m  10m S    2  0.5   5:01.60 unity-panel
 9138 me       20   0  154m  27m  15m S    2  0.7   0:03.63 plugin-cont
 2282 me       20   0 65800 5272 3316 S    1  0.1   4:36.90 hud-service
 2143 me       20   0  140m  11m 8352 S    1  0.3   2:50.16 indicator-m
 9095 me       20   0  720m 253m  36m S    1  6.4   0:26.34 firefox    
 2076 me       20   0  7168 3484  828 S    1  0.1   1:46.53 dbus-daemon
 2307 me       20   0 55000 5132 3632 S    1  0.1   2:01.55 indicator-a
 2557 me       20   0 86328 6028 4576 S    0  0.1   1:44.71 conky      
 6290 me       20   0  2836 1296  964 R    0  0.0   0:29.64 top        
 6291 me       20   0  2836 1188  884 S    0  0.0   0:29.49 top        
   1 root      20   0  3644 1984 1284 S    0  0.0  60:57.76 init  

Specs:

  • Fresh installation of Ubuntu 12.04
  • Intel Core i5
  • 4 GB RAM
slhck
  • 940
gianni
  • 413
  • the screen lock itself via the standard preferences menu "brightness and lock", or I lock it manually via ctrl-alt-l – gianni Jun 08 '12 at 17:05
  • yes, it is should be that, I didn't add any screensaver – gianni Jun 08 '12 at 17:08
  • 1
    On vanilla Unity, I believe this is actually gnome-screensaver with the blank screen option. I will try to verify (I've replaced mine with xscreensaver). – belacqua Jun 08 '12 at 17:10
  • 1
    Can you post output from dpkg -l | grep screensaver ? – belacqua Jun 08 '12 at 17:40
  • ii gnome-screensaver 3.4.1-0ubuntu1 GNOME screen saver and locker – gianni Jun 08 '12 at 19:02
  • 1
    What screensaver are you using? Some of these do take a considerable amount of resources. – mdpc Jun 08 '12 at 16:45
  • None, the screen is set to turn off after a certain amount of time. – gianni Jun 08 '12 at 16:48
  • 1
    The screen, but not necessarily the processing involved in generating the displays. – mdpc Jun 08 '12 at 16:55
  • Also, I think if "locking" is taking place, this passes a command to a screensaver (gnome-screensaver, or xscreensaver, e.g.) or something like xlock. – belacqua Jun 08 '12 at 17:08

3 Answers3

3

Maybe [fglrx] compiz uses 100% CPU when screen turns off (..) is your problem as well. Then here is what you can try to do:

WORKAROUND:

  1. Open Catalyst Control Center.
  2. Go to 3D > More Settings.
  3. Set "Wait for vertical refresh" to "On, unless application specifies". And if that doesn't work, then also do:
  4. Run "ccsm"
  5. In Workarounds, enable "Force full screen redraw (buffer swap) on repaint".

Please, also mark the bug as "This bug affects me" if it should be the case.

Marc
  • 46
  • thanks to Mark and to all the others that suggested me to look at the gnome-screensaver, which I had supposed to be inactive :-) – gianni Jun 09 '12 at 11:05
3

To find out which processes use the CPU while the screen is locked, use

top -b -i > watch.txt

and lock the screen. Wait a while, then look at the file. I found out that compiz and emacs are having a lot of fun while I am away.

3

For users who has "similar" problem: It is important to distinguish if CPU usage goes up

  • when screensaver "activates" OR
  • when lock screen activates.

As far as I see from comments this can be mixed up easily (I mixed up as well for the first time).

To distuinguish:

  • in terminal run "top" (or use "system-monitor" GUI where CPU usage past is visible),
  • Press Alt-Ctrl-L (immediate screen lock),
  • wait 3-4 secs (10-20 secs for "system-monitor"),
  • unlock computer and
  • IMMEDIATELY press "q" - to quit from "top" (or just check the last minutes of CPU usage in "system-monitor")

If there was a high CPU, you have NOTHING TO DO with screensaver, because screensaver has not activated. This is the case with my system.

I created an official Ubuntu bug, but realized there is a bug related to this, so I linked: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1322751

I wrote down a quite brutal workaround there. Please use it if you understood what that script is doing - and it suits for you.

It seems that fairly decent Intel "Haswell" or newer CPU/GPU-s are affected.

Please tick "This bug affects you" if it is true.

V-Mark
  • 302