Moving windows is very laggy with Compiz

Bug #773861 reported by Nick B. on 2011-04-30
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Compiz Core
Daniel van Vugt
compiz (Ubuntu)
Daniel van Vugt

Bug Description

Binary package hint: compiz

After upgrading to Natty, moving windows around is really laggy. It also happens in the gnome-classic session. It looks to be Compiz related because there is no issue with the gnome classic (no effects) session.

To reproduce, just login to a session with Compiz (gnome classic or Ubuntu Unity session) running, open a window and move it around.

I would expect that moving windows would be smooth. But instead it's really laggy.

Description: Ubuntu 11.04
Release: 11.04

apt-cache policy compiz
  Installed: 1:0.9.4+bzr20110415-0ubuntu2
  Candidate: 1:0.9.4+bzr20110415-0ubuntu2
  Version table:
 *** 1:0.9.4+bzr20110415-0ubuntu2 0
        500 natty/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: compiz 1:0.9.4+bzr20110415-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 270.41.06 Mon Apr 18 14:53:56 PDT 2011
 GCC version: gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,copytex,compiztoolbox,decor,imgpng,place,resize,grid,vpswitch,gnomecompat,regex,animation,snap,move,mousepoll,wall,workarounds,session,expo,ezoom,staticswitcher,fade,scale,unityshell]
CompositorRunning: compiz
Date: Sat Apr 30 01:36:57 2011
DistUpgraded: Log time: 2011-04-29 22:23:52.924774
DistroCodename: natty
DistroVariant: ubuntu
 vboxhost, 4.0.6, 2.6.38-8-generic, x86_64: installed
 nvidia-current, 270.41.06, 2.6.35-28-generic, x86_64: installed
 nvidia-current, 270.41.06, 2.6.38-8-generic, x86_64: installed
 nVidia Corporation GF104 [GeForce GTX 460] [10de:0e22] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Micro-Star International Co., Ltd. Device [1462:2321]
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
InstallationMedia_: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
JockeyStatus: xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, Not in use)
MachineType: System manufacturer System Product Name
PackageArchitecture: all
 PATH=(custom, user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-8-generic root=UUID=d93b8bfd-e3f2-4b07-b10a-be720532f483 ro quiet splash vt.handoff=7
ProcVersionSignature_: Ubuntu 2.6.38-8.42-generic
Renderer: Unknown
SourcePackage: compiz
UpgradeStatus: Upgraded to natty on 2011-04-30 (0 days ago) 06/17/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 2102
dmi.board.asset.tag: To Be Filled By O.E.M. M4A79XTD EVO
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev X.0X
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr2102:bd06/17/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnM4A79XTDEVO:rvrRevX.0X:cvnChassisManufacture:ct3:cvrChassisVersion: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
version.compiz: compiz 1:0.9.4+bzr20110415-0ubuntu2
version.ia32-libs: ia32-libs 20090808ubuntu13
version.libdrm2: libdrm2 2.4.23-1ubuntu6
version.libgl1-mesa-dri: libgl1-mesa-dri 7.10.2-0ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.2-0ubuntu2
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg: xserver-xorg 1:7.6+4ubuntu3
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu4
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu7
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu7

Related branches

Nick B. (futurepilot) wrote :
Daniel van Vugt (vanvugt) wrote :

No longer a duplicate of bug 92599. Seems to be different.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Daniel van Vugt (vanvugt) wrote :

Nick, When you say "laggy", do you mean:

(a) the windows appear to stutter in a jerky way?; or
(b) tearing is visible (horizontal lines where moving windows look sheared)?; or
(c) that they smoothly lag a long way behind the mouse pointer?; or
(d) some combination of the above options?

Please change the status back to Confirmed when the question has been answered. Thanks...

Changed in compiz (Ubuntu):
status: Confirmed → Incomplete

The correct one is (a). For what it's worth, I've found that Kwin and Mutter do not have this problem, but Metacity's built in compositor (the XRender one) also does.

    Status Confirmed

On 11/25/2011 03:13 AM, Daniel van Vugt wrote:
> Nick, When you say "laggy", do you mean:
> (a) the windows appear to stutter in a jerky way?; or
> (b) tearing is visible (horizontal lines where moving windows look sheared)?; or
> (c) that they smoothly lag a long way behind the mouse pointer?; or
> (d) some combination of the above options?
> Please change the status back to Confirmed when the question has been
> answered. Thanks...
> ** Changed in: compiz (Ubuntu)
> Status: Confirmed => Incomplete

Nick B. (futurepilot) on 2011-11-26
Changed in compiz (Ubuntu):
status: Incomplete → Confirmed
Daniel van Vugt (vanvugt) wrote :

Nick, please try ppa:vanvugt/compiz ( which contains several related fixes that are being planned for Ubuntu 12.04. If the PPA works then this is a duplicate of one of those bugs already being fixed (not sure which).

If the PPA does not solve this problem for you then please change the status back to Confirmed...

Changed in compiz (Ubuntu):
status: Confirmed → Incomplete
assignee: nobody → Daniel van Vugt (vanvugt)
Daniel van Vugt (vanvugt) wrote :

P.S. You will need to upgrade to 11.10 in order to test the PPA. Sorry about that, but I can only develop and test on so many different releases at once.

Changed in compiz (Ubuntu):
status: Incomplete → Confirmed
Daniel van Vugt (vanvugt) wrote :

Hmm, confirmed by multiple duplicates (and more I just found).

All; please try ppa:vanvugt/compiz ( and leave a comment as to whether it solved this bug for you.

Nick B. (futurepilot) wrote :

I will test this as soon as possible. It may take a week or so for me to test this as my computer is currently broken.

On 12/10/2011 01:01 AM, Daniel van Vugt wrote:
> Hmm, confirmed by multiple duplicates (and more I just found).
> All; please try ppa:vanvugt/compiz
> ( and leave a comment as
> to whether it solved this bug for you.

Daniel van Vugt (vanvugt) wrote :

Note to self, and Compiz developers...

I managed to fix this bug by hacking the CompTimer source priority; lowering the priority to around "IDLE" level. This allows compiz time to process all pending X events (such as mouse motion) before rendering each frame. Unfortunately it's not a fix I can recommend right now because it created bugs with full-screen painting modes.

I think an alternative fix might be possible by optimizing the compiz "move" plugin to reduce the overhead associated with handling so many motion events. Especially when there are multiple such events pending and you know the newest one is the only one that's really important.

Omer Akram (om26er) wrote :

and the smoothness of moving windows in gnome-shell :-)

Changed in compiz (Ubuntu):
importance: Undecided → Medium
Changed in compiz-core:
importance: Undecided → Medium
status: New → Confirmed
Changed in compiz-core:
assignee: nobody → Daniel van Vugt (vanvugt)
Daniel van Vugt (vanvugt) wrote :

Hmm, the priority fix seems to work when combined with the fix for improved timer scheduling fairness (bug 897045). This now looks easy to do.

Changed in compiz-core:
status: Confirmed → In Progress
Changed in compiz (Ubuntu):
status: Confirmed → In Progress
Daniel van Vugt (vanvugt) wrote :

Hey all... Please wait for version "vv6" to be published before testing the fix for this bug in ppa:vanvugt/compiz.

Omer Akram (om26er) wrote :

every performance issue is important, raised priority.

Changed in compiz-core:
importance: Medium → High
Changed in compiz (Ubuntu):
importance: Medium → High
tags: added: performance
removed: needs-reassignment
Goddard (kinggoddard) wrote :

I tested your fix Daniel. It didn't fix the issue. I have the same card as the user that posted this bug except mine is the 460M not the 460.

I added your ppa and then did an apt-update then apt-get install compiz and still same issue after fresh reboot.

Let me know if you need more help to debug.

Daniel van Vugt (vanvugt) wrote :

Could you please report the version of compiz you have installed and provide a video of the lag still happening?

Daniel van Vugt (vanvugt) wrote :

Also, I suspect there are two very different bugs here, and maybe we need to treat them separately...

1. Moving windows lagging behind the mouse pointer by a few frames; a few milliseconds.

2. Moving windows lagging behind the mouse pointer by 1-2 seconds; windows appear to freeze when dragging.

Everyone -- please add comments describing whether ppa:vanvugt/compiz helps you and which of the above issues you have.

Moko (haohmaru2040) wrote :

Before adding ppa:vanvugt/compiz, I had lagging type 1 as well as type 2. windows move smoothly for some time when I restarted unity, but after some time window movement always got really jerky.
applying your fix basicly eliminates the lags most of the time, but jerkyness (inconsistent lag; ranging from like 1ms to like 1 sec.) still occurs from time to time.

While your fix defenitly helped with the overall smoothness of moving windows, there still seems to be another issue...

Daniel van Vugt (vanvugt) wrote :

A potential workaround to either bug is to reduce the sample rate of your mouse to about 2x the refresh rate of your monitor. It's normally about 16x by default so compiz and xorg have to process up to 16 window movements every screen refresh. Obviously you can only every see 1 movement per refresh on the screen so it's a waste. But I recommend using 2x the refresh rate to ensure everything stays smooth. Sorry I haven't researched/tested how to do this yet.

Daniel van Vugt (vanvugt) wrote :

Please also test ppa:vanvugt/unity at the same time as ppa:vanvugt/compiz. The unity PPA contains a fix for a severe performance bug 861061, which slows down all compiz redraws in Ubuntu 11.10.

Daniel van Vugt (vanvugt) wrote :

Nick B. (futurepilot) -- please answer comment #17.

Daniel van Vugt (vanvugt) wrote :

I have reverted the proposed fix for this bug in ppa:vanvugt/compiz, but kept the critical timing fixes which I think will still help significantly. In theory this might eliminate some jerkiness (skipped frames). Please update and try the new version "vv7". Let me know if it's any better, and what version you think it's better/worse than.

Andrea Cimitan (cimi) wrote :

I've tried ppa:vanvugt/compiz, and for the moment I can easily see performance improvements.
I tested before with "samegame" qml demo from qt creator, which exposed performance issues compared to metacity (like 1:3 FPS). Now it seems on pair

Andrea Cimitan (cimi) wrote :

I don't know if it's related to that, but 2 compiz sessions (unity3d) fail miserably today... I can only use one user

Jeroen Hoek (mail-jeroenhoek) wrote :

The new version is an improvement to some extent. It looks I get more redraws than before. The skipping now seems more erratic than before. Please let me know if you want another video showing the behaviour.

I'm afraid however that from a user's perspective the difference is negligible; on systems suffering from this bug Unity is not in a very usable state. :(

In any case, your efforts are greatly appreciated. From what I can gather the root-cause seems to be NVidia's closed source driver not giving back correct data.

Giorgio Wicklein (giowck) wrote :

Hi, here just a video showing that unity with compiz is not usable on my netbook (eeepc 1005HA)

Daniel van Vugt (vanvugt) wrote :

Andrea, your frame rate issue is probably bug 861061. You need ppa:vanvugt/unity for that.

Bucic (bucic) wrote :

I've used the latest versions both from ppa:vanvugt/compiz and ppa:vanvugt/unity and still no luck. AMD graphics here.

Ubuntu 11.10 amd64
kernel: 3.1.0-030100-generic ***
Lenovo Thinkpad T500
AMD Catalyst 11.10 for Mobility Radeon HD 3650
My settings (just in case):
 Sync to VBlank - OFF
 AMD: Tear-free - ON
 AMD: Wait for vertical - Always
(Same with other combinations of these settings for that matter...)

*** But I've been using different versions recently and have naever noticed any improvements re our case here. I tried kernels from 2.6.34 up to my current one (few of them).

Bucic (bucic) wrote :

Please note that animations like Win+W, minimizing/maximizing and all alike are perfectly smooth. Only dragging windows seems to cause stuttering. And the stuttering occurs after a second or few, not right away.

Also an issue on Precise.

fglrx: 2:8.920-0ubuntu1
compiz: 1:0.9.6+bzr20110929-0ubuntu8

Bruno Santos (bsantos) wrote :

Daniel, is it normal for vv7 to be worse while using nouveau?

I have been trying your ppa waiting it would eventually fix the lag in window drawing while resizing, but I never noticed the window lagging behind before like others reported. In my system, with the package in main the windows move normally.

With vv7 the windows started lagging behind like others are reporting for the first time with my system, which is weird, since it should be better than the current version in main (oneiric-updates), right?

I purged your ppa and everything is back to normal, windows still lag while resizing but they don't when moved around. In vv6 I'm almost sure the windows resized more smoothly, though, but I'd have to try it again.

I have a GeForce 9800 GT.

Is this relevant besides the regression with the nouveau driver? Is any information or test I can do to help you diagnose the issue?

Bruno Santos (bsantos) wrote :

vv7 also adds lag to window movement on my intel laptop, can anyone else confirm this?

Daniel van Vugt (vanvugt) wrote :

vv7 _removed_ the experimental fix for this bug because it could theoretically make things worse. It seems like it actually made things better for some of us. But some of us are not all of us.

ppa:compiz/vanvugt does contain some fixes that might make this bug better or worse, but it presently (vv7) does not contain an explicit fix for this bug.

Now I've got another machine set up that can reproduce both problems, a proper fix will be possible. But I haven't started yet.

Please, no more "me too" comments until a new fix has been announced. But I would really like Nick B. (futurepilot) to reply to comment #17...

Nick B. (futurepilot) wrote :

Daniel, I am seeing the second case in comment 17.

Bucic (bucic) wrote :

I think my comment won't fall into "metoo" category.
It seems it fixed the problem for me somewhat but only for kernel 3.0.0-14-generic. When I tried to switch to 3.1.4 or 3.2.*rc* I got laggy (heavy, not stuttering as before) windows while dragging. I said 'somewhat' because I'm not even sure if 'complete unity 3D' is running, as I don't see >any< alt-tab switcher nor Win+W actions. Win+S works but it looks like in Unity 2D even though I'm sure I've logged into Unity (i.e. Unity 3D).

Ubuntu 11.10 amd64
 kernel: 3.0.*14*
 Lenovo Thinkpad T500
 AMD Catalyst 11.10 for Mobility Radeon HD 3650

dpkg -l |grep unity-common
ii unity-common 4.24.0-0ubuntu2b1vv5

Nick B. (futurepilot) wrote :

ppa:compiz/vanvugt vv8 does not make a difference. Window moving is still very choppy. Windows appear to freeze when moving them. I also added ppa:vanvugt/unity and that did not make a difference either.

Bucic (bucic) wrote :

Installed version: 1:0.9.6+bzr20110929-0ubuntu6vv7
Available version: 1:0.9.6+bzr20110929-0ubuntu6vv8

sorry for doubleposting...

Daniel van Vugt (vanvugt) wrote :

All, please don't expect a proper fix for this bug until PPA version vv9 at least. I haven't started work on it yet!

Daniel van Vugt (vanvugt) wrote :

Thanks Nick... this allows me to clarify the duplicates situation.

Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 764330, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers