Skip to content

Latest commit

 

History

History
157 lines (108 loc) · 3.2 KB

File metadata and controls

157 lines (108 loc) · 3.2 KB

nvuv

CLI tool for undervolting (indirect) and overclocking NVIDIA gpu on Linux

Install

Quick start

Tip

nvuv -h

First check your GPU's supported power limits, clock and offset ranges

> nvuv get w
power limit: 250W (default: 250W, range: 175..250W)

> nvuv get gc
gpu clock range: 200..3000MHz

> nvuv get mc
memory clock range: 400..15000MHz

> nvuv get go
gpu clock offset: 0MHz (-1000..1000)

> nvuv get mo
memory clock offset: 0MHz (-2000..6000)

# or in one command listing all P-states
> nvuv get psc

Tip

Use -g GPU_INDEX to set a specific GPU if you have multiple

Then tune - root required

# Set power limit to 175 W
> sudo nvuv set w 175

# Lock gpu clock between 200..2400 MHz
> sudo nvuv set gl 2400 200
# If needed lock memory clock with `ml`

# Set gpu clock offset to +200 MHz (support negative)
> sudo nvuv set go 200

# Set memory clock offset to +500 MHz
> sudo nvuv set mo 500

To reset to default - root required

> sudo nvuv reset

Important

Settings changes do not survive reboot/resume or driver reload.
For this, a systemd service is provided to apply a config automatically (see below).

nvuv can apply settings from a config file, default is /etc/nvuv/nvuv.toml.
Edit the file to set desired settings:

# Comment any property to keep the default

[[gpu]]
power_limit = 175 # W
gpu_offset = 200 # MHz
mem_offset = 500

[gpu.gpu_clocks.locked]
# Comment min value to use the lowest default freq
min = 200 # MHz
max = 2400

# To lock memory clock uncomment
# [gpu.mem_clocks.locked]
# min = 123
# max = 1234

# Reset clocks to default value
# Useful for switching between different configs for different use cases
# [gpu.gpu_clocks]
# reset = 1
# [gpu.mem_clocks]
# reset = 1

# If multi GPUs add more section as needed
# [[gpu]]
#

Tip

Use --config /path/to/config.toml to specify a custom config file

Check the config is valid

> nvuv cfg

To apply the config immediately - root required

> sudo nvuv applycfg

Run as a systemd service

To apply the config at startup and after resume/driver reload, enable the provided systemd service:

sudo systemctl enable --now nvuv.service

If needed, to use a custom file, override the service

ExecStart=/usr/bin/nvuv applycfg --config /path/to/config.toml

Implementation details

nvuv is a thin wrapper around NVIDIA's NVML library


NVIDIA undervolt on Linux?

NVIDIA does not expose direct voltage control on Linux (unlike on Windows and popular tools like MSI Afterburner).
Voltage-freq curve is locked at driver level.
We have to trick and use a technique: indirect undervolting

  1. Lock the GPU's maximum clock speed
  2. Apply a positive clock offset (overclocking) to the locked range

Result: the GPU runs at (roughly) the same performance with lower voltage and power draw, reducing temp and fan noise

License

Apache License 2.0 WITH Commons-Clause-1.0


trad' coded