Skip to content

Instantly share code, notes, and snippets.

@ComradeCat24
Last active March 19, 2024 06:32
Show Gist options
  • Save ComradeCat24/c25f7205036cd7b30e9be296a0ed0470 to your computer and use it in GitHub Desktop.
Save ComradeCat24/c25f7205036cd7b30e9be296a0ed0470 to your computer and use it in GitHub Desktop.
gpu fan control
#!/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