Ubuntu

[regression] [precise] 3D apps run much slower under Unity

Reported by Achim on 2012-04-23
278
This bug affects 53 people
Affects Status Importance Assigned to Milestone
Ubutter
Undecided
Unassigned
Unity
High
Daniel van Vugt
5.0
High
Daniel van Vugt
unity (Ubuntu)
High
Daniel van Vugt
Precise
High
Unassigned

Bug Description

[Test Case]
No obvious test case - performance regression. Just confirming that graphics are less choppy than before.

[Regression Potential]
Trivial fix, no obvious regression potential.

Original description:

This is a performance regression specific to the unityshell plugin. While enabled, graphics are slightly choppy and do not perform as well as Gnome Shell etc. Simply disabling the unityshell plugin seems to solve the problem and graphics are smooth again.

ORIGINAL DESCRIPTION:
1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04

2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
compiz:
  Installiert: 1:0.9.7.6-0ubuntu1
  Kandidat: 1:0.9.7.6-0ubuntu1
  Versionstabelle:
 *** 1:0.9.7.6-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
unity:
  Installiert: 5.10.0-0ubuntu6
  Kandidat: 5.10.0-0ubuntu6
  Versionstabelle:
 *** 5.10.0-0ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

3) What you expected to happen
3D-Apps should run much faster.

4) What happened instead
I upgraded my system from ubuntu 11.10 (was using PPA from Daniel van Vugt) to 12.04
and then I noticed that 3D-Apps are running slow with unity.
I have noticed this with ioquake3, xbmc, blocks that matter, revenge of the titans…

I compared the performance of ioquake as an example:
1260 frames 21.1 seconds 59.6 fps 8.0/16.8/34.0/3.0 ms compiz gnome classic (2 gnome panels)
1260 frames 34.4 seconds 36.6 fps 6.0/27.3/52.0/7.8 ms unity

The target FPS should be 60 FPS (Monitor has 60Hz).
I also have attached some information about my system (gfx_info.log).

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: unity 5.10.0-0ubuntu6
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
Uname: Linux 3.2.0-23-generic x86_64
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
CheckboxSubmission: 13741649d6b2dd56d757d58c3d964436
CheckboxSystem: da9af3b901b5569a389df6337f3d812f
CompizPlugins: [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
Date: Mon Apr 23 15:44:26 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110906)
SourcePackage: unity
UpgradeStatus: Upgraded to precise on 2012-04-19 (3 days ago)

Related branches

lp:~vanvugt/unity/fix-987304
Merged into lp:unity at revision 2366
Andrea Azzarone: Approve on 2012-05-23
Marco Trevisan (Treviño): Approve on 2012-05-23
Łukasz Zemczak: Approve on 2012-05-23
Tim Penhey (community): Approve on 2012-05-23
Achim (ach1m) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in unity (Ubuntu):
status: New → Confirmed
Changed in unity:
status: New → Confirmed
summary: - [Performance Regression Again] 3D-Apps are running slow with unity
+ [regression] [precice] 3D apps run much slower under Unity
summary: - [regression] [precice] 3D apps run much slower under Unity
+ [regression] [precise] 3D apps run much slower under Unity
Changed in unity:
milestone: none → 5.14.0
Daniel van Vugt (vanvugt) wrote :

FYI, this is a regression because we only fixed the same issue in oneiric fairly recently --> bug 861061.

Florin Coras (fcoras) wrote :

Foremost, apologies if this is not the right thread to post my observations or if they have been previously mentioned. I have an nvidia board and use the proprietary drivers. Like in oneiric, 3D applications (e.g., glxspheres) do run well after a reboot however, after using a couple of compiz animations (wall, scale) performance drops considerably. Furthermore, 2D performance also drops in applications like Thunderbird, where scrolling in a long list of email headers is very choppy and results in high CPU usage.

Recently, I discovered that just changing the screen refresh rate from nvidia-settings, back and forth between 50Hz and 60Hz, is enough to restore performance (including 2D). I noticed it because my screen's refresh rate is 60Hz however, by default, nvidia-settings reports it as 50Hz and refuses to remember my setting. I also manually set the refresh rate in CCSM at 60Hz. Hope this helps!

Moses Palmér (mosespalmer) wrote :

I have the same issue I think.

Any animation in Compiz, when using the nvidia driver and not nouveau and having the unity plugin active, is a series of "smooth jerky movements". That is, the movement is very smooth, but it stops randomly.

It is most pronounced with scale and wall, and not at all noticeable with wobbly unless the cursor is along a screen edge and the maximise grid is shown.

If I disable the unity plugin, every animation immediately becomes very smooth---in fact as smooth as in the old days of Gnome 2+Compiz.

If I uninstall the nvidia driver and use nouveau instead, the jerkiness disappears, but the smoothness as well. Also, the dash becomes close to unusable since it takes about a second for a letter to appear after I have typed it.

Graphics card: nVidia GeForce 6200 LE
Driver version: 295.40

> lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04

> apt-cache policy compiz
compiz:
  Installed: 1:0.9.7.8-0ubuntu1
  Candidate: 1:0.9.7.8-0ubuntu1
  Version table:
 *** 1:0.9.7.8-0ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ precise-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     1:0.9.7.6-0ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

> apt-cache policy unity
unity:
  Installed: 5.12-0ubuntu1
  Candidate: 5.12-0ubuntu1
  Version table:
 *** 5.12-0ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ precise-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     5.10.0-0ubuntu6 0
        500 http://se.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

Daniel van Vugt (vanvugt) wrote :

Moses, I think you might have a few different issues, but also this bug...

1. Slight pauses in animations: That could be this bug (Unity interfering in compiz GL rendering too much), but it could also be related to switching rendering modes during animations. Please try this as a workaround:
(a) Run ccsm
(b) In Workarounds, enable "Force full screen redraw (buffer swap) on repaint".

2. Disabling Unity makes everything smooth again: Yes that's this bug.

3. Smoothness disappears when switching from nvidia to nouveau drivers: This is a problem with the default nouveau driver settings. You can fix it by editing /etc/X11/xorg.conf and adding:

# For nouveau only:
Section "Device"
 Identifier "My Graphics"
 Option "GLXVBlank" "on"
EndSection

Then log out and in again for it to take effect.

Moses Palmér (mosespalmer) wrote :

Daniel,

I tried 1, but that had no effect: the paues remain.

I also added GLXVBlank on to my Device section (since there is no xorg.conf needed when using nouveau, I simply created a file containing the text you provided, and according to /var/log/Xorg.0.log, it had an effect), but that did not make a difference. The "lack of smoothness" that I experience is more like dropping frames because there is not time to render them.

If I disable the unity plugin when using nouveau, everything immediately becomes smooth again, so I definitely think that the plugin is doing something funny.

Is there anything else I can do to help locating the cause of the issue?

Daniel van Vugt (vanvugt) wrote :

Thanks Moses. It sounds like this is definitely the bug causing your problems. Sorry I have no more suggestions right now.

Stefan Glasenhardt (glasen) wrote :

Hi Daniel,

I bisected the source code of Unity a little and i think i've found at least one revision which is causing the slowdown:

rev. 2226:

* Fix for bug #839480
* Fix rendering of the Dash, Launcher and Panel when "NO_BLUR" is selected in CCSM
* Added support to get a none blurred region of the display from BackgroundEffectHelper. Fixes: https://bugs.launchpad.net/bugs/839480, https://bugs.launchpad.net/bugs/941066. Approved by Gord Allott, Brandon Schaefer, Jason Smith.

When using Unity up to rev. 2225 moving windows around on the desktop and scrolling e.g. in Firefox is smooth and fast. Using rev. 2226 moving windows gets jerky and scrolling is slow. The latency of the whole desktop is much better with rev. 2225.

Benchmark with OpenArena (Running in a window):

Unity v5.12 -> 840 frames 41.6 seconds 20.2 fps 13.0/49.5/129.0/12.5 ms
rev. 2226 -> 840 frames 41.6 seconds 20.2 fps 20.0/49.5/117.0/11.1 ms
rev. 2225 -> 840 frames 36.6 seconds 22.9 fps 15.0/43.6/103.0/12.3 ms
Compiz -> 840 frames 29.8 seconds 28.2 fps 4.0/35.5/441.0/15.5 ms
IceWM -> 840 frames 25.0 seconds 33.6 fps 7.0/29.8/76.0/8.0 ms

The difference between rev. 2225 and 2226 is not that high but the desktop does not feel sluggish up to rev. 2225. After rev. 2226 the whole desktop feels like Unity 4.x before your FBO-fix with introduced. But as you can see Unity has a huge impact on the 3D-performance because when running Compiz without the Unity-Plugin the framerate of OpenArena is much higher.

Changed in unity:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in unity (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Daniel van Vugt (vanvugt) wrote :

Thanks Stefan. I thought it looked like another FBO performance regression (like bug 861061), but am kind of surprised to see that we might have made the same mistake twice (now in the fix for 839480).

Changed in unity:
status: Confirmed → In Progress
importance: Undecided → High
Changed in unity (Ubuntu):
importance: Undecided → High
Stefan Glasenhardt (glasen) wrote :

Just tried your fix on two computers (Intel X3100 and ATI 4850 with FGLRX) and the slowdown has disappeared.

Just one question:

Is it possible that the general slowdown of (windowed?) OpenGL-apps is also related to some FBO-bug?

Daniel van Vugt (vanvugt) wrote :

Stefan, this bug would affect all apps. Windowed and fullscreen. 3D and 2D. The reason why I left 3D in the title is so that most people experiencing the bug will find this one and not log duplicates. Because you generally only notice frame rate problems in 3D apps.

Achim (ach1m) wrote :
Download full text (3.2 KiB)

I have tested the ppa from +Stefan Glasenhardt (glasen) and I have noticed that the fix doesn't solve the problem entirely.

unity:
  Installiert: 5.12.1~glasen~ppa1
  Kandidat: 5.12.1~glasen~ppa1
  Versionstabelle:
 *** 5.12.1~glasen~ppa1 0
        500 http://ppa.launchpad.net/glasen/unity-performance-fix/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
     5.12-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     5.10.0-0ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
compiz:
  Installiert: 1:0.9.7.8-0ubuntu1
  Kandidat: 1:0.9.7.8-0ubuntu1
  Versionstabelle:
 *** 1:0.9.7.8-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.7.6-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
xserver-xorg-video-intel:
  Installiert: 2:2.19.0-0ubuntu1~xup1
  Kandidat: 2:2.19.0-0ubuntu1~xup1
  Versionstabelle:
 *** 2:2.19.0-0ubuntu1~xup1 0
        500 http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
     2:2.17.0-1ubuntu4 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

This are my results from ioquake 3 in window mode with a resolution of 1280x720.
Desktop resolution is 1920x1080.

1260 frames 26.3 seconds 48.0 fps 4.0/20.9/40.0/5.8 ms unity fix 50 Hz
1260 frames 25.3 seconds 49.8 fps 3.0/20.1/42.0/7.2 ms unity fix 60 Hz
1260 frames 25.2 seconds 50.0 fps 9.0/20.0/38.0/3.5 ms gnome classic compiz 50 Hz
1260 frames 21.5 seconds 58.7 fps 6.0/17.0/34.0/3.8 ms gnome classic compiz 60 Hz

                      IOquake3 1280x720 60Hz in Window-mode

  65 +---------------------------------------------------------------------+
  64 +--------------------------------------------Frames Per Second-******-+
  63 +---------------------------------------------------------------------+
  62 +---------------------------------------------------------------------+
  60 +---------------------------------------------------------------------+
  59 +---------------------------------------------------------------------+
  58 +--------------------------------------------------------**********---+
  57 +--------------------------------------------------------*--------*---+
  56 +--------------------------------------------------------*--------*---+
  55 +--------------------------------------------------------*--------*---+
  54 +--------------------------------------------------------*--------*---+
  53 +--------------------------------------------------------*--------*---+
  52 +--------------------------------------------------------*--------*---+
  50 +--------------------------------------**********--------*--------*---+
  49 +---------------------**********-------*--------*--------*--------*---+
  48 +---**********--------*--------*-------*--------*--------*--------*---+
  47 +---*--------*--------*--------*-------*--------*--------*--------*---+
  46 +---*--------*--------*--------*-------*--------*--------*--------*---+
  45 +---**********--------*******...

Read more...

Achim (ach1m) wrote :

Could it be that something in NUX is responsible for the rest of the performance regression?
I have attached a perf report, that I recorded while I was running ioquake3.
So I am not an expert in such thing but I hope this report is somehow helpful.

Moses Palmér (mosespalmer) wrote :

I can confirm the observations made by Achim.

I first tried the PPA with nouveau, and did not notice any visible change.

When I activated the binary nvidia driver, however, the change was quite obvious. The slowdowns are not entirely gone, but they disappeared for the expo animation entirely, and there is only one during the scale animation instead of three-four.

Now, I wish I could use the nvidia driver instead of nouveau, but it causes compiz to segfault on startup when the desktop loads, and I must open a terminal from nautilus by opening a directory on the desktop and then start unity from there...

Daniel van Vugt (vanvugt) wrote :

Thanks Achim. Now I've upgraded my desktop to 12.04 I can confirm the bug is not fully solved by my fix (the fix for bug 861061). The unityshell plugin still slows down rendering quite a bit.

Daniel van Vugt (vanvugt) wrote :

Moses, all, please do not switch drivers while testing fixes for this bug. The performance bottlneck is in Unity itself so to accurately test fixes to unity you need to keep a stable baseline (the same driver).

description: updated
description: updated
Vadim Peretokin (vperetokin) wrote :

I've had this regression as well. Surprised there's been no development on it for a month, it's pretty affecting gaming-wise. This is on a high-end GTX 560.

Changed in unity:
status: In Progress → Fix Committed
Daniel van Vugt (vanvugt) wrote :

FYI, only half of the fix for this bug has been committed. That is the re-introduction of the fix for bug 861061.

I wonder if we should keep the bug in progress till the other half is complete, or to split the bug in two?

Changed in unity:
milestone: 5.14.0 → 6.0
Daniel van Vugt (vanvugt) wrote :

I have decided to keep this bug in progress because comment #13 shows the fix committed so far is not sufficient to solve the problem for Achim who is the original reporter.

Changed in unity:
status: Fix Committed → In Progress
Changed in unity (Ubuntu):
milestone: none → quantal-alpha-1
Changed in unity:
status: In Progress → Fix Committed
Changed in unity (Ubuntu):
status: Confirmed → Fix Committed
Changed in unity (Ubuntu Precise):
status: New → In Progress
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 5.12-0ubuntu2

---------------
unity (5.12-0ubuntu2) quantal; urgency=low

  * Cherry pick upstream fixes.
    - Fix UnityViewWindow background when blur is disabled (LP: #989291)
    - App icon on the Unity Launcher lost track of running
      instance (LP: #772063)
    - No launcher icon or Alt+Tab entry for Gimp windows (LP: #995916)
    - Locked smuxi launcher icon does not indicate smuxi running
      status (LP: #999820)
    - Fix dash search field hidden by tooltips (LP: #978030)
    - Launcher is silent to screen reader users (LP: #949448)
    - Fix 3D apps running much slower under Unity (LP: #987304)
    - Reduced number of calls to ResultViewGrid::QueueDraw
    - Reduced number of calls to BGHash::RefreshColor
 -- Alan Pope <email address hidden> Wed, 23 May 2012 18:10:49 +0100

Changed in unity (Ubuntu):
status: Fix Committed → Fix Released

Will unity-5.12-0ubuntu2 be released for Precise? Or we have to wait to SRU1? Is there an estimated release date for SRU1?

Achim (ach1m) wrote :

+Nicolás Abel Carbone you have to wait for SRU1 and as you can see hear https://launchpad.net/unity/+milestone/5.14.0
under the heading *Expected:* there is no release date present.

Sebastien Bacher (seb128) wrote :

5.12-0ubuntu2 has been uploaded as -0ubuntu1.1 to precise as well, it should be accepted to precise-proposed later today

Hello Achim, or anyone else affected,

Accepted unity into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in unity (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Daniel van Vugt (vanvugt) wrote :

Achim - As per comment #13 and #20 I don't believe this fix will solve your particular problem completely.

However now the bug has been linked to a stable release update, it would probably be inappropriate to re-open. Perhaps we should change the description to clarify that this bug only fixes the re-introduction/regression of bug 861061 (in Unity 5.10).

I expect another bug should be opened to continue working on the remaining performance problems.

Achim (ach1m) wrote :

I would say the »fix« is an improvement but there are still ~15% less FPS compared to compiz without unity.

ioquake3 1280x720 window mode
1260 frames 25.9 seconds 48.7 fps 4.0/20.5/44.0/6.9 ms 50Hz
1260 frames 25.0 seconds 50.3 fps 3.0/19.9/44.0/7.4 ms 60Hz

unity:
  Installiert: 5.12-0ubuntu1.1
  Kandidat: 5.12-0ubuntu1.1
  Versionstabelle:
 *** 5.12-0ubuntu1.1 0
        500 http://archive.ubuntu.com/ubuntu/ precise-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     5.12-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     5.10.0-0ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Sebastien Bacher (seb128) wrote :

> I would say the »fix« is an improvement

thanks, setting to verification-done for the purpose of that SRU round then, as Daniel said remaining issues should be tracked in another bug

tags: added: verification-done
removed: verification-needed
Alejandro Pulver (alepulver) wrote :

I still notice stuttering after adding precise to update sources. They are more "concentrated" now (one per 2 seconds approximately), but in between the games flow smoother than before.

Achim, have you reported another bug yet?

Achim (ach1m) wrote :

Alejandro Pulver, I haven't reported any new bugs related to compiz or unity.

I think I should report at least two new bugs.
One for low FPS and the other for none constant FPS.

This behavior is very visible in apps like xbmc or vdr-sxfe.
With a refresh rate of 50Hz and 25 FPS for the video there shouldn't be any stuttering.

I think that tomorrow I have a bit time to report these two issues.

Achim (ach1m) wrote :

Okay, I filled a new bug for the remaining performance problems.
bug 1005074

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 5.12-0ubuntu1.1

---------------
unity (5.12-0ubuntu1.1) precise-proposed; urgency=low

  * Cherry pick upstream fixes.
    - Fix UnityViewWindow background when blur is disabled (LP: #989291)
    - App icon on the Unity Launcher lost track of running
      instance (LP: #772063)
    - No launcher icon or Alt+Tab entry for Gimp windows (LP: #995916)
    - Locked smuxi launcher icon does not indicate smuxi running
      status (LP: #999820)
    - Fix dash search field hidden by tooltips (LP: #978030)
    - Launcher is silent to screen reader users (LP: #949448)
    - Fix 3D apps running much slower under Unity (LP: #987304)
    - Reduced number of calls to ResultViewGrid::QueueDraw
    - Reduced number of calls to BGHash::RefreshColor
 -- Alan Pope <email address hidden> Wed, 23 May 2012 18:10:49 +0100

Changed in unity (Ubuntu Precise):
status: Fix Committed → Fix Released
Daniel van Vugt (vanvugt) wrote :

To reiterate, there _are_ remaining performance problems even with the above fix. Those should be discussed in bug 1005074.

Changed in unity:
status: Fix Committed → Fix Released
Changed in unity:
status: Fix Released → Fix Committed
Didier Roche (didrocks) on 2012-07-10
Changed in unity:
status: Fix Committed → Fix Released
Changed in ubutter:
status: New → Fix Released
description: updated
j-stuffer (j-stuffer) wrote :

For me several games still run quite slow in Unity, but run okay in Unity 2D or on a seperate X-server.
Recent examples are Dustforce and Oil Rush. For example Oil Rush with ultra/high has 53 fps in the main window on a seperate X-server but only has 33 fps and sluggish mouse cursor under unity. Dustforce is not even a 3D-game and is also slow in Unity, but runs really smoothly in Unity 2D or seperate X-server.

Daniel van Vugt (vanvugt) wrote :

j-stuffer,

This bug is Fix Released so further comments will generally not get much attention. If you have ongoing problems, please log a new bug using this command:
    ubuntu-bug compiz

j-stuffer (j-stuffer) wrote :

Thanks for the answer. I will just post one more comment here, because I don't know if I should file a new bug. Because I made some research and it seems that the cause for the problem could also be the proprietary nvidia drivers. For example Jamestown on my main PC (nvidia Geforce 450 gts, I think) also has performance problems with Unity, for example the mouse cursor in te main menu is laggy (and the game itself, too). starting it on a seperate x-server (ctrl+alt+f1, log in and then startx /usr/bin/ck-launch-session /opt/jamestown/Jamestown -- :1) solves that problem (like with I think every other game that feels laggy).
But on my laptop (some ATI) the game Jamestown runs fine (except the last level). And that's a bit surprising, as my Desktop PC overall has a lot more performance than my Laptop. So this might be an nvidia issue. I'll test some more games, if they run under unity on my laptop also better than on my desktop.

I think it would not really help a lot to report an nvidia-issue here, right?

Daniel van Vugt (vanvugt) wrote :

Yes, a few people have reported performance problems specifically with the proprietary nvidia driver when running the latest compiz/unity. We're tracking those here: https://bugs.launchpad.net/compiz/+bugs?field.tag=nvidia-is-slow

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

Other bug subscribers