Nvidia Settings "editable performance levels"

Where you can type the ‘Graphics Clock Offset’ and ‘Memory Transfer Rate Offset’, after you type it in, how do you get it to save? I cannot figure it out and trying to google it gives like 1 result. I know the safe rates to overclock from back when I was on Windows using the auto scan function in the Nvidia App.

Thanks

I do it from the command line, like this:

sudo nvidia-smi -i 0 -pm 1
sudo nvidia-smi -i 0 -pl 190
sudo nvidia-smi -i 0 -lgc 210,1755
sudo nvidia-settings -a [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=200 -a [gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=3200 -a [gpu:0]/GPUPowerMizerMode=1

This means:

  • Limit power to 190W
  • Keep GPU clock speeds in the range 210 - 1755 MHz
  • Offset the graphics clock curve by 200 MHz upwards (i.e. in the overclock / undervolt direction)
  • Increase the memory transfer rate by 3200 MHz. Note, that corresponds to 400 MHz on the underlying VRAM clock, and 1600 MHz in MSI Afterburner on Windows.

That’s on a 3060 Ti - I can’t say for sure if things are different on different generations of cards.

When done as a user, this needs sudo. So if you prefer the GUI, you could try starting the GUI app using sudo nvidia-settings.

However, the settings don’t survive reboot. So rather than using the GUI on every boot, you probably want to automate this using a startup script or a service.

That did it. Thanks :slight_smile:

Actually, how can I automate it?

sudo nvidia-settings -a [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=90
sudo nvidia-settings -a [gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=200

I tried making it an executable file then adding it to autostart, but that didn’t work. I am still sooo new to Linux. Please help me, you’re my only hope.

Sorry, I should have been more explicit about this, as it’s a bit awkward.

I made a systemd service to run this as root. But the nvidia-settings command depends on some legacy X11 stuff (even on Wayland) and will fail if it’s run before this stuff is set up in the user session. So I resorted to just trying every 60 seconds until it succeeds.

Steps:

  1. Make this file as /etc/systemd/system/overclock-gpu.service :
[Unit]
Description=Apply GPU overclocking
Requires=graphical.target
After=graphical.target

[Service]
Type=oneshot
ExecStart=/root/bin/overclock-gpu.sh
Restart=on-failure
RestartSec=60

[Install]
WantedBy=graphical.target
  1. Make this file as /root/bin/overclock-gpu.sh. Note, we don’t use sudo in the script since it’s running non-interactively as root.
#!/bin/bash

# Environment variables needed for nvidia-settings (see https://unix.stackexchange.com/q/729328)
export DISPLAY=":0"
export XAUTHORITY=`find /run/user -name xauth* | head -n 1`
if [[ -z "$XAUTHORITY" ]]; then
    echo "No xauth* file found"
    exit 1
fi

nvidia-settings -a [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=90
nvidia-settings -a [gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=200
  1. Enable the service: sudo systemctl enable overclock-gpu.service

Now your settings should be applied every time you start up.

Thanks PG. I was working on it while you posted that. Appreciate the help.

Ok, I got it. Here are the steps that worked for me, for future reference and anyone else who runs into this.

Automatically apply NVIDIA GPU overclock on Fedora KDE/Wayland at login

First, create a root-owned script containing the NVIDIA settings:

sudo nano /usr/local/bin/nvidia-overclock

Add:

#!/bin/bash
/usr/bin/nvidia-settings -a '[gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=90'
/usr/bin/nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=200'

Make it executable and ensure it’s owned by root:

sudo chmod 755 /usr/local/bin/nvidia-overclock
sudo chown root:root /usr/local/bin/nvidia-overclock

Create a sudoers rule so this specific script can run without requiring a password:

sudo visudo -f /etc/sudoers.d/nvidia-overclock

Add the following, replacing saraneth with your username:

saraneth ALL=(root) NOPASSWD: /usr/local/bin/nvidia-overclock

Now create a login script:

nano ~/nvidia-overclock-autostart.sh

Add:

#!/bin/bash
sleep 10
sudo -n /usr/local/bin/nvidia-overclock

Make it executable:

chmod +x ~/nvidia-overclock-autostart.sh

Finally, open:

KDE System Settings → Autostart

Add ~/nvidia-overclock-autostart.sh as a Login Script.

The 10-second delay allows the graphical session and NVIDIA driver to be ready before nvidia-settings applies the offsets.

Note: Don’t add /usr/local/bin/nvidia-overclock directly to KDE Autostart. KDE will run it as your normal user, causing nvidia-settings to fail with Operation not permitted for the current user.