NVIDIA/Tips and tricks

From ArchWiki
Revision as of 14:34, 13 June 2019 by Hering (talk | contribs) (Fixed text as well leading to the online documentation of coolbits (the old driver version got dropped anyways so no sense to keep it there))
Jump to navigation Jump to search

Fixing terminal resolution


Using TV-out

A good article on the subject can be found here.

X with a TV (DFP) as the only display





$ startx -- -logverbose 6



Edit xorg.conf by adding to the Device section:

Option "ConnectedMonitor" "DFP"




Option "ModeValidation" "NoDFPNativeResolutionCheck"
Option "ConnectedMonitor" "DFP-0"


Check the power source


$ nvidia-settings -q GPUPowerSource -t

Listening to ACPI events


NVIDIA(0):     Config Options in the README.


Section "Device"
  Driver "nvidia"
  Option "ConnectToAcpid" "0"


Displaying GPU temperature in the shell

There are three methods to query the GPU temperature. nvidia-settings requires that you are using X, nvidia-smi or nvclock do not. Also note that nvclock currently does not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.



$ nvidia-settings -q gpucoretemp

This will output something similar to the following:

Attribute 'GPUCoreTemp' (hostname:0.0): 41.
'GPUCoreTemp' is an integer attribute.
'GPUCoreTemp' is a read-only attribute.

The GPU temps of this board is 41 C.

In order to get just the temperature for use in utilities such as rrdtool or conky:

$ nvidia-settings -q gpucoretemp -t


Use nvidia-smi which can read temps directly from the GPU without the need to use X at all, e.g. when running Wayland or on a headless server. To display the GPU temperature in the shell, use nvidia-smi as follows:

$ nvidia-smi

This should output something similar to the following:

$ nvidia-smi
Fri Jan  6 18:53:54 2012       
| NVIDIA-SMI 2.290.10   Driver Version: 290.10         |                       
| Compute processes:                                               GPU Memory |
|  GPU  PID     Process name                                       Usage      |
|  0.           ERROR: Not Supported                                          |

Only for temperature:

$ nvidia-smi -q -d TEMPERATURE

====NVSMI LOG====

Timestamp                           : Sun Apr 12 08:49:10 2015
Driver Version                      : 346.59

Attached GPUs                       : 1
GPU 0000:01:00.0
        GPU Current Temp            : 52 C
        GPU Shutdown Temp           : N/A
        GPU Slowdown Temp           : N/A





Use nvclockAUR which is available from the AUR.



Set fan speed at login




Option "Coolbits" "4"




                -a "[gpu:1]/GPUFanControlState=1" -a  [fan:1]/GPUTargetFanSpeed=n" &

If you use a login manager such as GDM or SDDM, you can create a desktop entry file to process this setting. Create ~/.config/autostart/nvidia-fan-speed.desktop and place this text inside it. Again, change n to the speed percentage you want.

[Desktop Entry]
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=n"
Note: Before driver version 349.16, GPUCurrentFanSpeed was used instead of GPUTargetFanSpeed.[1]

To make it possible to adjust the fanspeed of more than one graphics card, run:

$ nvidia-xconfig --enable-all-gpus
$ nvidia-xconfig --cool-bits=4
Note: On some laptops (including the ThinkPad X1 Extreme and P51/P52), there are two fans, but neither are controlled by nvidia.

Manual configuration



Disabling the logo on startup

Add the "NoLogo" option under section Device:

Option "NoLogo" "1"

Overriding monitor detection



Option "ConnectedMonitor" "DFP"

Enabling brightness control

Add under section Device:

Option "RegistryDwords" "EnableBrightnessControl=1"


Note: Installing either nvidia-blAUR or nvidiablAUR will provide a /sys/class/backlight/nvidia_backlight/ interface to backlight brightness control, but your system may continue to issue backlight control changes on /sys/class/backlight/acpi_video0/. One solution in this case is to watch for changes on, e.g. acpi_video0/brightness with inotifywait and to translate and write to nvidia_backlight/brightness accordingly. See Backlight#sysfs modified but no brightness change.

Enabling SLI



Find the first GPU's PCI Bus ID using lspci:

$ lspci | grep VGA


BusID "PCI:3:0:0"

Add the desired SLI rendering mode value under section Screen:

Option "SLI" "AA"

The following table presents the available rendering modes.

Value Behavior
AFR Enable SLI and use the alternate frame rendering mode.
SFR Enable SLI and use the split frame rendering mode.



To verify that SLI mode is enabled from a shell:

$ nvidia-settings -q all | grep SLIMode
  Attribute 'SLIMode' (arch:0.0): AA 
    'SLIMode' is a string attribute.
    'SLIMode' is a read-only attribute.
Tip: If this configuration does not work, you may need to use the PCI Bus ID provided by nvidia-settings,
$ nvidia-settings -q all | grep -i pcibus
Attribute 'PCIBus' (host:0[gpu:0]): 101.
  'PCIBus' is an integer attribute.
  'PCIBus' is a read-only attribute.
  'PCIBus' can use the following target types: GPU, SDI Input Device.
Attribute 'PCIBus' (host:0[gpu:1]): 23.
  'PCIBus' is an integer attribute.
  'PCIBus' is a read-only attribute.

and comment out the PrimaryGPU option in your xorg.d configuration,


Section "OutputClass"
    # Option "PrimaryGPU" "yes"

Using this configuration may also solve any graphical boot issues.

Enabling overclocking



Option "Coolbits" "value"
# nvidia-xconfig --cool-bits=value




The documentation of Coolbits can be found in /usr/share/doc/nvidia/html/xconfigoptions.html and here.


Setting static 2D/3D clocks


Option "RegistryDwords" "PerfLevelSrc=0x2222"

Allow change to highest Performance Mode


Reason: This section refers to the limits for GPU boost, which is unrelated to overclocking discussed above. The nvidia-smi(1) man page says that it is "For Tesla devices from the Kepler+ family and Maxwell-based GeForce Titan." And as far as Lahwaacz is aware, the only GPU which supports this and does not have the default clocks equal to the maximum, is Tesla K40 [4]. Since the Pascal architecture, Boost 3.0 handles automatic clocking even differently. (Discuss in Talk:NVIDIA/Tips and tricks#)

Since changing Performance Mode and Overclocking Memory Rate has little to no effect in nvidia-settings, try this:

- Setting Coolbits to 24 or 28 and remove Powermizer RegistryDwords -> Restart X - find out max. Clock and Memory rate. (this can be LOWER than what your gfx card reports after booting!):

nvidia-smi -q -d SUPPORTED_CLOCKS

- set rates for GPU 0:

sudo nvidia-smi -i 0 -ac memratemax,clockratemax

After setting the rates the max. Performance Mode works in nvidia-settings and you can overclock graphics-clock and Memory Transfer Rate.

Custom TDP Limit

Modern Nvidia graphics cards throttle frequency to stay in their TDP and temperature limits. To increase performance it is possible to change the TDP limit, which will result in higher temperatures and higher power consumption.

For example, to set the power limit to 160.30W:

# nvidia-smi -pl 160.30

To set the power limit on boot (without driver persistence):

Description=Set NVIDIA power limit on boot


Description=Set NVIDIA power limit

ExecStart=/usr/bin/nvidia-smi -pl 160.30

Kernel module parameters


Reason: Giving advanced examples without explaining what they do is pointless. (Discuss in Talk:NVIDIA/Tips and tricks#)

Some options can be set as kernel module parameters, a full list can be obtained by running modinfo nvidia or looking at nv-reg.h. See the Gentoo wiki as well.

For example, enabling the following will turn on kernel mode setting (see above) and enable the PAT feature supported by most newer CPUs, which affects how memory is allocated. If your system can support this feature it should improve performance.

options nvidia-drm modeset=1 
options nvidia NVreg_UsePageAttributeTable=1