gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

Support for NVIDIA overclocking in Wayland / NVML

Open Anuskuss opened this issue 11 months ago • 1 comments

I'm running the latest 570.86.16 beta driver and even NVIDIA themselves have switched to NVML (instead of NV-CONTROL). gpuclockctl (which Gamemode uses for overclicking) currently doesn't support this so if you use either

  1. Wayland
  2. Rootless Xorg
  3. Xorg without CoolBits

you're out of luck.

You can of course run your own scripts in Gamemode but NVML requires root privileges and I haven't figured out yet how to make it work with Gamemode (other than just running sudo gamemoderun of course). So as a crude and very dirty solution I'm currently doing this:

# /etc/gamemode.ini
[custom]
start=/usr/bin/bash -c 'echo PASSWORD | sudo -S python -c "from pynvml import *;nvmlInit();g=nvmlDeviceGetHandleByIndex(0);nvmlDeviceSetGpcClkVfOffset(g,100);nvmlDeviceSetMemClkVfOffset(g,1000)"'
end=/usr/bin/bash -c 'echo PASSWORD | sudo -S python -c "from pynvml import *;nvmlInit();g=nvmlDeviceGetHandleByIndex(0);nvmlDeviceSetGpcClkVfOffset(g,0);nvmlDeviceSetMemClkVfOffset(g,0)"'

This requires nvidia-ml-py (python3 -m pip install nvidia-ml-py or python-nvidia-ml-py on Arch).

Anuskuss avatar Feb 01 '25 14:02 Anuskuss

Hi. First, thanks for letting me discover NVML. I found https://github.com/Dreaming-Codes/nvidia_oc that may be interesting for you as an alternative to pasting python code directly into gamemode.ini.

TheWall89 avatar Feb 26 '25 21:02 TheWall89