# Graphics card 1 to 6
for MY_DEVICE in {0..5}
do
# Check if card exists
if nvidia-smi -i $MY_DEVICE >> /dev/null 2>&1; then
# Fan speed
TEMP_NOW=$(nvidia-smi --id=$MY_DEVICE --format=csv,noheader --query-gpu=temperature.gpu)
FAN_NOW=$(nvidia-smi --id=$MY_DEVICE --format=csv,noheader,nounits --query-gpu=fan.speed)
# echo "$TEMP_NOW"
# echo "$FAN_NOW"
DIFF=$(( $TEMP_NOW - $MY_TEMP ))
# echo "$DIFF"
if [[ $DIFF -ge 2 ]]; then
FAN_SET=$(( $FAN_NOW + 2))
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUFanControlState=1"
nvidia-settings -a "[fan:$MY_DEVICE]/GPUTargetFanSpeed=$FAN_SET"
fi
if [[ $DIFF -le -2 ]]; then
FAN_SET=$(( $FAN_NOW - 2))
nvidia-settings -a "[gpu:$MY_DEVICE]/GPUFanControlState=1"
nvidia-settings -a "[fan:$MY_DEVICE]/GPUTargetFanSpeed=$FAN_SET"
fi
fi
done
March
Регистрация: 11 дек 2015Offline Активность: авг 18 2017 06:24