Tech Monger

Programming, Web Development and Computer Science.

Skip to main content| Skip to information by topic

Unity Compiz CPU Utilization Issue in Ubuntu

If your machine is getting hot after upgrading to Ubuntu 16.04 then you should check for resource utilization by compiz. Ubuntu uses Unity as a default desktop environment which makes use of OpenGL library called compiz for rendering graphics. However after an update you would notice that unreasonable amount of CPU utilization by the compiz process even if your system is idle. Utilization would be at its peak if you open intensive GUI application like web browser.

Check Resource Utilization in Ubuntu 16.04

Run following top command for few minutes and observe the spikes in % CPU and the command(process name).

$ top

  PID USER        PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 4608 techmonger  20   0  365604 156372  68688 R 143.5  7.9   1:32.00 compiz
 5347 techmonger  20   0  592372 186152 102876 S  30.6  9.4   0:27.54 chromium-b+

With above top output we can clearly notice high amount of cpu consumption by compiz with chromium. You would get similar result for firefox or other GUI heavy applications.

Check Core Temperature in Ubuntu 16.04

If your machine is getting very hot then you can check core temperature and fan speed with following.

First install lm-sensors if you have not already installed it.

sudo apt install lm-sensors

Check output of command sensors.

$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +86.5°C  (crit = +87.0°C)

radeon-pci-0100
Adapter: PCI adapter
temp1:        +80.0°C  (crit = +120.0°C, hyst = +90.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +86.0°C  (high = +80.0°C, crit = +90.0°C)
Core 2:       +86.0°C  (high = +80.0°C, crit = +90.0°C)

Adapter: Virtual device
Processor Fan: 5000 RPM
CPU:            +86.0°C  
GPU:            +78.0°C  
Other:          +69.0°C  

As you can see from above output that both core are about to reach critical temperature level.

AMD Graphic Card and Radeon Drivers

If you are using AMD graphic card then this problem will worsen because from Ubuntu 16.04 you will not be able to use propitiatory AMD graphic driver fglrx. You can either use open source Radeon (mostly for old AMD graphic cards) or AMDGPU-Pro (open source version of AMDGPU).

You can check your graphic card information using following command.

lshw -c video

  *-display               
       description: VGA compatible controller
       product: Madison [Mobility Radeon HD 5650/5750 / 6530M/6550M]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0

From above output you will get details of installed graphic card and driver.

driver=radeon

If you are non AMD graphic card user then you may get out of this issue with system tuning and performance optimization.

Solution and Workaround

Unfortunately there is no neat solution to above problem as of as of now. The only workaround available is to switch desktop environment of Ubuntu from Unity to lightweight XFCE.

Switch from Unity to XFCE

Execute following command to install xfce with current unity setup.

sudo apt install xfce4

Once installation is finished then logout your current session and relogin your account by changing default desktop environment from unity to xfce session like below.

Change Unity to XFCE during Login
Ubuntu Change Desktop Environment During Login

Note that above change will make xfce as default desktop envionment for subsequent logins. You can change it to unity back again using same procedure during login. Using similar method you can install other desktop environments of your choice like gnome, kde etc.

Tagged Under : Linux Open Source Ubuntu