Regular Xorg and plasma-desktop CPU usage spikes

Hi all,

I have this problem that Xorg CPU usage spikes to between %20-%40, a little more than once every second - constantly. When this happens, everything on the system slows down, video, scrolling through pages, etc. plasma-desktop does the same, at the same time as Xorg, though uses less CPU. Switching off Desktop effects makes no difference. The spikes starts just after KDE is up and running after boot.

I’m running 11.3, KDE 4.4.4 release 3, 64bit on a desktop and 32bit on a laptop, both have the same problem. I have searched the internet, but cannot find anything related to this, please help!

My 64bit desktop details is:
hwinfo --short
cpu:
AMD Athlon™ 64 X2 Dual Core Processor 5400+, 1000 MHz
AMD Athlon™ 64 X2 Dual Core Processor 5400+, 1000 MHz
keyboard:
/dev/input/event0 Elan Microelectronics Keyboard
mouse:
/dev/input/mice USB Mouse
monitor:
Generic Monitor
graphics card:
nVidia GeForce 8400 GS
sound:
Ensoniq Creative SoundBlaster AudioPCI 128
storage:
Floppy disk controller
nVidia MCP78S [GeForce 8200] IDE
nVidia MCP78S [GeForce 8200] SATA Controller (non-AHCI mode)
network:
eth0 nVidia MCP77 Ethernet
network interface:
lo Loopback network interface
eth0 Ethernet network interface
disk:
/dev/sda WDC WD800JD-75MS
/dev/sdb ST3120022A
partition:
/dev/sda1 Partition
/dev/sdb1 Partition
/dev/sdb2 Partition
/dev/sdb3 Partition
cdrom:
/dev/sr0 HL-DT-ST DVD-RAM GH22LS30
floppy:
/dev/fd0 Floppy Disk
usb controller:
nVidia MCP78S [GeForce 8200] OHCI USB 1.1 Controller
nVidia MCP78S [GeForce 8200] EHCI USB 2.0 Controller
nVidia MCP78S [GeForce 8200] OHCI USB 1.1 Controller
nVidia MCP78S [GeForce 8200] EHCI USB 2.0 Controller
bios:
BIOS
bridge:
nVidia MCP78S [GeForce 8200] LPC Bridge
nVidia MCP78S [GeForce 8200] PCI Bridge
nVidia MCP78S [GeForce 8200] PCI Express Bridge
nVidia MCP78S [GeForce 8200] PCI Express Bridge
AMD K8 [Athlon64/Opteron] HyperTransport Technology Configuration
AMD K8 [Athlon64/Opteron] Address Map
AMD K8 [Athlon64/Opteron] DRAM Controller
AMD K8 [Athlon64/Opteron] Miscellaneous Control
hub:
Linux 2.6.34.7-0.5-desktop ehci_hcd EHCI Host Controller
Linux 2.6.34.7-0.5-desktop ehci_hcd EHCI Host Controller
Linux 2.6.34.7-0.5-desktop ohci_hcd OHCI Host Controller
Linux 2.6.34.7-0.5-desktop ohci_hcd OHCI Host Controller
memory:
Main Memory
unknown:
FPU
DMA controller
PIC
Timer
Keyboard controller
/dev/lp0 Parallel controller
PS/2 Controller
nVidia MCP78S [GeForce 8200] Memory Controller
nVidia MCP78S [GeForce 8200] SMBus
nVidia MCP78S [GeForce 8200] Memory Controller
nVidia MCP78S [GeForce 8200] Co-Processor
nVidia MCP78S [GeForce 8200] Memory Controller
/dev/ttyS0 16550A
/dev/input/event1 Elan Microelectronics Unclassified device

and graphics card:
hwinfo --gfxcard
31: PCI 200.0: 0300 VGA compatible controller (VGA)
[Created at pci.318]
Unique ID: B35A.Y+3S99CFy94
Parent ID: 37TO.huzTasz2Sg6
SysFS ID: /devices/pci0000:00/0000:00:10.0/0000:02:00.0
SysFS BusID: 0000:02:00.0
Hardware Class: graphics card
Model: “nVidia GeForce 8400 GS”
Vendor: pci 0x10de “nVidia Corporation”
Device: pci 0x06e4 “GeForce 8400 GS”
SubVendor: pci 0x1462 “Micro-Star International Co., Ltd.”
SubDevice: pci 0x1163
Revision: 0xa1
Driver: “nvidia”
Driver Modules: “nvidia”
Memory Range: 0xfd000000-0xfdffffff (rw,non-prefetchable)
Memory Range: 0xd0000000-0xdfffffff (ro,non-prefetchable)
Memory Range: 0xfa000000-0xfbffffff (rw,non-prefetchable)
I/O Ports: 0xec00-0xec7f (rw)
Memory Range: 0xfebe0000-0xfebfffff (ro,non-prefetchable,disabled)
IRQ: 19 (1184 events)
I/O Ports: 0x3c0-0x3df (rw)
Module Alias: “pci:v000010DEd000006E4sv00001462sd00001163bc03sc00i00”
Driver Info #0:
XFree86 v4 Server Module: nvidia
Driver Info #1:
XFree86 v4 Server Module: nvidia
3D Support: yes
Config Status: cfg=no, avail=yes, need=no, active=unknown
Attached to: #24 (PCI bridge)

I have also updated to the latest updates

Thank you!

@daniel73, welcome to the forum. :slight_smile:

I don’t have your h/w or know exactly what is causing your problem, but some more system information may provide us with a clue. I havemay missed it in your h/w list, but how much total ram do you have available on that machine?

When the problem starts, what monitor are you using to measure the cpu usage spikes?

Please post the results of running the command “top” (w/out quotes) in konsole as normal user, preferably when the problem starts if possible. Also post result of the command “free -m” as before, but with and without the problem.

Thanks.

Thanx Consused :slight_smile:

My system is running with 8gb of ram, so that should not be a problem. I’ve first noticed the problem in smplayer, as little “freezes”, also when scrolling through a web page or even a man page. Out of interest, I then used a system monitor widget and it showed very regular spikes when the system is idle. (If you let me know where to host, I can link a image of the monitor)

The output of top is as follows (at the time of a spike, very fortunate):

top - 14:12:49 up 4:57, 4 users, load average: 0.04, 0.10, 0.08
Tasks: 162 total, 1 running, 161 sleeping, 0 stopped, 0 zombie
Cpu(s): 22.6%us, 1.8%sy, 0.0%ni, 75.4%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8193512k total, 2419296k used, 5774216k free, 396416k buffers
Swap: 2103292k total, 0k used, 2103292k free, 1453556k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1542 root 20 0 150m 59m 14m S 31 0.7 36:04.78 Xorg
1924 daniel 20 0 889m 89m 34m S 15 1.1 14:54.49 plasma-desktop
7842 daniel 20 0 235m 24m 17m S 2 0.3 4:13.52 smplayer
2183 daniel 20 0 8784 1136 756 S 0 0.0 0:06.90 ksysguardd
10003 daniel 20 0 446m 76m 28m S 0 1.0 0:16.24 firefox
10188 daniel 20 0 8672 1152 788 R 0 0.0 0:00.10 top
1 root 20 0 12408 764 628 S 0 0.0 0:00.64 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0 0.0 0:00.80 ksoftirqd/0
5 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/0
6 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
7 root 20 0 0 0 0 S 0 0.0 0:00.26 ksoftirqd/1
8 root RT 0 0 0 0 S 0 0.0 0:00.00 watchdog/1
9 root 20 0 0 0 0 S 0 0.0 0:00.82 events/0
10 root 20 0 0 0 0 S 0 0.0 0:01.20 events/1
11 root 20 0 0 0 0 S 0 0.0 0:00.00 netns
12 root 20 0 0 0 0 S 0 0.0 0:00.00 async/mgr
13 root 20 0 0 0 0 S 0 0.0 0:00.00 pm
14 root 20 0 0 0 0 S 0 0.0 0:00.01 sync_supers
15 root 20 0 0 0 0 S 0 0.0 0:00.03 bdi-default
16 root 20 0 0 0 0 S 0 0.0 0:00.00 kintegrityd/0
17 root 20 0 0 0 0 S 0 0.0 0:00.00 kintegrityd/1
18 root 20 0 0 0 0 S 0 0.0 0:00.13 kblockd/0
19 root 20 0 0 0 0 S 0 0.0 0:00.06 kblockd/1
20 root 20 0 0 0 0 S 0 0.0 0:00.00 kacpid
21 root 20 0 0 0 0 S 0 0.0 0:00.00 kacpi_notify
22 root 20 0 0 0 0 S 0 0.0 0:00.00 kacpi_hotplug
23 root 20 0 0 0 0 S 0 0.0 0:00.01 khubd
24 root 20 0 0 0 0 S 0 0.0 0:00.00 kseriod
27 root 20 0 0 0 0 S 0 0.0 0:13.92 kondemand/0
28 root 20 0 0 0 0 S 0 0.0 0:00.00 kondemand/1
51 root 20 0 0 0 0 S 0 0.0 0:00.00 khelper
52 root 20 0 0 0 0 S 0 0.0 0:00.00 khungtaskd
53 root 20 0 0 0 0 S 0 0.0 0:00.00 kswapd0
54 root 25 5 0 0 0 S 0 0.0 0:00.00 ksmd
55 root 20 0 0 0 0 S 0 0.0 0:00.00 aio/0
56 root 20 0 0 0 0 S 0 0.0 0:00.00 aio/1
57 root 20 0 0 0 0 S 0 0.0 0:00.00 crypto/0
58 root 20 0 0 0 0 S 0 0.0 0:00.00 crypto/1
66 root 20 0 0 0 0 S 0 0.0 0:00.00 kpsmoused
67 root 20 0 0 0 0 S 0 0.0 0:00.00 usbhid_resumer
96 root 20 0 0 0 0 S 0 0.0 0:00.00 ata/0
97 root 20 0 0 0 0 S 0 0.0 0:00.00 ata/1
98 root 20 0 0 0 0 S 0 0.0 0:00.00 ata_aux
100 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_0
101 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_1
102 root 20 0 0 0 0 S 0 0.0 0:01.96 scsi_eh_2
103 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_3
104 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_4
105 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_5
114 root 20 0 0 0 0 S 0 0.0 0:00.00 scsi_eh_6

and “free -m”:
total used free shared buffers cached
Mem: 8001 2703 5297 0 392 1579
-/+ buffers/cache: 731 7270
Swap: 2053 0 2053

Unfortunately I cannot give the output of “free -m” without the spikes, as it never stops! :frowning:

Please let me know what else you need.
Thank you.

I agree that memory stats look ok. When you post this kind of data you need to enclose it in CODE tags to preserve format. If you “Go Avanced”, you get an icon (#) for that.

Overall CPU at 26% is somwhat high, but have seen worse in a fault situation. However, when looking at tasks, I don’t see kwin (desktop effects) listed, so assume you weren’t running KDE’s desktop effects(?)

You are running smplayer (requires mplayer), but I don’t see mplayer listed as a running task, something wrong there, whereas mine lists it with more cpu than smplayer? Perhaps it doesn’t get that far. Is a video playing?

On mine plasma-desktop comes and goes very quickly with very low cpu. So the problem is as you stated.

What is audio doing at this point. Are you happy that it’s working ok?

I can’t see anything (maybe missing mplayer task?) that would divert my suspicion and focus away from a graphics/driver/kernel/dri/drm issue. If it is in that area, unfortunately I don’t have nvidia here.

PS. Have you tried it with a basic graphics driver such as “fbdev”, lower performance, but no spikes would help diagnosis?

I forgot about the your desktop and laptop having the same problem. That’s unusual. Were they installed from the same download/installation media? If so, that has to be a prime suspect, unless they share h/w!

I had a similar problem with my desktop too. The solution for me was a update to kernel 2.6.36 with nvidia driver 260.19.12.
Another workaround was to disable GPU temperature monitoring (with the old 2.6.34 kernel).
If your laptop also use nvidia graphics maybe this is your problem.

Cu
Hans

Indeed. When I posted “unless they share h/w” I meant “unless they have any similar h/w”.

There was a lot of discussion about this after 11.3 came out: xorg consuming too much cpu on Nvidia machines. The solution is to replace the kernel. I am running 2.6.35, although I see that someone else on this thread has gone 2.6.36. In any event, up-versioning the kernel is your best bet. Just Google something like “suse 11.3 xorg cpu nvidia kernel”.

I have to add that got the same issue and the kernel upgrade from 6.34 to 6.35 didn’t solve it at all. However I never tried the 6.36 version.

Although I don’t have nvidia, kernel-desktop 2.6.36-90 performs very well on my notebook running KDE. It’s available from OBS, Index of /repositories/Kernel:/HEAD/openSUSE_11.3, and is fairly frequently updated.

Thanx for all your replies!

At the moment my desktop is running kernel version: 2.6.34.7-0.5-desktop, and the nvidia driver is: 256.35. My notebook is an Intel machine with Intel G965 GPU (If I remeber correctly). Not any similar h\w between the two. Also, my laptop is running i586 and the desktop is running x86_64, so its not the same media. I will update to 2.6.36 and see if that solves it.

I have however installed x86_64 on my father’s pc, also with a nvidia gpu, but no problem there and I think that the kernel and nvidia drivers are older than on my desktop, will check that…

The only similarities between my desktop and laptop is basically software…

Thanks!

I’ve upgraded to kernel 2.6.36 and nvidia 260.19… no luck…

Let’s assume it’s not download/media as one out of three installs works with audio/video player. The symptoms appear post installation when you use an application including SMPlayer. Do they show post KDE startup, so what is the situation before you do use an app?

Is audio working properly, e.g. KDE’s System Settings>General (tab)>Multimedia. Are the audio devices correctly listed? Is the “xine” shown as the backend? Can you play a test sound? Have you EXACTLY followed this guide to install multimedia?
Multi-media and Restricted Format Installation Guide (Page down for 11.3)

Have you tried other media player e.g Kaffeine?

BTW, I have “intel” and “intellegacy” drivers on my m/c (GM45 Express chipset). Can we assume you are using “Intel” for the G965?

Hi guys…

I have sort of found the problem… software…

I have re-installed my desktop this morning, but only formatted the root partition and used the same user id. Jip, you’ve guessed right… After re-installation, I had the same problem, the cpu usage spikes were of smaller values, just between 12% and 20%. So I deleted my user acc and home folder, recreated my user acc and logged on… problem solved. I do not yet know what particular software package caused the spikes, but it was definitely not drivers or hardware.

That would explain why it worked on your father’s PC, given a different UID, but not on your two systems. Did you copy/share personal settings between your systems?

Thanks for feeding back. Glad it’s working now. If you find the cause, do let us know if possible. :slight_smile:

That’s interesting.
In my case cpu load comes down again just when I disable plasma compositing. Sometimes I think that this have to do with kwin settings. daniel has also a new kwin & plasma (from scratch).
I think that a kwin settings backup would be a good idea daniel! (kwinrc)