/nvidia-mobo-fan-control

NVIDIA Motherboard Fan Control Service for Linux. Control a fan attached to the motherboard based on the temperature of a NVIDIA GPU

Primary LanguageShell

NVIDIA Motherboard Fan Control

Created by lucacri

This service controls NVIDIA GPU fan speed based on temperature when the fans are powered by the motherboard, implementing a custom fan curve with quick ramp-up and slow ramp-down behavior.

Hardware Requirements & Context

This software was specifically developed for:

  • NVIDIA GPUs only (requires nvidia-smi)
  • Tested on MSI PRO Z690-A DDR4 motherboard
  • Originally designed for a modified NVIDIA P40 card
  • GPU fans must be powered by the motherboard
  • Tested on Ubuntu 22.04

The software was created to address a specific need: controlling GPU fans that are powered by the motherboard rather than the GPU itself. In this setup, fan speed can be controlled by writing values (0-254) directly to the system fan control device (/sys/devices/platform/nct6687.2592/hwmon/hwmon5/pwm2).

This solution is particularly useful for server-grade GPUs (like the NVIDIA P40) that have been modified for desktop use, where the fans are connected to motherboard headers instead of being powered by the GPU directly.

Installation Steps

  1. Create the installation directory:
sudo mkdir -p /opt/nvidia-mobo-fan-control
  1. Copy the files to the installation directory:
sudo cp nvidia-mobo-fan-control.sh /opt/nvidia-mobo-fan-control/
sudo cp nvidia-mobo-fan-control.service /etc/systemd/system/
  1. Make the script executable:
sudo chmod +x /opt/nvidia-mobo-fan-control/nvidia-mobo-fan-control.sh
  1. Reload systemd to recognize the new service:
sudo systemctl daemon-reload
  1. Enable the service to start on boot:
sudo systemctl enable nvidia-mobo-fan-control
  1. Start the service:
sudo systemctl start nvidia-mobo-fan-control

Verifying Operation

Check if the service is running:

sudo systemctl status nvidia-mobo-fan-control

View the service logs:

journalctl -u nvidia-mobo-fan-control -f

Fan Curve Details

  • Below 40°C: Fan speed set to minimum (20)
  • Between 40°C and 75°C: Linear interpolation from 20 to 254
  • Above 75°C: Fan speed set to maximum (254)
  • Fan speed increases immediately when temperature rises
  • Fan speed decreases slowly when temperature drops

Troubleshooting

If the service fails to start, check:

  1. The script path is correct (/opt/nvidia-mobo-fan-control/nvidia-mobo-fan-control.sh)
  2. The script has execute permissions
  3. The fan control device exists (/sys/devices/platform/nct6687.2592/hwmon/hwmon5/pwm2)
  4. nvidia-smi is installed and working