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.
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.
- Create the installation directory:
sudo mkdir -p /opt/nvidia-mobo-fan-control
- 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/
- Make the script executable:
sudo chmod +x /opt/nvidia-mobo-fan-control/nvidia-mobo-fan-control.sh
- Reload systemd to recognize the new service:
sudo systemctl daemon-reload
- Enable the service to start on boot:
sudo systemctl enable nvidia-mobo-fan-control
- Start the service:
sudo systemctl start nvidia-mobo-fan-control
Check if the service is running:
sudo systemctl status nvidia-mobo-fan-control
View the service logs:
journalctl -u nvidia-mobo-fan-control -f
- 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
If the service fails to start, check:
- The script path is correct (/opt/nvidia-mobo-fan-control/nvidia-mobo-fan-control.sh)
- The script has execute permissions
- The fan control device exists (/sys/devices/platform/nct6687.2592/hwmon/hwmon5/pwm2)
- nvidia-smi is installed and working