Ubuntu as a gaming platform: Unity performance

Registered by David Planella

Unity costs about 10% in frame rate performance drop when running a game. Various Unity performance work that we will be taken to get better framerate on the desktop and while gaming.

Blueprint information

Status:
Not started
Approver:
Jason Warner
Priority:
High
Drafter:
Didier Roche-Tolomelli
Direction:
Approved
Assignee:
Didier Roche-Tolomelli
Definition:
Approved
Series goal:
Accepted for raring
Implementation:
Unknown
Milestone target:
milestone icon ubuntu-13.04-feature-freeze

Related branches

Sprints

Whiteboard

Summary
-------
This is a known issue. We are improving the functionality of fullscreen window unredirection (e.g., no interception by the compositor) this cycle (Ubuntu 12.10) and will look into enabling it by default next cycle (Ubuntu 13.04).

Details
-------
The main performance regression in compiz 0.9.8 vs 0.9.7 is detailed in:
    https://bugs.launchpad.net/compiz/+bug/1024304

The main fix for this problem is to turn off compositing for fullscreen windows. That's a feature that is already present, but it's not reliable enough to recommend anyone try until Compiz 0.9.8.4 has been released (Update: Done!).

The feature can be enabled here:

    CCSM > Composite > Unredirect Fullscreen Windows

It's not enabled by default because:

    1. It's not yet tested across all the major graphics drivers; and

    2. It's still not as seamless as it should be.

The driver bugs are all listed here:
    https://bugs.launchpad.net/ubuntu?field.tag=unredirect

The compiz bugs are all listed here:
    https://bugs.launchpad.net/compiz/+bugs?field.tag=unredirect

It is likely the "Unredirect Fullscreen Windows" option will be usable for most people when Ubuntu 12.10 is released, but unlikely to be enabled as default by then, due to the above issues. The fixes can be backported to Ubuntu 12.04 LTS in the future.

So the main problem is:
    https://bugs.launchpad.net/compiz/+bug/1024304
and the primary intended solution is:
    https://bugs.launchpad.net/compiz/+bug/1063690

------

Performance changes for raring:

- Compiz unredirect fullscreen: ON by default, OFF automatically for nouveau and intel (override by the gsettings key)
- Unity: paging of results from the dash search results
- Unity: UBUS enhancements (already in)
- Unity: full screen dash window to detect the click out. Solution for not doing it and just querying the window manager for focused window
- Nux: Texturing all the components in just one spot, not a draw call for every components, every time. (Launcher first, then panel). Texture harness. (like css sprites)
- Nux automatically queuing and relayouting parents when it’s just needed.
- Previews transition on dash on big screens: inefficient.
- Automated measurement/benchmark of precise interactions -> Rick mentioned QA team for it.
- BAMF synchronous calls to check that they are in UI-drawing thread safe

----
Could compiz be consuming gl resources before the game launches into full screen? If unredirect is on this isn't a big issue.

Unity code to be instrumented to measure the impact and results of the changes

End to end automated game performance testing
 - fps
 - input lag
 - audio latency
 - longest frame delay
 - total time to run benchmark
 - run a timedemo for various games and watch the trends

--- removing those WI, nobody is tasked to do it for this cycle:
[njpatel] full screen dash window to detect the click out. Solution for not doing it and just querying the window manager for focused window: TODO
[njpatel] Texturing all the components in just one spot, not a draw call for every components, every time. (Launcher first, then panel). Texture harness. (like css sprites): TODO
[njpatel] Fix Nux automatically queuing and relayouting parents when it’s just needed: TODO
[njpatel] Investigate how previews transition on dash on big screens: inefficient: TODO

Unity: paging of results from the dash search results: TODO
(People dropped "njpatel" on the latest, and so, it was assigned to me)

(?)

Work Items

Work items:
[vanvugt] Work on a reproducer (automated test case for the unredirect fullscreen): DONE
[thomir-deactivatedaccount] Work on a reproducer (automated test case for the unredirect fullscreen): TODO
[thomir-deactivatedaccount] Writing a test case for multiple monitors with one fullscreen window on one monitor: TODO
[gema] Add the created test case to smoke daily testing: TODO
[vanvugt] Automated turning on and off of the fullscreen unredirect window: DONE
[vanvugt] Enable unredirected fullscreen windows by default: DONE
[vanvugt] Investigate on the remaining crashes (precise only?): DONE
[vanvugt] Backport unredirect fullscreen windows fixes from quantal to precise: DONE
[mlankhorst] Investigate on the remaining precise crashes (on nouveau in particular), once unredirect support is available for testing in compiz 0.9.7.10: TODO
[didrocks] Backport the fix to precise: DONE
[mhr3] Unity: UBUS enhancements: DONE
[3v1n0] improve the glib sources usage for timeouts (merging timeouts into just one source): TODO
[bryce] Add capturing of gsettings option for unredirected fullscreen: (org.compiz.composite, relocatable path): DONE
[3v1n0] Check that all BAMF synchronous calls to check that they are in UI-drawing thread safe (it already should be the case): DONE
[gema] Add automated measurement/benchmark with upstream instrumentation of the code: POSTPONED
[gema] Help on having automated benchmarks on actual games integrated with autopilot, using timedemo (https://developer.valvesoftware.com/wiki/Demo_Recording_Tools): POSTPONED
[gema] Have the maximize/minizise test from https://code.launchpad.net/~vanvugt/compiz/untest/+merge/133210 branch to run the test in the QA daily: POSTPONED