Skip to content

Easy Overclocking and/or Undervolting NVIDIA Cards on Gnoppix

This tutorial describes how to overclock and/or undervolt NVIDIA cards under Linux. While NVIDIA cards don’t have the same breadth of tools available as under Windows (no MSI Afterburner or direct control over the voltage curve), there are still relatively easy ways to boost clocks or undervolt your card if you know how to do it.

In this tutorial, we’ll set up Python scripts for adjusting various boosts/offsets and create a service to run these scripts automatically after boot.

  • A installed Gnoppix Linux system with an NVIDIA graphics card
  • Root access

Open a terminal of your choice (Konsole, Alacritty, etc.) and follow these steps:

  1. Switch to root:

    Terminal window
    sudo -i
  2. Create and navigate to the NVIDIA directory:

    Terminal window
    mkdir NVIDIA
    cd NVIDIA
  1. Create a virtual environment:

    Terminal window
    python -m venv venv
  2. Activate the virtual environment:

    Terminal window
    source /root/NVIDIA/venv/bin/activate
  3. Verify the activation:

    Terminal window
    which pip

    It should return “/root/NVIDIA/venv/bin/pip”.

  4. Install required modules:

    Terminal window
    pip install nvidia-ml-py pynvml
  5. Deactivate the virtual environment:

    Terminal window
    deactivate

Create a file named nvidia-oc.sh in /root/NVIDIA/:

#!/usr/bin/fish
source /root/NVIDIA/venv/bin/activate.fish
python /root/NVIDIA/nvidia-oc.py
deactivate

Make the script executable:

Terminal window
chmod 770 nvidia-oc.sh

Find your card’s standard minimum and maximum clocks:

Terminal window
nvidia-smi -q -d SUPPORTED_CLOCKS | less

Note down the topmost and bottommost ‘Graphics:’ clock values.

Create a file named nvidia-oc.py in /root/NVIDIA/ with the following content:

from pynvml import *
nvmlInit()
# This sets the GPU to adjust - if this gives you errors or you have multiple GPUs, set to 1 or try other values.
myGPU = nvmlDeviceGetHandleByIndex(0)
# Set Min and Max core clocks
nvmlDeviceSetGpuLockedClocks(myGPU, MINCLOCK, MAXCLOCK)
# Clock offset (0 by default)
nvmlDeviceSetGpcClkVfOffset(myGPU, CLOCKOFFSET)
# Memory Clock offset (0 by default)
nvmlDeviceSetMemClkVfOffset(myGPU, MEMOVERCLOCK)

Replace MINCLOCK, MAXCLOCK, CLOCKOFFSET, and MEMOVERCLOCK with appropriate values.

Run the script:

Terminal window
/root/NVIDIA/nvidia-oc.sh

Monitor the GPU:

Terminal window
watch nvidia-smi -q -d VOLTAGE,CLOCK

Test your configuration with games or other GPU-intensive tasks.

Create a file named nvidia-oc.service in /etc/systemd/system/:

[Unit]
Description=Set up Nvidia settings
Wants=basic.target
[Service]
Type=oneshot
ExecStart=/root/NVIDIA/nvidia-oc.sh
[Install]
WantedBy=network.target
Terminal window
systemctl daemon-reload
systemctl enable nvidia-oc.service
systemctl start nvidia-oc.service

Check the service status:

Terminal window
systemctl status nvidia-oc.service

You now have custom clocks and possibly undervolting for your NVIDIA card on boot. Remember to test thoroughly and adjust values as needed for stability and performance.