Disclaimer of Liability

The content on this page is provided "as is" without express or implied warranty.

In no event shall author be liable for any special indirect or consequential damages or any damages whatsoever resulting from loss of income or profits, whether in an action of contract, negligence or other tortious action, arising in connection with the use or performance of this information.

NVIDIA™ driver for FreeBSD/Linux: performance and power saving hints

Contents

Following information may be useful for NVIDIA chipset-based notebook owners with FreeBSD, Solaris or Linux (Ubuntu/Gentoo/Fedora/RedHat/Debian etc). However, theoretical part of the article is correct for NVIDIA drivers for Microsoft Windows systems.

Note that fan speed on NVIDIA video cards are controlled by different mechanism not described in the article.

Note also that this is not an official documentation and some statements may be wrong!

Need your help

If you have tested (whether successfully or not) following hints on your hardware, could you please drop me a mail to fill a compatibility table. You may also send me your suggestions or discuss the guide in my blog.

The document revisions history

TO DO list

Performance and power saving

General information

Performance levels

NVIDIA binary driver supports several performance levels. Each one has two parameters: GPU clock frequency and on-board memory clock frequency (if the card has one). To see supported performance levels you may use 'nvidia-settings' command. In the example below we have 3 performance levels:
$ nvidia-settings -q GPUPerfModes -t
perf=0, nvclock=100, memclock=0 ; perf=1, nvclock=350, memclock=0 ; perf=2, nvclock=425, memclock=0
Notes:

NVIDIA driver works in one of these levels each period of time. Following commands will show you current performance level and current frequency parameters:

$ nvidia-settings -q GPUCurrentPerfLevel -t
2

$ nvidia-settings -q GPUCurrentClockFreqs -t
425,666
As for "425,666" in the example above - current GPU frequency is 425 MHz, but the card has no on-board memory so there should be "425,0" (memclock=0 for perf=2). Looks like a bug in NVIDIA driver or nvidia-settings tool.

You should not monitor current state of GPUCurrentPerfLevel and GPUCurrentClockFreqs parameters using 'nvidia-settings -q all' command - this artificially rises current performance level.

NVIDIA X.org driver can detect power source. To see the current state check 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):

$ nvidia-settings -q GPUPowerSource -t
1

Performance modes

Another one read-only NVIDIA driver parameter is 'GPUCurrentPerfMode' - Performance mode. Possible values are: To switch to the 3D mode you may run 'glxgears' application from 'mesa-demos' package for example (graphics/mesa-demos port for FreeBSD users).

There is confortable GUI to monitor current status of the driver - just run 'nvidia-settings' without command-line parameters:

Theory

You may configure power saving behavior for AC and battery sources separately. If your drivers (either NVIDIA or system ones) don't detect current power source correctly, you have to use only one configuration (usually for AC source - check current 'GPUPowerSource' parameter).

Clock frequency control strategies

You may choose clock frequency control strategy for each power source. At the moment we have:

PowerMizer modes

You can not configure some performance level to be used for fixed clock frequency strategy. Instead there are three possible PowerMizer modes for the fixed clock frequency configuration: Note that you have only three PowerMizer modes regardless of performance levels number and the values have opposite meaning. Yeah, looks freaky.

PerfLevelSrc - strategies assigment

There is special NVIDIA driver parameter 'PerfLevelSrc'. Its hexadecimal value format is

0x[Battery source strategy][AC source strategy]

Look at following examples:

There are two NVIDIA driver parameters to configure fixed clock frequency strategy:

Practice

Now we are ready to configure NVIDIA driver.

'RegistryDwords' option from appropriate NVIDIA device section of 'xorg.conf' file is used for the configuration. Minimal configuration may look like follows:
Section "Device"
  Identifier "NVIDIA GeForce"
  Driver     "nvidia"
  Option     "RegistryDwords" "<performance and power saving configuration>"
EndSection

The 'RegistryDwords' option format is "parameter1=value1 [; parameter2=value2 ...]" and usually it contains following parameters:

"PowerMizerEnable=0x1; PerfLevelSrc=0x<value1>; PowerMizerDefault=0x<value2>; PowerMizerDefaultAC=0x<value3>"
You have to reload NVIDIA kernel module and restart X.org server to apply the option. Full system reboot will also help.

Notes:

Configuration examples

Look at four popular 'RegistryDwords' option values:

FreeBSD port of recent binary NVIDIA driver

Recent x11/nvidia-driver port from FreeBSD ports collection should work fine.

It is also recommended to install x11/nvidia-settings FreeBSD port to monitor current driver state.

Compatibility

FreeBSD 7.1-PRERELEASE i386
OS/kernel
release/version
NVIDIA hardware
(PCI ID)
NVIDIA driver version Performance levels Features
power source detection adaptive strategy fixed frequency -
PowerMizer modes
1 - max perf. 2 3 - max power saving
on-board GeForce Go 6100 (0x10de:0x0247, rev=0xa2) 180.18 perf=0, nvclock=100, memclock=0;
perf=1, nvclock=350, memclock=0;
perf=2, nvclock=425, memclock=0
yes yes perf=2 perf=1 perf=0
Notes: Works fine.
Linux 2.6.27-9-generic x86_64 2x GeForce 8700M GT SLI (0x10de:0x01b3, rev=0xa3) 180.11.02 perf=0, nvclock=170, memclock=100;
perf=1, nvclock=275, memclock=300;
perf=2, nvclock=625, memclock=800
yes no no no no
Notes: Default behavior with Option "SLI" "false" or Option "SLI" "SFR" is max performance on AC and max power saving on battery. PerfLevelSrc has no effect.

Useful links


© 2008, Artem Naluzhnyy <tut@nhamon.com.ua>