Page 1 of 134 1231151101 ... LastLast
Results 1 to 10 of 1334

Thread: HOWTO: Jaunty Intel Graphics Performance Guide

  1. #1
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    HOWTO: Jaunty Intel Graphics Performance Guide

    Warning: Although I have made an effort to make this guide as accessible as possible, if you are a beginner to Ubuntu then you are not recommended to follow this guide at all. Even if you stick to the safest method outlined, your system may experience difficulties due to the installation of unofficial drivers. Consider yourselves warned .

    Overview
    Some users are experiencing performance issues with Intel integrated graphics chips in Jaunty (9.04) for several possible reasons:

    1. The current driver in our repository has some performance issues with the EXA acceleration method. Users will notice 2D performance is poor due to the default "migration heuristic" employed by EXA (to "always" migrate pixmaps), but this causes performance issues for many users. Setting the heuristic to "greedy" alleviates this problem somewhat. See "man exa".
    2. The new and faster acceleration method (UXA) is not enabled by default, due to issues reported by many users. This code is being actively developed, and many stability and performance issues have been resolved in the latest drivers (specifically within the intel driver, libdrm, mesa and kernel 2.6.29.4 or later). Unfortunately, Jaunty will not include the latest versions necessary to improve performance.
    3. 3D performance has regressed compared to the Intrepid release, possibly due to major code changes that have resulted from the introduction to the new acceleration and memory management code (UXA, GEM, DRI2). Due to these changes, there seems to be some regressions in the "legacy" DRI acceleration.
    4. Either Xorg or the "intel" driver seems to be suffering from a bug in which the memory (MTRR) region allocated for the graphics card is not set up with the proper type of caching. This results in jerky video playback of almost any content (from 720p media, all the way down to simple 320x240 mpeg content), and a potential loss of performance for other 2D and 3D operations.

    There are three possible configuration that this guide will present:

    Safe Configuration
    • For this configuration, you will upgrade to the latest stable Xorg drivers (via the X-Updates PPA), enable UXA acceleration and create a workaround for the MTRR bug. This is the solution recommended for users who possess hardware devices that depend on a restricted driver. If you don't know what this means, then this is the solution you should use.

    Optimal* Configuration
    • This configuration is identical to "Safe", but includes the 2.6.30.9 kernel. Using this kernel will improve 3D performance for many users, but you will lose access to restricted kernel drivers. This configuration yields the best results for my system (an 855GM chipset), but of course, your experience may differ.

    Bleeding-Edge* Configuration
    • This configuration is the most risky. This will enable repository which contains bleeding-edge mesa & Xorg drivers which are continually updated (via the xorg-edgers PPA), enable UXA acceleration, create a workaround for the MTRR bug and install kernel 2.6.30.9. This configuration is not necessarily the fastest (in fact, the Optimal configuration is fastest for my hardware), and is recommended only for users who want to test the latest Xorg code.
      Note: As per the PPA maintainer's wish, you are instructed to read the instructions here, since the Bleeding-Edge repository is prone to breakage and important instructions may be added. Don't request support for these packages (and don't be surprised if questions are left unanswered).

    *Disclaimer: Using a third-party kernel means that you will no longer have access to "restricted" drivers such as FGLRX, NVIDIA, some Broadcom wireless chipsets, certain webcams and a handful new sound cards that require restricted firmware to function. If you believe that you have restricted hardware on your machine, you should continue using the official Jaunty kernel - in other words, stick to the Safe configuration.

    Warning: Do not switch between the Safe/Optimal and Bleeding-Edge solutions unless you have followed the steps to revert changes beforehand. For example, if you try the Bleeding-Edge method, and then decide to try the Optimal configuration, you will still be using the Bleeding-Edge drivers (because the xorg-edgers PPA contains newer drivers than the X-Updates PPA, which are not downgraded automatically).

    Once you have decided on the configuration that suits you, begin by following Part A below:

    Part A - Common Instructions (Safe/Optimal/Bleeding-Edge)
    All users must follow this part.

    0. Optional: If there is no xorg.conf file present on your system, the following command will create a minimal configuration (which you can customize later):
    Code:
    $ sudo dpkg-reconfigure -phigh xserver-xorg
    Note: Use caution with this command, as it will overwrite any xorg.conf file already present on your system (though it will create a backup).

    1. Edit your xorg.conf:
    Code:
    $ gksudo gedit /etc/X11/xorg.conf
    Find the "Device" section and make sure it looks identical to the following (important: remove or comment any of your previous customizations):
    Code:
    Section "Device"
    	Identifier	"Configured Video Device"
    	Option		"AccelMethod"			"uxa"
    	Option		"EXAOptimizeMigration"		"true"
    	Option		"MigrationHeuristic"		"greedy"
    	Option		"Tiling"			"true" # i8xx users: see note in guide
    EndSection
    N.B.: If you are using an Intel 8xx chipset, tiling cause instability unless you use the Bleeding-Edge configuration. Therefore: if you are using the Safe/Optimal configurations, set tiling to false; if you are using the Bleeding-Edge configuration, set tiling to true.

    2. Download Bartec's fixmtrr.sh script and make it executable:
    Code:
    $ sudo wget http://launchpadlibrarian.net/26193373/fixmtrr.sh -O /usr/local/bin/fixmtrr.sh
    $ sudo chmod +x /usr/local/bin/fixmtrr.sh
    3. Create a symbolic link to ensure the fixmtrr.sh script is executed upon each login via GDM:
    Code:
    $ sudo ln -s /usr/local/bin/fixmtrr.sh /etc/gdm/PostLogin/Default
    N.B. This works only if you are using the GNOME Display Manager (GDM). KDE/other users need to execute this script manually - see the Important Note section.

    4. If you want the Safe/Optimal configuration, continue to Part B. For Bleeding-Edge, skip to Part C.

    Part B (Safe/Optimal)
    Users who wish to try the Safe or Optimal configurations must follow this part.

    1. Add the X Updates PPA to your sources.list:

    Edit /etc/apt/sources.list:
    Code:
    $ gksudo gedit /etc/apt/sources.list
    Add these entries to the end of your sources.list file (if they do not already exist):
    Code:
    deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main #X-Updates PPA
    deb-src http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main #X-Updates PPA
    2. Import the X Updates PPA key, update your apt sources, and perform an upgrade:
    Code:
    $ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com AF1CDFA9
    $ sudo apt-get update
    $ sudo apt-get dist-upgrade
    N.B.: If you are asked to remove any packages, immediately cancel the process. The expected behaviour is only to upgrade packages, not to remove.

    3. If you want to use the Safe configuration, you're finished - proceed to the Important Note section. If you want the Optimal configuration, continue to Part C.

    Part C (Optimal/Bleeding-Edge)
    Users who desire the Optimal or Bleeding-Edge configurations should follow this section.

    1. Download & install the 2.6.30.9 kernel according to your architecture:

    i386 users:
    Code:
    $ wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-headers-2.6.30-02063009-generic_2.6.30-02063009_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-headers-2.6.30-02063009_2.6.30-02063009_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-image-2.6.30-02063009-generic_2.6.30-02063009_i386.deb
    $ sudo dpkg -i linux-headers-2.6.30-02063009-generic_2.6.30-02063009_i386.deb linux-headers-2.6.30-02063009_2.6.30-02063009_all.deb linux-image-2.6.30-02063009-generic_2.6.30-02063009_i386.deb
    amd64 users:
    Code:
    $ wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-headers-2.6.30-02063009-generic_2.6.30-02063009_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-headers-2.6.30-02063009_2.6.30-02063009_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.9/linux-image-2.6.30-02063009-generic_2.6.30-02063009_amd64.deb
    $ sudo dpkg -i linux-headers-2.6.30-02063009-generic_2.6.30-02063009_amd64.deb linux-headers-2.6.30-02063009_2.6.30-02063009_all.deb linux-image-2.6.30-02063009-generic_2.6.30-02063009_amd64.deb
    3. If you want the Optimal configuration, you're finished - however, before rebooting into the new kernel, read the Important Note section. Bleeding-Edge users, continue to the Part D.

    Part D (Bleeding-Edge)
    Users who desire the Bleeding-Edge configuration should follow this section.

    1. Add the xorg-edgers PPA to your sources.list:

    Edit /etc/apt/sources.list:

    Code:
    $ gksudo gedit /etc/apt/sources.list
    Append the following text into the end of this file, then save and close:
    Code:
    deb http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu jaunty main #xorg-edgers PPA
    deb-src http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu jaunty main #xorg-edgers PPA
    Import the xorg-edgers PPA key, update your apt sources, and perform an upgrade:
    Code:
    $ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 8844C542
    $ sudo apt-get update
    $ sudo apt-get dist-upgrade
    N.B.: If you are asked to remove any packages, immediately cancel the process. The expected behaviour is only to upgrade packages, not to remove.

    2. You're finished. However, before rebooting into the new kernel, read the Important Note section.

    Important Notes (Safe/Optimal/Bleeding-Edge)

    Reporting Bugs
    If you choose the Safe or Optimal configuration, you will be using the stable (but unofficial) X-Updates drivers. From the repository description:

    While Ubuntu-X does not officially support these packages, if you discover problems when installing these debs please feel free to report bugs to launchpad. However, please make sure to clearly state that you are running packages from this PPA so we know the fixes need to come here.
    Therefore, if you are using the Safe/Optimal configuration you may report bugs to Launchpad - as long as you adhere to the request above. I also recommend that you test against the official Ubuntu kernel, or at least disclose in your bug report that you are using the unofficial mainline kernel.

    If you are using the Bleeding-Edge configuration, you can also report bugs to Launchpad as long as you explicitly state that you are using the xorg-edgers drivers. Please keep in mind that the purpose of the xorg-edgers repository is to package semi-daily snapshots of upstream's code, and Launchpad may not the appropriate place to file bugs (since there are going to be days where stuff is expected to break, and filing a bug is a waste of time). Alternatively, you can report issues to the upstream bug tracker, but you are expected to submit detailed reports. Don't expect support for the xorg-edgers drivers in this thread!

    Remember to use the ubuntu-bug tool to ensure the required information gets submitted to your bug report:
    Code:
    $ ubuntu-bug xserver-xorg-video-intel
    Using the fixmtrr.sh script
    The purpose of the fixmtrr.sh script is to workaround a bug in the intel driver and/or kernel and ensure your graphics card's memory region gets set to the correct type of caching (write-combining). If your memory region is not set with the proper type of caching, you will experience video stuttering and reduced 3D performance.

    Note: If you are using Kubuntu or a custom distribution of Ubuntu that does not use the GNOME Display Manager (GDM), you need to execute the fixmtrr.sh script each time X (re)starts. Therefore, executing this script in your rc.local script is not sufficient.

    Interpreting Performance Gains

    Do. Not. Trust. Glxgears.

    Seriously. Your glxgears score may reduce after following this guide and enabling UXA acceleration (i.e., when the DRI2 framework is activated), but it does *not* mean things are worse.

    The glxgears application was never an accurate benchmark of 3D performance, and developers have pleaded for users to understand this fact for a long, long time. See this page for an explanation.

    I suggest you find a better tool to benchmark performance - in my case, I settled on PlanetPenguin racer (enabling the FPS counter in the options).

    For comparison's sake, here's a rough outline of my performance results on my Inspiron 510m laptop with a Pentium M 1.5Ghz, 768MB ram and Intel 855GM chipset:
    Intrepid: glxgears = ~1000fps, ppracer = ~23fps.
    Jaunty (default configuration): glxgears = ~300fps, ppracer = ~19fps
    Jaunty (with Optimal configuration): glxgears = ~340fps, ppracer = ~30fps

    As you can see, glxgears does not accurately portray the improvement gained from testing the latest DRI2/UXA code.

    To Revert Settings
    If these configurations didn't work for you, this is how to revert changes.

    1. Edit your sources.list:
      Code:
      $ gksudo gedit /etc/apt/sources.list
      Remove the lines for the xorg-edgers and/or X-Updates repositories, then save and close.

    2. Downgrade packages:
      Code:
      $ sudo apt-get install libdrm-dev/jaunty libdrm2/jaunty libdrm-intel1/jaunty libdrm-radeon1/jaunty xserver-xorg-video-intel/jaunty libdrm-nouveau1/jaunty libgl1-mesa-dri/jaunty libgl1-mesa-glx/jaunty libgl1-mesa-dev/jaunty libglu1-mesa/jaunty mesa-common-dev/jaunty mesa-utils/jaunty xserver-common/jaunty xserver-xorg-core/jaunty xserver-xorg-input-evdev/jaunty xserver-xorg-input-evdev/jaunty xserver-xorg-input-synaptics/jaunty xserver-xorg-video-ati/jaunty xserver-xorg-video-nv/jaunty xserver-xorg-video-openchrome/jaunty xserver-xorg-video-radeon/jaunty
      N.B.: Ensure that packages are only downgraded, not removed. Otherwise cancel the process.

    3. Remove the 2.6.30.9 kernel:
      Code:
      $ sudo dpkg -r linux-headers-2.6.30-02063009 linux-headers-2.6.30-02063009-generic linux-image-2.6.30-02063009-generic
    4. Reset your xorg.conf to defaults:
      Code:
      $ sudo dpkg-reconfigure xserver-xorg
    5. Optional: remove the fixmtrr.sh script and GDM PostLogin hook:
      Code:
      $ sudo rm /usr/local/bin/fixmtrr.sh /etc/gdm/PostLogin/Default

    Your system will then be restored to normal.

    Changelog
    v1.1 - 12/05/09 - Complete re-write.
    v1.2 - 12/05/09 - Modified instructions to allow automatic startup of fixmtrr.sh script (Part A, step 3).
    v1.3 - 19/05/09 - Updated Bleeding-Edge section to fetch -rc6 kernel.
    v1.4 - 24/05/09 - Updated Bleeding-Edge section to fetch -rc7 kernel.
    v1.5 - 01/06/09 - Updated Optimal section to fetch 2.6.29.4 kernel, added Bleeding-Edge note.
    v1.6 - 02/06/09 - Added some warnings to guide.
    v1.7 - 03/06/09 - Updated Bleeding-Edge section to fetch -rc8 kernel.
    v1.8 - 11/06/09 - Updated Optimal and Bleeding-Edge sections to fetch final 2.6.30 kernel.
    v1.9 - 15/06/09 - Added information regarding bug reporting policy to Important Note section.
    v2.0 - 24/06/09 - Clarified bug reporting policy.
    v2.1 - 22/07/09 - Updated guide to use 2.6.30.2 kernel.
    v2.2 - 28/07/09 - Updated guide to use 2.6.30.3 kernel.
    v2.3 - 15/09/09 - Updated guide to use 2.6.30.9 kernel.
    Last edited by psyke83; October 15th, 2009 at 02:24 PM.

  2. #2
    Join Date
    Jun 2007
    Location
    Charlotte, NC, USA
    Beans
    3,121
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    psyke83 - Thanks for the guide. I plan to upgrade my Intel powered laptop with an X3100 in a few days. I'll place this in my subscribed list for easy reference.

    Thanks for all your hard and productive work.
    Mac Pro 5,1 6-Core@3.33 GHz, 48 GB, ATI HD 5870
    Optical-Apple Super Drive & MCE Internal Blu-ray
    1 TB WD, 5 TB Barracuda(s), 500 GB Hitachi RAID0
    HP RocketU 1144C USB 3.0 Raid / Inateck USB 3.0

  3. #3
    Join Date
    Jan 2009
    Location
    Florida
    Beans
    460
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Thank you!
    Quick question though, how do I know if I've enabled UXA properly or not?

  4. #4
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Quote Originally Posted by novafluxx View Post
    Thank you!
    Quick question though, how do I know if I've enabled UXA properly or not?
    It'll be mentioned in the logs.

    Code:
    $ grep -i UXA /var/log/Xorg.0.log

  5. #5
    Join Date
    Mar 2007
    Beans
    402
    Distro
    Ubuntu

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    is there any chance this stuff will get put into jaunty post-release or will we have to wait until karmic?

  6. #6
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Quote Originally Posted by nwadams View Post
    is there any chance this stuff will get put into jaunty post-release or will we have to wait until karmic?
    The chances are slim-to-none. However, there may be specific code commits that can be safely get backported into the current version of the drivers shipping with Jaunty, or some newer versions of the drivers may get released into the proposed repository. You'll never see kernel 2.6.29 or 2.6.30 in Jaunty (the latter isn't even finished yet).

    Karmic is your best bet for official support.

  7. #7
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Here's the output you requested:

    $ cat /proc/mtrr
    reg00: base=0x000000000 ( 0MB), size= 2048MB, count=1: write-back
    reg01: base=0x07f800000 ( 2040MB), size= 8MB, count=1: uncachable

    $ lspci -vvnn

    00:02.0 VGA compatible controller [0300]: Intel Corporation 82865G Integrated Graphics Controller [8086:2572] (rev 02)
    Subsystem: Dell Device [1028:0151]
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 11
    Region 0: Memory at e8000000 (32-bit, prefetchable) [size=128M]
    Region 1: Memory at feb80000 (32-bit, non-prefetchable) [size=512K]
    Region 2: I/O ports at ed98 [size=8]
    Capabilities: <access denied>
    Kernel modules: intelfb
    boot_info_script | AMD64 Athlon X2 Dual-Core - nVidia Geforce 6150 SE - 4GB DDR3

  8. #8
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    By the way, I normally get angry at compiz due to slow scrolling, but I actually find it bearable right now . Scrolling is smooth on my old laptop (with exception to certain sites in Firefox, such as Gmail - but is the fault of Firefox and not compiz or Xorg).

  9. #9
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Your fix didn't work. The new kernel works but the xorg.conf fix caused my screen to freeze. I needed to power cycle to reboot.

    Can you post you complete xorg.conf for reference.

    Below is what I put in Section device.

    Also I have an intregrated 865G and I can't play movies at all, avi mpeg, dvd's mplayer crashes. I do have a xorg.conf fix that works but the screen to very slow and frames are choppy.

    Section "Device"
    Identifier "Configured Video Device"
    Option "AccelMethod" "uxa"
    Option "Tiling" "false"
    EndSection
    boot_info_script | AMD64 Athlon X2 Dual-Core - nVidia Geforce 6150 SE - 4GB DDR3

  10. #10
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    Re: HOWTO: Jaunty Intel Graphics Performance Guide

    Quote Originally Posted by VMC View Post
    Here's the output you requested:

    $ cat /proc/mtrr
    reg00: base=0x000000000 ( 0MB), size= 2048MB, count=1: write-back
    reg01: base=0x07f800000 ( 2040MB), size= 8MB, count=1: uncachable

    $ lspci -vvnn

    00:02.0 VGA compatible controller [0300]: Intel Corporation 82865G Integrated Graphics Controller [8086:2572] (rev 02)
    Subsystem: Dell Device [1028:0151]
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 11
    Region 0: Memory at e8000000 (32-bit, prefetchable) [size=128M]
    Region 1: Memory at feb80000 (32-bit, non-prefetchable) [size=512K]
    Region 2: I/O ports at ed98 [size=8]
    Capabilities: <access denied>
    Kernel modules: intelfb
    You're suffering from the bug. Open a new file:
    Code:
    $ gedit fixmtrr.sh
    Paste the following text into this file, and save:
    Code:
    #!/bin/sh
    echo "Before:"
    echo "-------"
    cat /proc/mtrr
    echo "base=0xE8000000 size=0x08000000 type=write-combining" >| /proc/mtrr
    echo ""
    echo "After:"
    echo "------"
    cat /proc/mtrr
    Make the script executable, and then move it into your local binary folder:
    Code:
    $ chmod +x fixmtrr.sh
    $ sudo mv fixmtrr.sh /usr/local/bin
    Finally, execute the script:
    Code:
    $ sudo fixmtrr
    You'll see some output detailing your MTRR ranges before and after the tweak.

    Note: you'll need to execute this script each time you restart your PC or Xorg.

    Try to play some content in Totem and see if the stuttering has stopped. If you can clearly see this helps, please consider reporting your results on the bug report, attaching the relevant logs as Bryce requested.
    Last edited by psyke83; April 20th, 2009 at 06:13 AM.

Page 1 of 134 1231151101 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •