Skip to content

ZanMax/nvidia-fan-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nvidia Fan Control

A lightweight Linux utility for monitoring GPU temperatures and dynamically controlling NVIDIA GPU fan speeds using NVML.

Requirements

  • NVIDIA GPUs with NVML support
  • NVIDIA drivers 520 or higher

Build

go build -o nvidia_fan_control

Installation

sudo mv nvidia_fan_control /usr/local/bin/

Configuration

edit the file config.json with the following structure

{
    "time_to_update": 5,
    "temperature_ranges": [
      { "min_temperature": 0, "max_temperature": 40, "fan_speed": 30, "hysteresis": 3 },
      { "min_temperature": 40, "max_temperature": 60, "fan_speed": 40, "hysteresis": 3 },
      { "min_temperature": 60, "max_temperature": 80, "fan_speed": 70, "hysteresis": 3 },
      { "min_temperature": 80, "max_temperature": 100, "fan_speed": 100, "hysteresis": 3 },
      { "min_temperature": 100, "max_temperature": 200, "fan_speed": 100, "hysteresis": 0 }
    ]
  }

Service

sudo nano /etc/systemd/system/nvidia_fan_control.service

update WorkingDirectory and set the path to your config file

[Unit]
Description=NVIDIA Fan Control Service
After=network.target

[Service]
ExecStart=/usr/bin/sudo /usr/local/bin/nvidia_fan_control
WorkingDirectory=/path/to/your/config
StandardOutput=file:/var/log/nvidia_fan_control.log
StandardError=file:/var/log/nvidia_fan_control_error.log
Restart=always
User=root
Group=root

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable nvidia_fan_control.service
sudo systemctl start nvidia_fan_control.service
sudo systemctl status nvidia_fan_control.service

Check Logs

sudo tail -f /var/log/nvidia_fan_control.log

About

Nvidia Fan Control for linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages