unity transparency seems to use CPU

Bug #1010898 reported by Dimitri Nüscheler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Expired
Undecided
Unassigned
unity (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

When I play a video or open an opengl game and then open the dash or press the Super-Key until the Dash-Help appears, then the CPU usage is utilized heavily while the HUD shows up, when I expected no increased CPU usage after the transitition (which is sluggish by the way), because no additional operations on the CPU need to be done after the dash help is opened. The only thing I can think of is transparency which needs to be calculated, because the video is playing always needs to be updated, but this shouldn't increase CPU usage, because it _should_ take place on the GPU for being a purely graphical operation which my graphics can do easily (blur inclusive).

The CPU utilization is lower if you switch from blur to no blur, so this fortifies my assumption that the actual graphical transparency calculation takes place on the CPU or that some ping pong effect moves buffers from GPU to CPU and back, slowing things down, i don't know after all.

Playing a video increases compiz CPU utilization from ~5 to ~20 and and Xorg cpu utilization from ~5 to ~28

Also the FPS of video games decreases when the dash is activated, with blur even more.

Last but not least, when I playback a video and activate the dash or the dash help the video shortly interrupts for about ~200ms.

For comparison:
The single-parameter transparency of the compiz-plugin "Opacity, Brightness and Saturation" does not affect CPU usage at all, at least not visibly.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: unity 5.12-0ubuntu1.1
ProcVersionSignature: Ubuntu 3.2.0-24.39-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Ist ein Verzeichnis: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 295.49 Mon Apr 30 23:46:33 PDT 2012
 GCC version: gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
.tmp.unity.support.test.0:

ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
CompizPlugins: [core,composite,opengl,decor,gnomecompat,place,move,snap,mousepoll,resize,compiztoolbox,imgpng,vpswitch,session,grid,regex,wall,unitymtgrabhandles,animation,expo,ezoom,workarounds,fade,scale,unityshell]
CompositorRunning: compiz
Date: Sat Jun 9 16:02:48 2012
DistUpgraded: Fresh install
DistroCodename: precise
DistroVariant: ubuntu
DkmsStatus:
 nvidia-current, 295.40, 3.2.0-24-generic, x86_64: installed
 nvidia-current-updates, 295.49, 3.2.0-24-generic, x86_64: installed
GraphicsCard:
 NVIDIA Corporation G98M [GeForce G 105M] [10de:06ec] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Acer Incorporated [ALI] Device [1025:0205]
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
JockeyStatus:
 xorg:nvidia_current - Beschleunigter Grafiktreiber von NVIDIA (Proprietär, Deaktiviert, Nicht benutzt)
 xorg:nvidia_current_updates - NVIDIAs beschleunigte Grafiktreiber (Nachträgliche Aktualisierungen) (Proprietär, Aktiviert, In Benutzung)
MachineType: Acer Aspire 5738
ProcEnviron:
 LANGUAGE=de_CH:de
 PATH=(custom, user)
 LANG=de_CH.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-24-generic root=UUID=954648ee-fb9c-484d-bda9-6e49dc0e779a ro quiet splash vt.handoff=7
SourcePackage: unity
UpgradeStatus: No upgrade log present (probably fresh install)
XorgConf:
 Section "Device"
  Identifier "Default Device"
  Option "NoLogo" "True"
 EndSection
dmi.bios.date: 02/20/2009
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: V1.03
dmi.board.name: JV50
dmi.board.vendor: Acer
dmi.board.version: Rev
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrV1.03:bd02/20/2009:svnAcer:pnAspire5738:pvr0100:rvnAcer:rnJV50:rvrRev:cvnAcer:ct10:cvrN/A:
dmi.product.name: Aspire 5738
dmi.product.version: 0100
dmi.sys.vendor: Acer
version.compiz: compiz 1:0.9.7.8-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.32-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.2-0ubuntu3.1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.2-0ubuntu3.1
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu10.2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20111219.aacbd629-0ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.17.0-1ubuntu4
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20111201+b5534a1-1build2

Revision history for this message
Dimitri Nüscheler (dimitri-nuescheler) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

With intel graphics I find the opposite -- compiz CPU consumption is much lower when the blur is active. This is probably because it halves the frame rate that compiz can achieve :(

If you're finding CPU is higher in this case then it's probably a lot to do with the NVIDIA driver, which is known to hog the CPU much more than other drivers.

Revision history for this message
Dimitri Nüscheler (dimitri-nuescheler) wrote :

When I switch to the nouveau driver I have the same behaviour as you with Intel graphics.

But do we know where transparency is calculated, do you know?

Assuming it uses the CPU, then the reason why nouveau and intel drivers don't utilize the CPU is as you said a lower frame rate such that transparency calculations don't need to be done that often. But then there must be some bottleneck elsewhere. The drivers readback? (If it's done on the CPU it must use the readback, because the already composited stuff isn't found anywhere in the CPU memory - right?).

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

Dimitri, I think unity's blurring method is probably inefficient. Certainly it seems so when compared to Windows 7 on the same hardware. However I won't criticise the Unity code too much while I have nothing better to offer.

Revision history for this message
Dimitri Nüscheler (dimitri-nuescheler) wrote :

I concluded slightly wrong in my last post. If blurring can lower CPU usage it is likely that it doesn't take place on the CPU.

I wouldn't know about Windows 7 - I know it has some blur, but only for very small areas as far as I remember.

And blur isn't really my problem because I can live without it, but then there is still the normal transparency which slows things down a bit.

I might be a bit picky about performance and smoothness, in my opinion anything below a constant 60 frames per second is bad, but 10.04 is that smooth on my (not very old) system. Even on a 7 year old laptop of mine with intel graphics. Unfortunately it is no longer supported in a year.

A workaround would be to disable transparency (but that's not possible - or is it?), or to use static transparency (but that looks inconsistent, and also causes a slight delay during the transition from desktop to dash).

Revision history for this message
Dimitri Nüscheler (dimitri-nuescheler) wrote :

I did a further test, again with the initial configuration (Nvidia proprietary driver). I started ET Racer on a slope and maximized the window.

I then set the background of the gnome-terminal to transparent. The impact of the terminal maximized with top running in it equals the impact of the gnome-terminal made transparent using the Opacity..-Plugin in CCSM -> no impact.

So I don't just have single parameter transparency being faster than unitys transparency, but also transparency where the font remains opaque - just like unity.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Can you still reproduce this problem?

Changed in unity:
status: New → Incomplete
Changed in unity (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for unity (Ubuntu) because there has been no activity for 60 days.]

Changed in unity (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Unity because there has been no activity for 60 days.]

Changed in unity:
status: Incomplete → Expired
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.