xorg high cpu usage with compiz while using top command; goes away when compiz is killed

Bug #737454 reported by ngsupb
208
This bug affects 41 people
Affects Status Importance Assigned to Milestone
compiz (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: xorg

Some weird behavior. xorg cpu usage is very high when I open more then 2 terminals and run top command in one of them. Press 5-10 times spacebar to refresh the top and at some point xorg starts to use a lot of cpu in the top command

xorg goes to aroud 50-60% cpu usage.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: xorg 1:7.6~3ubuntu11
ProcVersionSignature: Ubuntu 2.6.38-7.35-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 270.29 Wed Feb 23 16:18:35 PST 2011
 GCC version: gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-6ubuntu4)
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,snap,gnomecompat,resize,vpswitch,place,move,mousepoll,imgpng,regex,animation,grid,wall,session,expo,workarounds,ezoom,staticswitcher,fade,scale,unityshell,scaleaddon]
CompositorRunning: compiz
Date: Fri Mar 18 12:39:46 2011
DistUpgraded: Fresh install
DistroCodename: natty
DistroVariant: ubuntu
DkmsStatus:
 nvidia-current, 270.29, 2.6.38-7-generic, x86_64: installed
 nvidia-current, 270.29, 2.6.38-6-generic, x86_64: installed
 virtualbox-ose, 4.0.4, 2.6.38-7-generic, x86_64: installed
 virtualbox-ose, 4.0.4, 2.6.38-6-generic, x86_64: installed
GraphicsCard:
 nVidia Corporation G86 [GeForce 8400M G] [10de:0428] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Acer Incorporated [ALI] Device [1025:0121]
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110302)
JockeyStatus: xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, In use)
MachineType: Acer, inc. Aspire 5920G
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-7-generic root=UUID=3fa46637-fcda-4d91-9ed5-7b2645862563 ro quiet splash vt.handoff=7
Renderer: Unknown
SourcePackage: xorg
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/18/2008
dmi.bios.vendor: Acer
dmi.bios.version: v1.3813
dmi.board.name: Chapala
dmi.board.vendor: Acer, Inc.
dmi.board.version: Not Applicable
dmi.chassis.type: 1
dmi.chassis.vendor: Acer, Inc.
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnAcer:bvrv1.3813:bd06/18/2008:svnAcer,inc.:pnAspire5920G:pvrNotApplicable:rvnAcer,Inc.:rnChapala:rvrNotApplicable:cvnAcer,Inc.:ct1:cvrN/A:
dmi.product.name: Aspire 5920G
dmi.product.version: Not Applicable
dmi.sys.vendor: Acer, inc.
version.compiz: compiz 1:0.9.4-0ubuntu7
version.libdrm2: libdrm2 2.4.23-1ubuntu3
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.1-0ubuntu3
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6~3ubuntu11
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu5

Revision history for this message
ngsupb (ngsupb) wrote :
bugbot (bugbot)
affects: xorg (Ubuntu) → xserver-xorg-video-nouveau (Ubuntu)
Revision history for this message
ngsupb (ngsupb) wrote :

some more info on this issue:

just open 5-10 terminals. Everything else is closed. and see how the xorg usage goes up.
It appears to be not in terminals issue, just ANY window. More opened windows cause more cpu usage on xorg.

5-10 opened windows is enough to cause lags.

killing compiz brings xorg down to the usual 5% But Unity is useless without compiz.
Probably this issue is on nvidia card+compiz since I didn't notice it on intel.

I don't use nouveau, using the proprietary drives.

Timo Aaltonen (tjaalton)
affects: xserver-xorg-video-nouveau (Ubuntu) → nvidia-graphics-drivers (Ubuntu)
Revision history for this message
Bryce Harrington (bryce) wrote :

High X CPU issues are almost always due to some client application driving the load up. As long as it doesn't crash X and things keep working, there isn't anything wrong with X - it's the client app that needs fixed. ;-)

In this case, since you found cpu usage went down when compiz was turned off, that indicates something compiz does is causing the excess load. Refiling.

summary: - xorg high cpu usage while using top command
+ xorg high cpu usage with compiz while using top command; goes away when
+ compiz is killed
affects: nvidia-graphics-drivers (Ubuntu) → compiz (Ubuntu)
Revision history for this message
ngsupb (ngsupb) wrote :

Hi guys,

More details on this issue. I have done some tests.

I have recorded a video for you to see the problem.
http://www.youtube.com/watch?v=eIEbPioVGo4

recordmydesktop caused high load on cpu but doesn't effect xorg. Don't blame it please:) The same story if I don't run recordmydesktop. There were running 11 terminals. There are no any other applications running.
Make sure to set the guilty to HD to see the numbers.

A few more things I can added:

1) This issue happens when I have __an external monitor attached___ (1920*1080 Twin or separate X mode). Checked without the external monitor, didn't see the high load on xorg by running the same test I made in the video.

2) I found that on idle doing nothing with those 11 terminals the xorg load goes down. But ACTIVITY brings the load back. (just running top command and refreshing it)

3) The problem is even worse when I have firefox and other application and doing something. Everything is laggy and not smoothly.

4) Using the external monitor but without compiz the performance is great.

So my concluding on this issue:
using compiz and an external monitor attached cause high load on xorg.

Probably compiz doesn't handle well large resolutions and external monitors? in my case it is with nvidia drives.

Revision history for this message
ngsupb (ngsupb) wrote :

Hi Guys,

I know you are busy, so no worries. I did some research, appears it is nvidia card 8*** issue/drivers. A lot of ppl have slow 2d performance with it.

Have to change the card? I am pissed off, it means I can't use Unity.

Would be nice if you have any ideas though. I have already tried any addition option in xorg and nvidia-settings, disabling all compiz plugins no effect.

Thanks.

Revision history for this message
ngsupb (ngsupb) wrote :

HI,

Just to add to this bug. I don't have this issue with nouveau drives....

Unity crashes like a hell though except of the last 20 mins.

Revision history for this message
ngsupb (ngsupb) wrote :

So exactly what is wrong:

It seems to be nvidia's proprietary driver problem on 8*** cards when using external monitor with large resolution (1920*1200). Compiz is very slow to handle opened windows. Works fine without the external monitor just at native notebook's resolution.

The only solution is nouveau driver. Appears to be working fine at acceptable performance except of the time when Unity crashes itself.

So as I understand ubuntu's team won't be able to help with this issue?

Revision history for this message
Alex Munroe (x-launchpad-veekun-com) wrote :

I suspect I'm having the same problem.

I have an 8800 GTS and two 1680x1050 monitors running with TwinView. I upgraded my nvidia driver to 270.29 a few days ago (in an attempt to resolve other Compiz issues, actually). Since then, X will peg a core for a few seconds, once a minute or so. Happens even if I sit back and watch an empty workspace.

What makes this particularly bad is that nothing redraws while X is spinning its wheels; keyboard input is recognized after the few seconds have passed, but the display is temporarily frozen and the cursor doesn't move.

I see several instances of the following stack trace in Xorg.0.log:

[507156.487] [mi] EQ overflowing. The server is probably stuck in an infinite loop.
[507156.487]
Backtrace:
[507156.487] 0: /usr/bin/X (xorg_backtrace+0x28) [0x45c5a8]
[507156.487] 1: /usr/bin/X (mieqEnqueue+0x1f4) [0x458ea4]
[507156.487] 2: /usr/bin/X (xf86PostMotionEventP+0xc4) [0x488d74]
[507156.487] 3: /usr/lib/xorg/modules/input/evdev_drv.so (0x7fe7d390d000+0x5319) [0x7fe7d3912319]
[507156.487] 4: /usr/lib/xorg/modules/input/evdev_drv.so (0x7fe7d390d000+0x5a0e) [0x7fe7d3912a0e]
[507156.487] 5: /usr/bin/X (0x400000+0x6d4e7) [0x46d4e7]
[507156.487] 6: /usr/bin/X (0x400000+0x1161a3) [0x5161a3]
[507156.487] 7: /lib/libpthread.so.0 (0x7fe7d9cd7000+0xfb40) [0x7fe7d9ce6b40]
[507156.487] 8: /usr/lib/xorg/extra-modules/nvidia_drv.so (0x7fe7d443b000+0xd9bb8) [0x7fe7d4514bb8]
[507156.487] 9: /usr/lib/xorg/modules/libwfb.so (wfbBlt+0x136) [0x7fe7d4001766]
[507156.487] 10: /usr/lib/xorg/modules/libwfb.so (wfbCopyNtoN+0x2bf) [0x7fe7d400621f]
[507156.487] 11: /usr/bin/X (miCopyRegion+0xa5) [0x55c2a5]
[507156.487] 12: /usr/bin/X (miDoCopy+0x43a) [0x55c93a]
[507156.487] 13: /usr/lib/xorg/modules/libwfb.so (wfbCopyArea+0x4c) [0x7fe7d400563c]
[507156.487] 14: /usr/lib/xorg/extra-modules/nvidia_drv.so (0x7fe7d443b000+0x40fb62) [0x7fe7d484ab62]
[507156.487] 15: /usr/bin/X (0x400000+0xdf664) [0x4df664]
[507156.487] 16: /usr/bin/X (0x400000+0x3e599) [0x43e599]
[507156.487] 17: /usr/bin/X (0x400000+0x3f979) [0x43f979]
[507156.487] 18: /usr/bin/X (0x400000+0x2187b) [0x42187b]
[507156.487] 19: /lib/libc.so.6 (__libc_start_main+0xfe) [0x7fe7d8c42d8e]
[507156.487] 20: /usr/bin/X (0x400000+0x21409) [0x421409]

...but there's definitely not such a crash for each temporary freeze. I've had at least a dozen just typing this, and there are only five traces since I switched to compiz.

10.10, compiz 0.8.6, default plugins plus ADD Helper, window previews, and application switcher. Nothing 3D-intensive running or been run since boot; mainly terminals, gvim, Thunderbird 3.1, Firefox 4. No such problem when using metacity.

Going to give nouveau a shot.

Revision history for this message
Squee (squeeonline) wrote :

I have found that if I am watching something in VLC full screen, CPU usage drops to normal. Laptop has only intel gfx chip.

Revision history for this message
Klement Sekera (klement-sekera) wrote :

I have the nvidia driver, external display, gnome 3, but it also happened on the old gnome (pre-natty).
If I open a terminal window, the whole system will slow to a crawl while there is activity inside.
Resizing the terminal window will "fix" it for a few minutes.

Revision history for this message
tom phillips (bumpstart21) wrote :

Heres another datapoint for this problem. I was running 9.10 and switched monitors to a 1440x900 monitor and compiz started hogging cpu. So I upgraded to 10.10 but no joy. Googling around someone mentioned the same problem with a laptop and external monitor and that disconnecting wireless then reconnecting cleared it up at least for a while. So I disabled my wired connection, re-logged in and so far compiz is back down to 1% cpu. Since I know little about compiz Im not sure why it would make a difference but it sure did.

Maybe an strace of compiz would provide a hint.

Changed in compiz (Ubuntu):
status: New → Confirmed
Revision history for this message
richardh9935 (richardh9935) wrote :

my system has become a zombie, and I'm not the only one. See the Forum thread

http://ubuntuforums.org/showthread.php?t=1744316&referrerid=272780

I can't even run a terminal window to do TOP. Slow response has become no response.

Please escalate this issue.

Richard.
Natty with Unity and two screens.

Revision history for this message
ngsupb (ngsupb) wrote :

Unfortunately the same issue still persists on Ubuntu 11.10 with the proprietary drivers(173 or current versions ) and external monitor attached. Terribly slow.

The worst thing that nouvea driver doesn't work well yet for me on 11.10 with an external monitor due to some bug described here https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/808677

I am afraid I will be forced to keep 11.04 for the next 6 months....

Revision history for this message
don02562 (don02562) wrote :

After I changed my resolution from 1680 x 1050 to 1440 x 900 compiz started using 90% of the cpu. After I changed it back everything is ok.

Revision history for this message
Marcin Sulikowski (msulikowski) wrote :

This bug is probably fixed in the new nvidia driver 290.03 (http://www.nvnews.net/vbulletin/showthread.php?p=2493300). Can someone verify this?

Revision history for this message
Federico (f-manzan) wrote :

Hurrà, I have tryed it and IS OK
Now all is very faster
nvidia 290 fix my problem

Thanks a lot

Revision history for this message
ngsupb (ngsupb) wrote :

Unfortunately the same issue still persists with 290.03 and 290.06 drivers. Using nouveau , it is the only options for me.

Revision history for this message
Toby Corkindale (tjc-wintrmute) wrote :

My 11.10 system with nvidia quadro card is painful to use with Unity+Compiz, yet it used to fly in Ubuntu 11.04 :/

Revision history for this message
ngsupb (ngsupb) wrote :

Hi Toby,

do you use an external/dual displays too?

Revision history for this message
Gabriel Thörnblad (gabriel-thornblad) wrote :

With an external monitor attached, Unity is almost unusable due to the high CPU usage from compiz. I have tried every NVIDIA binary release since Oneiric was released, including the 290.06 beta.

Using Unity-2D is my solution, not as elegant but a HUGE difference in responsiveness.

Revision history for this message
Juno Woods (translunar) wrote :
Revision history for this message
Toby Corkindale (tjc-wintrmute) wrote :
Revision history for this message
Toby Corkindale (tjc-wintrmute) wrote :

PS. Have tried the 290.10 nvidia driver, and it's still not fixed.

Revision history for this message
Bryce Harrington (bryce) wrote :

Attempted to reproduce it on Precise using an Intel gfx laptop docked with external monitor. Initially on open a dozen windows the CPU got slightly higher but still hardly got near 0.10, then dropped back down to 0.01.

So, this is likely nvidia-specific, and I'll bet this is the same as bug #877438. I'll set as a dupe.

Revision history for this message
Antonio Messina (arcimboldo) wrote :

I have the same issue, but on intel cards.
My system:

MacBookPro9,2
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Intel® Core™ i7-3520M CPU @ 2.90GHz × 4
Intel® Ivybridge Mobile

lsb_relase -a:
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Antonio,

For performance issues please log your own bug. You can use this command:
    ubuntu-bug compiz

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.