Daemon for fan controlling like fancontrol
Allows using multiple temperature sources for controlling one fan. It's useful for water cooling systems when cpu and gpu connected in one path
Allows using complex algorithms for compute fan speed (by using JavaScript)
cargo build --release
sudo ./target/release/fandUsage: fand [OPTIONS]
Options:
-c, --config <PATH> [default: /etc/fand/config.toml]
-h, --help Print help
Configuration read from /etc/fand/config.toml by default
For working needs at least one source.XXX section and at least one fan value
Base properties:
intervalupdate interval in seconds (2by default)
example:
[main]
interval = 5Reading temperature from file
Properties:
pathpath to file for reading. required forfiletypefactormultiplier for values from file (0.001by default)
example:
[source.myCpu]
type = "file"
path = "/sys/devices/platform/nct6775.656/hwmon/hwmon1/temp13_input"
# values in `nct6775` driver written in 'millicelcius' and must be multiplied by 0.001
factor = 0.001Get temperature from nvidia devices. libnvidia-ml.so must be exists in the system
Properties:
nameselect card by name. optionaluuidselect card by uuid. optional
You can found name and uuid for all your cards at starting fand with correctly configured nvidia source section
log example:
[2024-02-11T15:05:18Z INFO fand::source::nvidia] Found NvidiaDevice { name: "NVIDIA GeForce RTX 5000", uuid: "GPU-23eda959-34a7-4abf-8e19-9c0beded366e" }
example:
[source.myGpu]
type = "nvidia"
name = "NVIDIA GeForce RTX 5000"
uuid = "GPU-23eda959-34a7-4abf-8e19-9c0beded366e"Write fan power to file in text format (values in range 0..=255)
Properties:
pathpath to pwm file. required forpwmtypevaluejs code for computing result. required forpwmtype
value must return double in range 0.0..=1.0 where 0.0 is power off and 1.0 is full speed
example:
[[fan]]
type = "pwm"
path = "/sys/devices/platform/nct6775.656/hwmon/hwmon2/pwm2"
value = '''
var calc;
if (!calc) calc = (minTemp, temp, maxTemp) => Math.min(1, (Math.max(temp, minTemp) - minTemp) / (maxTemp - minTemp) );
Math.max(1, calc(30, myCpu, 80), calc(30, myGpu, 40)) // result of last line will be used as power
'''