GalaxyData Community

GPU FAN Nvidia no monitor

nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration

GPU FAN SERVICE

nano /etc/systemd/system/multi-user.target.wants/gpufan.service

 

[Unit]
Description = GPU FAN by galaxydata.ru
After = network.target
 
[Service]
Type=forking
ExecStart = /root/gpufan.sh
 
[Install]
WantedBy = multi-user.target

Create script

nano /root/gpufan.sh

 

#! /bin/bash
 
#----------------------------------------------------------------------
# Description: adaptive fan speed management for NVIDIA GPUs on Linux
# Author:  Artem S. Tashkinov
# Created at: Fri Jul 10 07:47:43 GMT 2015
# Computer: localhost.localdomain
# System: Linux 4.1.0-ic on i686
#
# Copyright (c) 2015 Artem S. Tashkinov  All rights reserved.
#
# WARNING: I'm not liable for any damage to your GPU if you decide to
#          use this script
#
#----------------------------------------------------------------------
 
polltime=60 # in seconds
 
range[0]="0 39"
dtemp[0]=35
range[1]="40 59"
dtemp[1]=45
range[2]="60 79"
dtemp[2]=55
range[3]="80 200"
dtemp[3]=80
 
trap ctrl_c INT
 
ctrl_c() {
    echo
    echo -n "Resetting GPU fan management: "
    nvidia-settings --display :0 -a [gpu:0]/GPUFanControlState=0 &>/dev/null && echo "OK" || echo "Failed!"
    exit 0
}
 
result=`nvidia-settings --display :0 -a [gpu:0]/GPUFanControlState=1 | grep "value 1"`
test -z "$result" && echo "Fan speed management is not supported on this GPU. Exiting" && exit 1
 
while :; do
    temp=`nvidia-settings --display :0 -q GPUCoreTemp -t | head -1`
 
    i=0
    while [ "x${range[i]}" != "x" ]; do
        read lo hi <<<$(echo ${range[$i]})
 
        if [ $temp -ge $lo -a $temp -le $hi ]; then
            echo "GPU Temperature: ${temp}. Setting GPU fan speed to ${dtemp[$i]}%"
            nvidia-settings --display :0 -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=${dtemp[$i]}" &> /dev/null
        fi
 
        i=$((i+1))
    done
 
    sleep $polltime
done

 

Exit mobile version