Sunday, December 21, 2014

Xorg High CPU Usage in Ubuntu 14.04

The Issue

I started having some problems recently with xorg using way too much CPU power on my Linux desktop.

I have recently upgraded to Ubuntu 14.04 on this machine ad got stuck after the login screen. I have tracked down the issue with the proprietary ATI/AMD drivers (fglrx). I have managed to get into tty terminal via CTRL+ALT+F2 and I have removed everything to do with proprietary drivers using this guide.

Hence I switched back to open source drivers that were working just fine. The problem being that xorg used a whole core of my dual-core CPU. This is not normal and had to be addressed. I started looking around and found the issue on many forums and posts.

The output of top looks something like this

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 1262 root      20   0  267204  56016  15320 R  55.8  1.1  27:37.97 Xorg
 2641 nargren   20   0 1431604 574100  54096 R  35.9 11.5  11:26.71 firefox
 2435 nargren   20   0 1353536  84540  39284 S  12.6  1.7   1:09.57 compiz

The Solution

I have worked on this for the better part of 2 days and tried multiple methods suggested in different forum threads.

First I have overlooked this thread and tried to look elsewhere, however it has turned out that those methods didn't work. I got curious when I saw that QIII was also having the exact same issue and was using conky, just like me. He claimed using conky on 2 other distros as well, without any issues (on the same machine) so he ruled that one out as the source of the issue. In the end he has upgraded his OS and got rid of the issue (thread from 2012).

I have quickly killed my conky session with
sudo killall conky
to see what happens. And voilĂ ! Checking top immediately revealed what the issue was. After the change, this is how it looked like below.

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 2435 nargren   20   0 1352980  84544  39288 R   4.3  1.7   1:20.38 compiz
 1262 root      20   0  267440  56024  15328 R   4.0  1.1  33:18.70 Xorg
 2993 nargren   20   0  654880  26736  12656 S   3.0  0.5   0:08.41 gnome-terminal

Conclusion

The issue was conky indeed. Hence I have to sacrifice my cool, real-time system information for now. However, I will keep on troubleshooting and see if by changing some settings I can get back my conky.

So if you are having the same issue with xorg and are running conky, try killing it and see if the CPU usage drops.

No comments:

Post a Comment