fan-control
fan-control copied to clipboard
Different hwmon required
I'm running fancontrol-gui via the snap package manager and thus need udev rules. The default udev rules from this github assume hwmon7 to be the correct one for PWM control:
SUBSYSTEM=="hwmon", KERNEL=="hwmon7", RUN+="/bin/sh -c '/bin/chmod a+w /sys%p/pwm*'"
My system doesn't even have a folder for hwmon7:
❯ ls /sys/class/hwmon
hwmon0 hwmon1 hwmon2 hwmon3 hwmon4
So I looked into the directories and hwmon1 had 1 PWM controllers and hwmon4 had 7 PWM controllers. These are the controllers from my graphics card (nvidia, so noveau driver) and my motherboard:
❯ /usr/bin/cat /sys/class/hwmon/hwmon1/name
nouveau
❯ /usr/bin/cat /sys/class/hwmon/hwmon4/name
nct6798
Only after adding a line for hwmon1 and hwmon4 in the udev file was I able to control my fans.
I propose two solutions:
- Add all possible hwmon devices to the udev file
or
- Run a script to detect which hwmon has PWM controllers and only add those to the udev file
Please note that hwmon numbers will also change upon changing hardware configuration. So after swapping out a graphics card or the motherboard all numbers will be mixed up again (which will also mess with the fancontrol config file...)