1

Good afternoon. I am having issues getting a startup script i wrote for my overclock settings to initialize on bootup. I have run the script independently and it works perfectly; however, when i run it in rc.local, it does not work.


overclock.sh (this is the overlocking script)

#!/bin/bash 
sudo nvidia-settings -a '[gpu:0]/GPUGraphicsClockOffset[3]=-200'
sudo nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=1100' 
sudo nvidia-settings -a '[gpu:0]/GPUFanControlState[3]=1' 
sudo nvidia-settings -a '[fan:0]/GPUTargetFanSpeed[3]=55' 
sudo nvidia-settings -a '[gpu:1]/GPUGraphicsClockOffset[3]=-200' 
sudo nvidia-settings -a '[gpu:1]/GPUMemoryTransferRateOffset[3]=1100' 
sudo nvidia-settings -a '[gpu:1]/GPUFanControlState[3]=1' 
sudo nvidia-settings -a '[fan:1]/GPUTargetFanSpeed[3]=55' 
sudo nvidia-smi -pl 75

/etc/rc.local

#!/bin/sh 
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/ubuntu1/overclock.sh &
exit 0

The odd thing is that overclock.sh is running on startup, but rc.local is skipping all of the lines that say 'sudo nvidia-settings -a ....." but running the line that says 'sudo nvidia-smi -pl 75' as I can see that one change in the system.

  • sudo requires credentials. If you really want to figure out what's going on you should add error checking to your script or at least log the output. – Elder Geek Jan 12 '18 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.