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.