Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46

Thread: HOWTO: Improve NVidia Laptop Graphics Performance

  1. #1
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    HOWTO: Improve NVidia Laptop Graphics Performance

    Overview
    NVidia laptop cards come with a feature called PowerMizer that dynamically underclocks the GPU when it's not being used much. This is great for battery power but horrible for performance when using Desktop Effects (compiz). Unfortunately, NVidia does not provide a way to configure PowerMizer on Linux however, it's not difficult to create a script that will give you maximum speed while on AC power and maximum power savings while on battery.

    This HOWTO is aimed primarily at users of NVidia 8 and 9 series laptop graphics cards (though, it may be useful for 7 series users as well). This HOWTO assumes you are running compiz and have already properly configured the NVidia proprietary drivers. If you are not using compiz, this guide will not be useful for you.

    Implementation
    The first thing we will need is a utility called nvidia-settings. If you've installed the NVidia drivers directly from the NVidia website or using envyng, you can skip this step:

    Code:
    sudo apt-get install nvidia-settings
    The nvidia-settings has a unique property that, with essentially no CPU/GPU activity, when you ask the card to print all of its information, it causes the card to go to maximum power. The nvidia card only drops a power level every 30 seconds so, we are going to take advantage these two facts to keep the card at maximum power if we are on AC power.

    If you have no custom scripts, follow these instructions first:

    Code:
    mkdir -p ~/bin
    Then, open up gedit and paste the following script:

    Code:
    #!/bin/bash
    
    while true; do
        if on_ac_power; then
            nice /usr/bin/nvidia-settings -q all > /dev/null
        fi
        sleep 25;
    done
    Save the script as ~/bin/nvidia-power.sh. Then, start a terminal and type the following:

    Code:
    chmod +x ~/bin/nvidia-power.sh
    ~/bin/nvidia-power.sh &
    disown
    exit
    If you are on AC power, the card should now be locked at its maximum power but, if you are on battery power, you should see no difference at all (until you next plug your laptop in).

    Next, we will need to add this script to run when you login. On gnome, go to System->Preferences->Sessions, click Add. Add a descriptive name for the startup program (maybe, "NVidia Power") and for Command use, "/home/your_username/bin/nvidia-power.sh" (replace your_username with your username). Now the command should run whenever you login.

    Testing
    Testing is fairly straightforward. Start a terminal and type:

    Code:
    nvidia-settings
    Scroll down to the bottom of the window this command brings up and look on the left side for the PowerMizer option. If your laptop is plugged in, you should see that your graphics card is running at full power. Watch it for a minute (the time it takes for the card to normally drop to lowest power) and make sure it stays at the highest power level. Now, unplug your laptop and wait for another minute. After less than a minute, your card should drop down to minimum power (as long as you keep it idle). Now, plug the cable back in and, in less than 30 seconds, the card should come back to full power and stay there.

    The one caveat of this approach is that it can take up to 25 seconds for the card to come back up to full power. There are more complex ways to make the card instantly go to full power when plugged in but, on average, it will be at full power within 12 seconds so, it's probably more hassle than it's worth to use more complex methods.

    Questions/Comments/Suggestions welcome.
    Don't try to make something "fast" until you are able to quantify "slow".

  2. #2
    Join Date
    Feb 2008
    Beans
    68

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Thanks =D
    This script improved my card perfomance so much =D, now I'm 100% here =D

  3. #3
    Join Date
    Nov 2006
    Beans
    Hidden!
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Thank you for the helpful tutorial, i'll try it and give feedback soon.

  4. #4
    Join Date
    Dec 2005
    Location
    What a weird trip.....
    Beans
    4,676
    Distro
    Ubuntu 12.04 Precise Pangolin

    Cool Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Works great!

    Thank you.

    Great work..




    EDIT:

    When I ran your script, most of the animations in Compiz-Fusion were blocky and ugly, not smooth and pretty.

    The card ran well but crashed my setup.

    I currently don't use this script.
    Last edited by steveneddy; June 25th, 2008 at 12:36 AM.
    If at first you don't succeed - just buy the company and tell them to make the one you want.

  5. #5
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Quote Originally Posted by steveneddy View Post
    When I ran your script, most of the animations in Compiz-Fusion were blocky and ugly, not smooth and pretty.

    The card ran well but crashed my setup.

    I currently don't use this script.
    What do you mean by "crashed my setup"? Did the computer actually crash?

    To fix the "blocky and ugly", try this:

    Code:
    sudo apt-get install compizconfig-settings-manager
    Go to System->Preferences->Advanced Desktop Effects->General Options->Display Settings. Uncheck "Detect Refresh Rate" and manually move the "Refresh Rate" slider from "50" to "60". Optionally, you may also want to check "Sync to VBlank".
    Don't try to make something "fast" until you are able to quantify "slow".

  6. #6
    Join Date
    Dec 2005
    Location
    What a weird trip.....
    Beans
    4,676
    Distro
    Ubuntu 12.04 Precise Pangolin

    Cool Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Quote Originally Posted by vor View Post
    What do you mean by "crashed my setup"? Did the computer actually crash?

    To fix the "blocky and ugly", try this:

    Code:
    sudo apt-get install compizconfig-settings-manager
    Go to System->Preferences->Advanced Desktop Effects->General Options->Display Settings. Uncheck "Detect Refresh Rate" and manually move the "Refresh Rate" slider from "50" to "60". Optionally, you may also want to check "Sync to VBlank".
    I had to totally reinstall Compiz for some reason. I thought it did look better with the card turned up, but for some reason I lost all of my settings and had to reinstall all of Compiz just to fix it.

    weird.
    If at first you don't succeed - just buy the company and tell them to make the one you want.

  7. #7
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    You had to re-install compiz or re-install your nvidia drivers? There was an xserver-xorg-core update recently and, if you've manually installed the nvidia drivers, it probably clobbered a few of the files that compiz needs to function. The script as posted above is fairly innocuous and doesn't change any existing files on the system whatsoever (with the exception of the users startup programs).
    Don't try to make something "fast" until you are able to quantify "slow".

  8. #8
    Join Date
    Dec 2005
    Location
    What a weird trip.....
    Beans
    4,676
    Distro
    Ubuntu 12.04 Precise Pangolin

    Cool Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Quote Originally Posted by vor View Post
    You had to re-install compiz or re-install your nvidia drivers? There was an xserver-xorg-core update recently and, if you've manually installed the nvidia drivers, it probably clobbered a few of the files that compiz needs to function. The script as posted above is fairly innocuous and doesn't change any existing files on the system whatsoever (with the exception of the users startup programs).
    Yeah - I know. nVidida drivers OK. compiz became odd after installing your script. Not blaming your script, but I occasionally open the nvidia-settings and when the card needs to be turned up, it does so automatically. When idling, it goes back to the lowest settings.

    I think I'm happy with the stock model.

    Cool script though!
    If at first you don't succeed - just buy the company and tell them to make the one you want.

  9. #9
    Join Date
    Jun 2006
    Location
    Trivandrum India
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Is this in any way bad for the graphics card?
    Ubuntu Rocks!!!

  10. #10
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Improve NVidia Laptop Graphics Performance

    Quote Originally Posted by subru77 View Post
    Is this in any way bad for the graphics card?
    It will probably make the card run slightly hotter than it would with the default settings but, Windows users have had the ability to do this for years (or so I've heard) and I would imagine that if forcing the card to maximum power was in any way dangerous, NVidia would not make it an option on their Windows drivers. In fact, they have stated that they are going to add a more formal way to control PowerMizer in an upcoming linux driver. They didn't state when that would be though (so, it could be years).
    Don't try to make something "fast" until you are able to quantify "slow".

Page 1 of 5 123 ... LastLast

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
  •