NVIDIA GPU undervolting on Garuda

Checked this thread already. It doesn’t have the info about reducing GPU voltage unfortunately.

But i have found this thread:

https://www.reddit.com/r/linux_gaming/comments/1fm17ea/undervolting_nvidia_gpu_in_2024/

And this advice from the thread is the most suitable for the most cases i think:

Nvidia doesn’t provide direct access to the voltage value but voltage is still directly tied to the clock: the GPU will auto adjust voltage based on a modifiable curve which binds the two values together (higher clock requires more volts, lower clock requires less volts). If you apply a positive offset to this clock-voltage curve, you force the GPU to use a lower-than-default voltage value for a given clock value, which is effectively an undervolt.

I do this on my 3090 to dramatically lower temperatures for almost no performance loss. It’s very easy to do with a Python script which will work in both X11 and Wayland sessions but you need to install a library providing the bindings for the NVIDIA Management Library API. On ArchLinux you can install them from the AUR: yay -S python-nvidia-ml-py.

You can then run a simple Python script as root, mine looks like this:

#!/usr/bin/env python
from pynvml import * 
nvmlInit() device = nvmlDeviceGetHandleByIndex(0)
nvmlDeviceSetGpuLockedClocks(device,210,1695)
nvmlDeviceSetGpcClkVfOffset(device,255)
nvmlDeviceSetPowerManagementLimit(device,315000)
  • nvmlDeviceSetGpuLockedClocks sets minimum and maximum GPU clocks, I need this bacause my GPU runs at out-of-specification clock values by default because it’s one of those dumb OC edition cards. You can find valid clock values with nvidia-smi -q -d SUPPORTED_CLOCKS but if you’re happy with the maximum clock values of your GPU, you can omit this line.
  • nvmlDeviceSetGpcClkVfOffset offsets the curve, this is the actual undervolt. My GPU is stable at +255MHz, you have to find your own value. To clarify again, this doesn’t mean the card will run at a maximum of 1695 + 255 = 1950 MHz, it just means that, for example, at 1695 MHz it will use the voltage that it would’ve used at 1440 MHz before the offset.
  • nvmlDeviceSetPowerManagementLimit sets the power limit which has nothing to do with undervolting and can be omitted. The GPU will throttle itself (reduce clocks) to stay within this value (in my case 315W).

Once you find the correct values, you can run the script with a systemd service on boot:

[Unit] 
Description=Undervolt the first available Nvidia GPU device 
[Service] 
Type=oneshot ExecStart=/etc/systemd/system/%N 
[Install] 
WantedBy=graphical.target

Rename the Python script undervolt-nvidia-device and the service undervolt-nvidia-device.service and put them both in /etc/systemd/system, then systemctl daemon-reload and systemctl enable --now undervolt-nvidia-device.service.

If you don’t like systemd, there are many other ways to automatically run a script as root, but please make sure that your GPU is stable first by manually running the Python script in your current session and testing stability after every new offset you put in before you have it run automatically, that way if your session locks up you can force a reboot and the GPU will go back to its default values."

Update:

Yeah, it works and allows user to Undervolt Nvidia GPU. You can use this method on X11