I experience a huge drop in game performance since my fresh install of ubuntu 12.04

My PC consists of an Nvidia Geforce GTX 460, AMD Phenom II X4 965 CPU and 4GB of RAM and I use nvidias proprietary driver.

I mainly play Heroes of Newerth by using their linux client. I do this since ubuntu 9.10 and I had never experienced any performance issues when using the proprietary nvidia driver. My fps was always maxed to the vsync frame cap of 60.

Since I run ubuntu 12.04 I get around 30-45 fps and game experience in general is very laggy. I know that there are a lot of people having issues with nvidias 295.40 driver, which is sadly installed by default in ubuntu 12.04. So I manually installed the latest stable 295.49, latest beta 302.07 and even the older version 295.33 used in ubuntu 11.10 (where I never had any issues with performance). It was a waste of time since I was experiencing the same performance problems with all 4 driver versions.

When I use Unity 2D my fps is back to 60 and overall game performance is great. So I only have those issues when running ubuntu 12.04's version of Unity.

I also tried to delete my .config and .compiz-1 folders in the home directory but still game performance is a mess when using unity.

I don't know what to try next... Does anybody know how I can further debug the issue? Maybe how I can provide more data to better analyse the problem? Maybe try to fiddle with some compiz settings?

This performance regression is really frustrating and I am thinking of just downloading Heroes of Newerth's windows client and going back to dual boot since this is simply unacceptable.

Any help appreciated.

4 Answers 4


It's not a real solution, but at least it might be a (hopefully) useful workaround (apart from simply using Unity 2D).

Before you start a game, open up Nautilus (the file manager) and go to /usr/share/application. Open up a terminal, type metacity --replace, and press enter. Don't panick, the Unity interface will disappear, but this is my intention. Launch the game from the file manager (the launcher for the game should be in the folder I mentioned). After you finish playing your game, type unity --replace in the terminal window, and press enter. Your desktop is now restored to how it was.
This should work as it's probably Unity running in the background that's causing trouble.

Also, I'd report this as a bug. It's definitely something that needs to be fixed. If you submit a bug report, be sure to leave a link here so other people who are experiencing this problem can mark it as "affecting them", which will get it fixed sooner.

  • Thank you for your reply. I will try this workaround and report back. Sure it's not pretty but at least better than logging out and back in with unity 2d all the time... Can you help me in reporting the bug? A link to a resource or something where the process is explained would already help a lot. Thanks.
    – dong
    May 11, 2012 at 15:35
  • Thanks RobinJ for your workaround. It's working really well and it is better than logging out and back in with unity 2d because I can keep my session. I opened the folder with the game launcher, opened a terminal, typed metacity --replace & started the game and have the wonderful performance I expect to get. When I am done i type unity --replace and everything is back to normal. I will now file a bug against unity and see what it brings.
    – dong
    May 11, 2012 at 16:06
  • @dong There's a guide for reporting bugs in the Ubuntu documentation: help.ubuntu.com/community/ReportingBugs
    – RobinJ
    May 11, 2012 at 17:41
  • It's not a Unity bug per se, but a Compiz one. Games have never run well with compiz for me...
    – user55822
    May 13, 2012 at 9:31
  • Allright, a little bit late, but here is the bug-report: unity bug-998141. Please be sure to mark the bug as affecting you, if you are also affected by this. Maybe it gets some attention.
    – dong
    May 13, 2012 at 17:36

You could always update to the 304.22 Nvidia Beta drivers and see what happens. I was having huge performance issues with Ubuntu 12.04 LTS and the Nvidia 295.59 version & the 302.07 version seemed to fix some minor things. Most of the issues have been resolved by updating the latest 304.22 driver. Now my GeForce performance is finally equal to Windows XP but there are still minor issues from a few applications but the situation is really improved significantly. You should use the latest Nvidia drivers at all times, even if they are in BETA because it seems that the older stable ones aren't tested by Nvidia's team on newer Kernel and Ubuntu rolling updates causing unexpected problem and issues. Problem is that Nvidia needs to Open Source their drivers so that Ubuntu maintainers and Linux developers can keep everything in sync but that's an ongoing discussion that will not resolve anytime soon :-(

You can obtain them http://www.geforce.com/drivers/beta-legacy

The 304.22 drivers have tons of large scale fixes like:

  • Added support for the following GPUs:
    • GeForce GTX 680M
      Quadro K1000M
      Quadro K2000M
  • Enhanced the functionality of the IncludeImplicitMetaModes Xconfiguration option:
  • Implicit MetaModes will be added for the primary display device,even if multiple display devices are in use when X is initialized.
  • Implicit MetaModes will be added for common resolutions, even if there isn't a mode with that resolution in the mode pool of the display device.
  • Extended the syntax of the IncludeImplicitMetaModes configuration option, e.g., to control which display device is
    used for creation of implicit MetaModes.
  • See the description of the IncludeImplicitMetaModes X configuration
    option in the README for details.

  • Modified the handling of the RandR 1.0/1.1 requests RRGetScreenInfo and RRSetScreenConfig (e.g., `xrandr -q --q1` and `xrandr --size ...` and `xrandr --orientation ...`) such that they operate on MetaModes. This was the behavior in NVIDIA X driver versions 295.xx and earlier, but 302.xx releases altered the handling of these RandR 1.0/1.1 requests to operate on a single RandR output's modes.
  • With the above changes to IncludeImplicitMetaModes and RandR 1.0/1.1 handling, fullscreen applications (e.g., SDL-based applications, Wine), should have more resolutions available to them, and should interact better with multiple monitor configurations.
  • Fixed a bug that could cause G8x, G9x, and GT2xx GPUs to display a black screen or corruption after waking up from suspend.
  • Fixed several bugs that could cause some OpenGL programs to hang when calling fork(3).
  • Fixed an nvidia-settings bug that caused the results of ProbeDisplays queries made with the --display-device-string option to be formatted incorrectly.
  • Improved the responsiveness of updates to the nvidia-settings control panel when displays are hotplugged.
  • Fixed a bug that caused display corruption when setting some transforms, especially when panning a transformed display.
  • Fixed a bug that caused extra RandR events to be generated the first time a display is hotplugged.
  • Fixed a bug that caused X11 modelines with '@' in their names to be rejected.
  • Added support for DisplayPort 1.2 branch devices, which allow multiple displays to be connected to a single DisplayPort connector on a graphics board.
  • Fixed a bug that caused most OpenGL texture uploads to be slow when the context was bound rendering to an RGB overlay drawable.
  • Fixed a bug that caused audio over HDMI to not work after restarting the X server on some MCP7x (IGP) GPUs.
  • Updated the X configuration option "UseDisplayDevice" to honor the value "none" on any GPU.
  • Added support for DKMS in nvidia-installer. Installing the kernel module through DKMS allows the module to be rebuilt automatically when changing to a different Linux kernel. See the README and the nvidia-installer help text or the "--dkms" option.
  • Added RandR output properties _ConnectorLocation, ConnectorNumber,ConnectorType, EDID, _GUID, and SignalFormat. See the README for details on these properties.
  • Extended support for Base Mosaic to all G80+ SLI configurations with up to three displays.
  • Fixed a bug that caused some monitors to fail to wake from DPMS suspend mode when multiple DisplayPort monitors were attached to one GPU.
  • Removed controls for XVideo attributes from the "X Server XVideo Settings" page of the nvidia-settings control panel. XVideo attributes can be configured in XVideo player applications, or through utilities such as xvattr.
  • Fixed a bug that caused all ports on an XVideo adaptor to share color correction settings.
  • Removed support for the following X configuration options:
    • SecondMonitorHorizSync
    Similar control is available through the NVIDIA HorizSync and VertRefresh X configuration options. Please see the NVIDIA driver README for details.
  • Fixed a bug that prevented NVIDIA 3D Vision Pro from working properly when switching between X servers on different VTs.
  • Added support for desktop panning when rotation, reflection, or transformation is applied to a display device (either through RandR or through the MetaMode syntax); panning would previously be ignored in that case.
  • 3
    • Seriously you should try the new drivers, finally got the performance nearly what it is in Windows...
      – user79034
      Jul 28, 2012 at 18:48
    • I usually dislike using anything that's still in beta stage on my working system very much. That being said, I can affirm that the latest beta drivers fixed quite a bunch of issues I was having with default precise 12.04 proprietary nvidia drivers. It's like the whole thing got turned around - the so-called 'stable' drivers were like beta-experience to me, the updated drivers were even worse (e.g. no wake from suspend) and the latest beta drivers (304.30) are working flawlessly so far. +1 from me for this helpful and elaborate answer!Thank you very much!
      – FuzzyQ
      Aug 4, 2012 at 14:48
    • The 304.30 drivers have finally put my system on near close parity with Windows XP and Windows 7 Nvidia performance levels. With Nvidia in both Windows and Linux you need to keep at the bleeding edge at all times it seems and always get the drivers directly from them for the best experience...glad it fixed it for you...
      – user79034
      Aug 4, 2012 at 20:56

    EDIT: X is now lockable thru xscreensaver

    hi! try this, I am having great results using it, mostly for games! As it wont be managed by Unity, you may have great results too!

    I have created this script that creates a new X session and runs a command or open a terminal so you can run it there.


    function FUNCisX1running {
      ps -A -o command |grep -v "grep" |grep -q -x "X :1"
    while [[ ${1:0:2} == "--" ]]; do
      if [[ "$1" == "--no-wm" ]]; then #opt SKIP WINDOW MANAGER (run pure X alone)
      elif [[ "$1" == "--no-kbd" ]]; then #opt SKIP Keyboard setup
      elif [[ "$1" == "--isRunning" ]]; then #opt check if new X :1 is already running
        if FUNCisX1running; then
          exit 0
          exit 1
      elif [[ "$1" == "--help" ]]; then #opt show help info
        echo "usage: options runCommand"
        # this sed only cleans lines that have extended options with "--" prefixed
        sedCleanHelpLine='s"\(.*\"\)\(--.*\)\".*#opt" \2"' #helpskip
        grep "#opt" $0 |grep -v "#helpskip" |sed "$sedCleanHelpLine"
        exit 0
        #echoc -p "invalid option $1"
        echo "PROBLEM: invalid option $1"
        $0 --help
        exit 1
    #echo "going to execute: $@"
    #runCmd="$1" #this command must be simple, if need complex put on a script file and call it!
    runCmd="$@" #this command must be simple, if need complex put on a script file and call it!
    #if ! echoc -q -t 2 "use JWM window manager@Dy"; then
    #  useJWM=false
    # run in a thread, prevents I from ctrl+c here what breaks THIS X instace and locks keyb
    if ! FUNCisX1running; then
      xterm -e "\
      echo \"INFO: hit CTRL+C to exit the other X session and close this window\";\
      echo \"INFO: running in a thread (child proccess) to prevent ctrl+c from freezing this X session and the machine!\";\
      echo \"INFO: hit ctrl+alt+f7 to get back to this X session (f7, f8 etc, may vary..)\";\
      echo ;\
      echo \"Going to execute on another X session: $runCmd\";\
      sudo X :1"&
    #sudo chvt 8 # this line to force go to X :1 terminal
    # wait for X to start
    while ! FUNCisX1running; do
      sleep 1
    # run in a thread, prevents I from ctrl+c here what breaks THIS X instace and locks keyb
    if $useJWM; then
      if [[ ! -f "$HOME/.jwmrc" ]]; then
        echo '<?xml version="1.0"?><JWM><Key mask="4" key="L">exec:xscreensaver-command --lock</Key></JWM>' \
        #if ! jwm -p; then
        #  rm $HOME/.jwmrc
        #  echo ".jwmrc is invalid"
          echo "see http://joewing.net/programs/jwm/config.shtml#keys"
          echo "with Super+L you can lock the screen now"
      jwm -display :1&
    kbdSetup="echo \"SKIP: kbd setup\""
    if $useKbd; then
      kbdSetup="setxkbmap -layout us"
    sleep 2
    xscreensaver -display :1&
    # setxkbmap is good for games that have console access!; bash is to keep console open!
    # nothing
    #xterm -display :1&
    # dead keys
    #xterm -display :1 -e "setxkbmap -layout us -variant intl; bash"&
    # good for games!
    xterm -display :1 -e "$kbdSetup; bash -c \"$runCmd\"; bash"&
    #xterm -display :1 -e "$kbdSetup; bash -c \"$@\"; bash"&

    also, add this at: compiz config settings manager -> window rules -> non closeable windows:

    (class=XTerm) & (title=sudo X :1) & (name=xterm)

    This will prevent you from closing that terminal (use ctrl+c to close the other X session and also the terminal), because if you close "the window" it will freeze your current X session!

    It has the advantage that you dont have alt+enter full screen problems, also no Alt+TAB full screen problems; you can run with more stability any 3D game, from Urban Terror (linux native) to games run with Wine! Even some browsers that run 3D games like Firefox with Quake!

    Obs.: you may want to install jwm package, not required but will make a difference if you need to do any window management there..

    PS.: it can be improved of course, my plan is to add the keyboard setup to an option, but I do it very slowly ;), if someone improve/clean it up, post so I can update mine script :)


    When using Unity 3D, do you have many 3D effects and the like enabled? (cube, desktop animations, menu effects, etc) These can reduce performance, even on a good machine.

    It may be worth checking your nvidia settings, just search for 'nvidia' in the dash and you will find it. I know i had to tweak the nvidia settings quite a bit before i didnt get any lag.

    Check your in game settings, change them around a bit and see how much your fps changes.

    Be sure to grab the latest updates for Ubuntu, this can sometimes solve issues, although in your case, i don't expect it would help.

    • Thank you for your reply. I did not change any compiz settings on this installation (I have not even ccsm installed) so everything about my setup is stock Unity 3D that you get after a fresh installation. No cubes, no burning windows, nothing. About my ingame settings: I know that everything was running smoothly in Ubuntu 11.10 (and older) in Heroes of Newerth with exactly the same settings I have now. My goal is to achieve this again. As you already imagined, I already have all the latest updates for ubuntu installed (from the official repositories; no other ppas added).
      – dong
      May 11, 2012 at 15:03
    • What exactly could I change in nvidia settings? I don't see what I could change to improve performance.
      – dong
      May 11, 2012 at 15:31
    • There are settings for vsync, AA and AF and various other things, there is also a graphics performance slider under one of the settings area's, may be worth looking at that @dong
      – nisshh
      May 12, 2012 at 3:08

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

    Not the answer you're looking for? Browse other questions tagged or ask your own question.