这是一个可安装的 Linux 用户态风扇调度程序,用 OMEN K0000 / 8A4D 机型对应的 Hendricks N20E 风扇表,通过 hp-wmi 的 hwmon PWM 接口控制风扇。
默认策略:
- 默认监控 CPU、GPU 和内存 SPD:
--sensors CPU,GPU,SPD - GPU 默认只在 dGPU 已经
runtime_status=active时读取温度,D3/suspended 时跳过 - SPD 默认发现
spd5118温度,多个内存温度点取最高值,并且默认 10 秒读取一次 - 默认加载
SwFanControlCustomPerformance - 通过
/sys/class/hwmon/hwmon*/pwm1和pwm1_enable写入风扇档位 - 退出时恢复
pwm1_enable=2自动模式
Linux hp-wmi 当前 PWM 模式值:
pwm1_enable=0: 最大风扇pwm1_enable=1: 手动 PWMpwm1_enable=2: 自动模式
仓库根目录已经提供 PKGBUILD:
makepkg -si安装后命令为:
omen-k0000-fan-controller --helpsystemd 服务为:
sudo systemctl enable --now omen-k0000-fan-controller.servicepython3 omen_k0000_fan_controller.py --dry-run --once --simulate CPU=82,SPD=70查看真实传感器和 hp-wmi 发现结果:
sudo omen-k0000-fan-controller --dry-run --once -v如果 CPU 传感器自动识别不准,可以手动指定:
sudo omen-k0000-fan-controller --dry-run --once \
--cpu-temp /sys/class/hwmon/hwmon7/temp1_inputsudo omen-k0000-fan-controller --profile performance --sensors CPU,GPU,SPD --gpu-temp-policy active-only可选:同时切到内核平台性能配置:
sudo omen-k0000-fan-controller --profile performance --sensors CPU,GPU,SPD --gpu-temp-policy active-only --platform-profile performance默认服务已经让 CPU、GPU 和 SPD 温度参与调度,同时不唤醒 D3 状态的 dGPU:
sudo omen-k0000-fan-controller --sensors CPU,GPU,SPD --gpu-temp-policy active-onlyactive-only 会先读 PCI power/runtime_status。如果状态是 suspended,程序跳过 GPU 温度读取;只有状态已经是 active 时才读取 GPU hwmon 温度。不要用 nvidia-smi 轮询温度,它通常会唤醒或保持 dGPU 活跃。
SPD 指内存 SPD 温度,不是风扇转速。程序默认读取所有 spd5118 温度,取最高值参与决策。建议曲线已经加入默认配置:
0C -> 21
55C -> 21
60C -> 24
65C -> 28
70C -> 33
75C -> 40
80C -> 50
85C -> 58
低于 55C 时只保持性能配置的基础档位,不会因为内存空闲温度抬高风扇。默认 --spd-interval 10,也就是 SPD 温度每 10 秒读取一次;要更低频可以调大这个值。
当前机器检查结果:
hphwmon 只暴露fan1_input/fan2_input/pwm1/pwm1_enable/sys/class/thermal只有 ACPI/CPU/无线温度- 没有
IR、surface、skin或类似温度节点
Windows 反编译代码里 IR 通过 BiosWmiCmd_GetSync(131080, 35, ...) 获取,等价于 Linux hp-wmi 的 GM 通道命令类型 0x23。现有 linux/hp-wmi.c 没有把这个传感器命令导出成 hwmon 温度接口,所以 IR 目前不能直接被这个用户态调度器读取。
更多细节见 docs/hp-wmi-ir.md。
每轮调度流程:
- 读取启用的传感器,默认 CPU、GPU、SPD;SPD 使用低频缓存。
- 使用 JSON 里的
Lamda_Increase/Lamda_Decrease做非对称 EWMA 平滑。 - 查所选 profile 的风扇表,取启用传感器对应目标档位中的最高值。
- 将目标档位按表内最大档位映射为
0..255PWM。 - 写入
pwm1_enable=1和pwm1。
默认周期是 1 秒,对应 OEM 配置里的 IntervalAlgoShort=1000。
--profile default|performance|fan-curve: 选择内置 Hendricks N20E 风扇表。--sensors CPU,GPU,SPD: 选择监控传感器;可用CPU,GPU,SPD,IR或ALL,默认监控 CPU、GPU 和 SPD。--gpu-temp-policy active-only|always: GPU 温度读取策略,默认active-only,避免唤醒 D3。--spd-temp PATH: 手动指定 SPDtemp*_input,可以重复传入或用逗号分隔。--spd-interval 10: SPD 温度最小读取间隔秒数,默认 10 秒。--interval 1.0: 调度周期秒数。--fan-level-max 58: 指定最大档位到 PWM 255 的映射,默认用所选表最大值。--no-restore-auto: 退出时不恢复pwm1_enable=2。--ignore-board: 非 8A4D 主板也强制运行。--dump-curve: 打印加载后的风扇表。