compiz-fusion + gnome on freebsd 8 high cpu usage

Hi all,

Problem 1:
Compiz-Fusion works good, but it gives me very high cpu usage. It will always use about 25% of total cpu usage, even when just doing nothing. I suspect something is not entirely setup correctly.

Problem 2 (possibly related):
When using Compiz-Fusion and starting up google earth (linux emu) package, the opengl part of google earth starts to flicker heavily, impossible to play with it. When compiz is off, google-earth plays perfectly.

info about the system:

Code:
unix@phenomium:~$ uname -a
FreeBSD phenomium 8.0-STABLE FreeBSD 8.0-STABLE #2: Tue Apr 20 23:43:08 CEST 2010     root@phenomium:/usr/obj/usr/src/sys/PHENOM05  amd64

Code:
unix@phenomium:~$ pkg_info | grep compiz
compiz-0.8.4_2      Compiz Composite/Window Manager
compiz-bcop-0.8.4   Code generator for Compiz Fusion Plugins
compiz-fusion-0.8.4_2 Metaport of compiz-fusion
compiz-plugins-extra-0.8.4_2 Plugins for Compiz Composite Window Manager
compiz-plugins-main-0.8.4_2 Plugins for Compiz Composite Window Manager
compizconfig-backend-gconf-0.8.4_2 The gconf backend for CompizConfig
compizconfig-python-0.8.4_2 Python bindings for the compizconfig library
libcompizconfig-0.8.4_4 An alternative configuration system for Compiz

Code:
unix@phenomium:~$ pkg_info|grep mesa
mesa-demos-7.6.1    OpenGL demos distributed with Mesa

Code:
unix@phenomium:~$ glxinfo | grep -i render
IRQ's not enabled, falling back to busy waits: 2 0
direct rendering: Yes
OpenGL renderer string: Mesa DRI R600 (RV630 9589) 20090101  TCL

Starting compiz with

Code:
LIBGL_ALWAYS_INDIRECT=1 compiz --replace --ignore-desktop-hints ccp &
emerald --replace &

glxgears takes up 25% of total too, by the way, but that's possibly normal, since it will try to go as fast as possible.

here a top output when compiz-fusion is started:

Code:
last pid: 33200;  load averages:  0.69,  0.29,  0.20                                                                          up 0+13:29:27  14:49:16
100 processes: 3 running, 97 sleeping
CPU 0: 10.9% user,  0.0% nice,  7.0% system,  1.6% interrupt, 80.5% idle
CPU 1: 32.0% user,  0.0% nice, 23.4% system,  0.0% interrupt, 44.5% idle
CPU 2: 35.2% user,  0.0% nice, 12.5% system,  0.8% interrupt, 51.6% idle
CPU 3: 18.0% user,  0.0% nice,  8.6% system,  0.0% interrupt, 73.4% idle
Mem: 484M Active, 714M Inact, 812M Wired, 3580K Cache, 418M Buf, 1925M Free
Swap: 8192M Total, 8192M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 1574 unix          1  47    0 26752K  8048K select  0   0:54  5.18% gconfd-2
32612 unix          1  45    0   161M 46944K select  0   0:02  2.49% compiz
 1562 unix          2  76    0 79292K 12264K piperd  3   0:28  1.95% gnome-session
 1571 unix          1  45    0  8076K  2500K select  0   0:15  0.88% dbus-daemon
 1586 unix          1  44    0   167M 48956K select  3   0:24  0.59% gnome-panel
 1577 unix          2  76    0   196M 18408K piperd  3   0:14  0.29% gnome-settings-daem
22846 unix         11  48    0   243M   102M ucond   2   1:05  0.20% firefox-bin
 1601 unix          1  44    0   116M 25328K select  3   0:08  0.20% python
 1592 unix          1  44    0 28828K  4248K select  3   0:19  0.10% xscreensaver
 1617 unix          1  45    0   111M 17396K select  1  13:56  0.00% multiload-applet-2
 1623 unix          1  56    0   127M 19984K piperd  0   1:57  0.00% gnome-netstatus-app
 4994 unix         29  44    0   363M   159M ucond   3   0:46  0.00% thunderbird-bin
 1621 unix          1  44    0   161M 25724K select  2   0:34  0.00% clock-applet
 1619 unix          1  44    0   133M 21076K select  1   0:30  0.00% netspeed_applet2
 1615 unix          1  44    0   191M   106M select  3   0:28  0.00% cpufreq-applet
 1557 unix          1  44    0 12988K  4192K select  3   0:27  0.00% gam_server
 1639 unix          1  44    0 18324K  2164K piperd  0   0:15  0.00% libgtop_server2
 1607 unix          1  44    0   134M 23224K select  3   0:13  0.00% wnck-applet
 1589 unix          1  44    0   220M 45468K select  0   0:09  0.00% nautilus
52381 unix          1  44    0 59412K 12516K select  1   0:07  0.00% artsd
 1593 unix          1  44    0   128M 22112K select  3   0:04  0.00% gnome-power-manager
 1553 unix          2  44    0 38368K  6596K sigwai  0   0:02  0.00% gnome-keyring-daemo
 1581 unix          1  44    0 22632K  3904K select  3   0:02  0.00% gvfsd
 1613 unix          1  44    0 27056K  4772K select  3   0:02  0.00% gvfsd-trash
 1609 unix          2  47    0 28108K  5012K piperd  0   0:02  0.00% gvfs-hal-volume-mon
 1638 unix          1  44    0 18324K  2136K piperd  3   0:01  0.00% libgtop_server2
 1625 unix          1  44    0   100M 16604K select  0   0:00  0.00% notification-area-a
 1584 unix          5  46    0   133M  7048K select  0   0:00  0.00% pulseaudio
 1597 unix          1  44    0   192M 20064K select  0   0:00  0.00% gnome-volume-contro
32793 unix          1  44    0 79804K 14500K select  1   0:00  0.00% emerald
28721 unix          1  44    0 34444K  6156K select  3   0:00  0.00% xterm
 1591 unix          2  44    0 46488K  8392K select  1   0:00  0.00% bonobo-activation-s
 1594 unix          1  44    0 72628K 11084K select  0   0:00  0.00% polkit-gnome-authen
32878 unix          1  44    0 34444K  5604K select  0   0:00  0.00% xterm
32535 unix          1  44    0 34444K  5472K select  0   0:00  0.00% xterm
32696 unix          1  44    0 34444K  5448K select  3   0:00  0.00% xterm
28723 unix          1  44    0 10200K  2964K ttyin   2   0:00  0.00% bash
79786 unix          1  44    0 40276K  6568K select  1   0:00  0.00% gvfsd-http
 1627 unix          1  45    0 22632K  4176K select  3   0:00  0.00% gvfsd-burn

files attached: dmesg & xorg.conf

Any suggestions welcome.

Rick
 

Attachments

  • dmesg.txt
    9.3 KB · Views: 261
  • xorg.conf.txt
    5.1 KB · Views: 277
Problem 1:

Top shows your CPU usage for compiz at 2.5%, not 25% :) Are you sure it's really hitting 25%?

Problem 2:

The direct rendering infrastructure does not properly support direct rendering under composited environments, so this is a limitation with Xorg. DRI2 solves this problem but is unavailable under FreeBSD without kernel modesetting.

Adam
 
Hi Adam,

I didn't say compiz is using 25%, I was saying that the moment I started compiz the cpu usage is 25%. I have run another top, this time as root. Maybe we can see where this is coming from?

Code:
last pid: 74042;  load averages:  1.08,  0.97,  0.93                         up 0+14:53:12  16:13:01
155 processes: 2 running, 153 sleeping
CPU: 22.1% user,  0.0% nice, 10.5% system,  0.4% interrupt, 67.0% idle
Mem: 501M Active, 716M Inact, 815M Wired, 3192K Cache, 418M Buf, 1903M Free
Swap: 8192M Total, 8192M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 1470 root          1  48    0   769M   351M select  2  31:37  7.37% Xorg
 1574 unix          1  47    0 26752K  8060K select  0   2:27  5.76% gconfd-2
 1562 unix          2  76    0 81340K 12680K piperd  0   1:17  2.49% gnome-session
72429 unix          1  45    0   161M 47220K select  0   0:03  1.66% compiz
 1571 unix          1  44    0  8076K  2536K select  3   0:41  1.07% dbus-daemon
 1586 unix          1  44    0   167M 48892K select  3   0:41  0.59% gnome-panel
 1592 unix          1  44    0 28828K  4248K select  2   0:47  0.49% xscreensaver
 1577 unix          2  76    0   196M 18448K piperd  3   0:29  0.39% gnome-settings-daem
 1601 unix          1  44    0   116M 25496K select  0   0:21  0.10% python
 1617 unix          1  44    0   111M 17396K select  2  15:24  0.00% multiload-applet-2
 1623 unix          1  56    0   127M 19984K select  0   2:10  0.00% gnome-netstatus-app
 1621 unix          1  44    0   161M 25724K select  0   0:37  0.00% clock-applet
 1557 unix          1  44    0 12988K  4196K select  1   0:35  0.00% gam_server
 1619 unix          1  44    0   133M 21076K select  3   0:33  0.00% netspeed_applet2
 1615 unix          1  44    0   199M   116M select  2   0:31  0.00% cpufreq-applet
60549 unix         30  44    0   355M   140M ucond   0   0:19  0.00% thunderbird-bin
 1639 unix          1  44    0 18324K  2164K piperd  0   0:17  0.00% libgtop_server2
 1589 unix          1  44    0   222M 50372K select  1   0:15  0.00% nautilus
 1607 unix          1  44    0   134M 23532K select  1   0:14  0.00% wnck-applet
  499 root          1  44    0  8024K  1392K select  0   0:12  0.00% moused
 1593 unix          1  44    0   128M 22112K select  0   0:10  0.00% gnome-power-manager
52381 unix          1  44    0 59412K 12516K select  3   0:08  0.00% artsd
 1411 haldaemon     1  44    0 24136K  5364K select  2   0:05  0.00% hald
 1581 unix          1  44    0 22632K  3924K select  1   0:05  0.00% gvfsd
 1459 root          1  44    0 12524K  1996K select  0   0:04  0.00% hald-addon-storage
71928 unix         11  44    0   237M    98M ucond   2   0:04  0.00% firefox-bin
58812 unix          1  44    0   287M 47780K select  0   0:03  0.00% pidgin
61016 unix          1  44    0 34444K  6200K select  0   0:02  0.00% xterm
 1553 unix          2  44    0 38368K  6596K sigwai  0   0:02  0.00% gnome-keyring-daemo
 1613 unix          1  44    0 27056K  4772K select  2   0:02  0.00% gvfsd-trash
 1609 unix          2  47    0 28108K  5012K piperd  0   0:02  0.00% gvfs-hal-volume-mon

The moment I start compiz, the processes of Xorg, gconfd-2, gnome-session, compiz and d-bus are together creating this high load.

When I have no compiz running, top shows this:

Code:
last pid: 78491;  load averages:  1.13,  1.17,  1.04                         up 0+14:58:00  16:17:49
154 processes: 1 running, 153 sleeping
CPU:  0.4% user,  0.0% nice,  2.5% system,  0.6% interrupt, 96.5% idle
Mem: 469M Active, 711M Inact, 813M Wired, 3192K Cache, 418M Buf, 1942M Free
Swap: 8192M Total, 8192M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 1470 root          1  44    0   702M   345M select  0  31:54  0.00% Xorg
 1617 unix          1  44    0   111M 17396K select  1  15:29  0.00% multiload-applet-2
 1574 unix          1  44    0 26752K  8060K select  2   2:42  0.00% gconfd-2
 1623 unix          1  56    0   127M 19984K select  3   2:11  0.00% gnome-netstatus-app
 1562 unix          2  76    0 81340K 12748K piperd  0   1:25  0.00% gnome-session
 1592 unix          1  44    0 28828K  4248K select  3   0:50  0.00% xscreensaver
 1571 unix          1  44    0  8076K  2536K select  1   0:45  0.00% dbus-daemon
 1586 unix          1  44    0   167M 48892K select  2   0:44  0.00% gnome-panel
 1621 unix          1  44    0   161M 25724K select  3   0:38  0.00% clock-applet
 1557 unix          1  44    0 12988K  4196K select  3   0:36  0.00% gam_server
 1619 unix          1  44    0   133M 21076K select  1   0:33  0.00% netspeed_applet2
 1615 unix          1  44    0   201M   116M select  3   0:31  0.00% cpufreq-applet
 1577 unix          2  76    0   196M 18448K piperd  3   0:31  0.00% gnome-settings-daem
 1601 unix          1  44    0   116M 25496K select  0   0:23  0.00% python
60549 unix         32  44    0   357M   142M ucond   1   0:21  0.00% thunderbird-bin
 1639 unix          1  44    0 18324K  2164K piperd  2   0:17  0.00% libgtop_server2
 1589 unix          1  44    0   222M 50372K select  2   0:15  0.00% nautilus
 1607 unix          1  44    0   134M 23532K select  3   0:15  0.00% wnck-applet
  499 root          1  44    0  8024K  1392K select  2   0:12  0.00% moused
 1593 unix          1  44    0   128M 22112K select  1   0:11  0.00% gnome-power-manager

I'd say this is a significant difference.

And although I do understand that because I am running compiz with LIBGL_ALWAYS_INDIRECT=1 rendering goes through software resources, I don't see why it should create such a high load. For one, also because this is a triple boot and one of my other operating systems, Ubuntu Linux, also with Compiz running indirectly does not have such a high load.

Rick
 
So it starts at 25% and then drops to normal levels? Honestly, I'm not sure why you'd be concerned with that. When it starts, compiz has to query the X server for pixmaps of all windows (including the root window). I'm sure there are other things that it does when it first starts up, as a window manager, that are not handled by the video card.

As for the comparison to Ubuntu. That's not an apples to apples comparison. If you are using Ubuntu 9.10 then you are either using fglrx with that video card or you have installed newer open source drivers than what came with Ubuntu (and likely newer than what's available for FreeBSD). In addition, there's a pretty good chance that you are using KMS in Ubuntu if you are using the open source drivers.

EDIT: If you really are concerned about that 25% cpu usage when you start compiz, you could always try profiling it using something like ktrace or dtrace.

Adam
 
Hi Adam,

No, it stays at 25% and will not drop untill I kill compiz. That's what I am saying.

Maybe comparing with ubuntu wasn't such a good idea, true. It still doesn't change the fact that running compiz eats up valuable processortime.

Rick
 
Ahhh, so the entire CPU usage stays at 25%. I don't find this particularly odd. compiz can be resource intensive. Xorg, in particular, is going to consume more than it normally would as it's using the DRI driver to convert all window pixmaps to textures. gconfd-2 is going to start consuming more as you are probably using the gconf backend in ccsm, and it's going to be continually polling for changes to your compiz configuration.

For what it's worth, my CPU usage is hanging around 20% with compiz running. Since it's not impacting anything else, I just don't care :)

Adam
 
hmm...well, if this is 'normal' for indirect rendering, I hope someday soon direct rendering for compiz will be possible...If I was just running a 1 core cpu I would have a 100% usage this way...

oh well, maybe I can live with it.... I can always turn it of when I really need the cpu for something like videorendering :p

Thanks for your answers.

Rick
 
These really are just guesses on my part, possible explanations. You can always try profiling the processes to see what's going on.

Adam
 
Back
Top