Last active
March 19, 2024 06:32
-
-
Save ComradeCat24/c25f7205036cd7b30e9be296a0ed0470 to your computer and use it in GitHub Desktop.
gpu fan control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if GPUTargetFanSpeed parameter is provided | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 <GPUTargetFanSpeed>" | |
exit 1 | |
fi | |
GPUTargetFanSpeed=$1 | |
# Loop over GPU indices | |
for gpu_index in 0 1 | |
do | |
# Loop over fan indices | |
for fan_index in 0 1 2 3 | |
do | |
nvidia-settings -a "[gpu:${gpu_index}]/GPUFanControlState=1" -a "[fan:${fan_index}]/GPUTargetFanSpeed=${GPUTargetFanSpeed}" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment