下午好。我为超频设置编写的启动脚本无法在启动时初始化。我独立运行了该脚本,它运行良好;但是,当我在 rc.local 中运行它时,它不起作用。
overclock.sh(这是超频脚本)
#!/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
奇怪的是,overclock.sh 在启动时运行,但 rc.local 跳过了所有显示“sudo nvidia-settings -a .....”的行,但运行显示“sudo nvidia-smi -pl 75”的行,因为我可以看到系统中有一个变化。