みんな大好きMINISFORUM BD790i/BD795iですが……
小型ハイスペックPCを組むのに最適(※諸説あります)なMINISFORUM BD790i/BD795i系マザーボードですが、中々Linuxで運用されてる方は見かけません(当社比)。
そして昨冬から半年ぐらい運用して最近暖かくなってきたことで気付いたのですが……
Debian12ではファンコントロールされません!
はい、掲題の通りBD790i/BD795i系マザーではDebian12だと負荷や温度に応じてファンコントロールされません。
多分Ubuntu22.04でもそうだと思うのですがまだ確認は取っていません。
冬の間は ヘリウムHDD×8、Intel Arc B580、爆熱HBA、4ポート2.5GbEのNIC を載せても精神衛生的に問題ないHDD温度だったのですが(当社比)、春になってグングン平均気温が上がるにつれて、
帰宅したら部屋が仄かに汗出るぐらい暑い。
そしてHDDが死の温度(某クラウドストレージ会社の統計によれば、50℃を超えたHDDは故障率が急上昇します)に近付いている。
……なんでこれでヨシと思って運用してきたんだ私は????
という訳で、今回は "BD790iとDebian12の組み合わせでPWMファンを制御しまSHOW" というお話になります。
スペックおさらい
さて、今回問題となっているのは我が家の 仮想化基盤サーバー1 。スペックは以下の通りです。
- OS:Debian12
- CPU:AMD Ryzen9 7945HX(2.5GHz/16C32T)
- RAM:DDR5-5200 48GB SO-DIMM×2(合計96GB)
- dGPU:Intel Arc B580
- SSD:4TB DRAMキャッシュ付 NVMe SSD
- HDD:14TB×2 + 12TB×6
- HBA:Broadcom 9211-8i
- PSU:850W 80Plus Gold電源
- NIC:2.5GbE×4ポートNIC
- FAN:120mm角25mm厚×3(吸気×2、CPU×1) + 120mm角15mm厚×1(排気)
- CASE:190mm幅ATXミニタワー
他にも細々としたものはありますが、主要コンポーネントは上掲の通りです。
この中でLXCやらQEMU/KVMやらが稼働してたり、iPhone16e買わなければNVIDIA RTX 2000 Ada世代載せてたかもなぁ とかはありますが取り敢えず大体こんな感じです。
前述したように、既に冬明けのこの時点で室温が汗かくレベルまで上昇するほどの排熱があります。
Peintium Dほどじゃないから許されてるけど、よくこれで厳しい夏を現行構成で乗り切れると思ってたな????
準備
条件設定
兎にも角にも、先ずはケース内の温度を下げることを考えなければなりません。
室温は最悪クーラー24時間運転でなんとかなるし ケースには既に新たなファンを取り付けられるスペースはなく、また 設置スペースと内蔵するHDDの数の都合で、ケースをより大きく冷却能力の高いものに換装することは出来ません。
また高回転ファンを搭載するというのも、サーバーと同居して眠るには支障がありますので却下。
割と詰んでるじゃねぇか
となれば、
- ファンは最大騒音値が許容範囲内(飽く迄も集合住宅の他の住人に迷惑をかけないレベルという意味であって、自分が眠るのに支障がないとは言っていない)の今装備しているPWMファンを使う
- 吸気量を上げる
- 排気量を上げる
- 負荷(センサー温度)に応じて自動で負荷追従運転するようにする
あたりになります。
UEFI/BIOSを調査
MINISFORUM BD790i/BD795i系マザーボードはあまり設定項目が多いとは言えません。
基本的にシンプル・イズ・ベストが服着て歩いているような感じです。
当然ながら(?)ファンコントロール項目も特にありません。チッ
WindowsOSインストールしていたならコントロールパネル等から簡単に触れてよしなに設定できるんですが、Debian12なので無いもの強請りです。
Linux用ソフトウェアを調査
となればLinuxなので、大抵はオープンソースソフトウェアで何かしらのファン操作ソフトはあるだろう、という仮定の下に探索します。
あるやんけ。
作業の流れ
- fancontrolをインストールする
- lm-sensorsをインストールする
- lm-sensorsで使用するセンサーを特定する
- fancontrolの設定を書く
- fancontrolを有効化する
ふーん、簡単そうじゃん(フラグ)。
作業
作業開始
先ずは必要なソフトをインストールします。
root@Debian12:~# apt update
root@Debian12:~# apt upgrade
root@Debian12:~# apt install fancontrol lm-sensors
インストールしたら、
root@Debian12:~# sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl: +69.0 C
Tccd1: +63.9 C
Tccd2: +60.2 C
nvme-pci-0500
Adapter: PCI adapter
Composite: +39.9 C (low = -40.1 C, high = +99.8 C)
(crit = +109.8 C)
Sensor 1: +39.9 C (low = -40.1 C, high = +99.8 C)
Sensor 2: +30.9 C (low = -40.1 C, high = +89.8 C)
amdgpu-pci-2f00
Adapter: PCI adapter
vddgfx: 1.39 V
vddnb: 844.00 mV
edge: +60.0 C
PPT: 44.14 W
……はい、見ての通りCPU/GPUとSSDの温度しか取得できていません。
root@Debian12:~# sensors-detect
# sensors-detect version 3.6.0
# System: Micro Computer (HK) Tech Limited MotherBoard Series [1.0]
# Board: Shenzhen Meigao Electronic Equipment Co.,Ltd DRFXI
# Kernel: 6.1.0-32-amd64 x86_64
# Processor: AMD Ryzen 9 7945HX with Radeon Graphics (25/97/2)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD Family 10h thermal sensors... No
AMD Family 11h thermal sensors... No
AMD Family 12h and 14h thermal sensors... No
AMD Family 15h thermal sensors... No
AMD Family 16h thermal sensors... No
AMD Family 17h thermal sensors... No
AMD Family 15h power sensors... No
AMD Family 16h power sensors... No
Hygon Family 18h thermal sensors... No
Intel digital thermal sensor... No
Intel AMB FB-DIMM thermal sensor... No
Intel 5500/5520/X58 thermal sensor... No
VIA C7 thermal sensor... No
VIA Nano thermal sensor... No
Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): YES
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Nuvoton/Fintek'... No
Trying family `ITE'... Yes
Found `ITE IT8613E Super IO Sensors' Success!
(address 0xa30, driver `to-be-written')
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Nuvoton/Fintek'... No
Trying family `ITE'... No
Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): YES
Probing for `IPMI BMC KCS' at 0xca0... No
Probing for `IPMI BMC SMIC' at 0xca8... No
Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): yes
Probing for `National Semiconductor LM78' at 0x290... No
Probing for `National Semiconductor LM79' at 0x290... No
Probing for `Winbond W83781D' at 0x290... No
Probing for `Winbond W83782D' at 0x290... No
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Using driver `i2c-piix4' for device 0000:00:14.0: AMD KERNCZ SMBus
Module i2c-dev loaded successfully.
Next adapter: Synopsys DesignWare I2C adapter (i2c-0)
Do you want to scan it? (YES/no/selectively): YES
Adapter doesn't support all probing functions.
Some addresses won't be probed.
Next adapter: Synopsys DesignWare I2C adapter (i2c-1)
Do you want to scan it? (YES/no/selectively): YES
Adapter doesn't support all probing functions.
Some addresses won't be probed.
Next adapter: SMBus PIIX4 adapter port 0 at 0b00 (i2c-2)
Do you want to scan it? (yes/NO/selectively): yes
Client found at address 0x48
Probing for `National Semiconductor LM75'... No
Probing for `National Semiconductor LM75A'... No
Probing for `Dallas Semiconductor DS75'... No
Probing for `National Semiconductor LM77'... No
Probing for `Analog Devices ADT7410/ADT7420'... No
Probing for `Analog Devices ADT7411'... No
Probing for `Maxim MAX6642'... No
Probing for `Texas Instruments TMP435'... No
Probing for `National Semiconductor LM73'... No
Probing for `National Semiconductor LM92'... No
Probing for `National Semiconductor LM76'... No
Probing for `Maxim MAX6633/MAX6634/MAX6635'... No
Probing for `NXP/Philips SA56004'... No
Probing for `SMSC EMC1023'... No
Probing for `SMSC EMC1043'... No
Probing for `SMSC EMC1053'... No
Probing for `SMSC EMC1063'... No
Client found at address 0x49
Probing for `National Semiconductor LM75'... No
Probing for `National Semiconductor LM75A'... No
Probing for `Dallas Semiconductor DS75'... No
Probing for `National Semiconductor LM77'... No
Probing for `Analog Devices ADT7410/ADT7420'... No
Probing for `Maxim MAX6642'... No
Probing for `Texas Instruments TMP435'... No
Probing for `National Semiconductor LM73'... No
Probing for `National Semiconductor LM92'... No
Probing for `National Semiconductor LM76'... No
Probing for `Maxim MAX6633/MAX6634/MAX6635'... No
Probing for `NXP/Philips SA56004'... No
Probing for `SMSC EMC1023'... No
Probing for `SMSC EMC1043'... No
Probing for `SMSC EMC1053'... No
Probing for `SMSC EMC1063'... No
Client found at address 0x50
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... No
Probing for `EDID EEPROM'... No
Client found at address 0x51
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... No
Next adapter: SMBus PIIX4 adapter port 2 at 0b00 (i2c-3)
Do you want to scan it? (yes/NO/selectively): yes
Next adapter: SMBus PIIX4 adapter port 1 at 0b20 (i2c-4)
Do you want to scan it? (yes/NO/selectively): yes
Client found at address 0x73
Probing for `FSC Poseidon I'... No
Probing for `FSC Poseidon II'... No
Probing for `FSC Scylla'... No
Probing for `FSC Hermes'... No
Probing for `FSC Heimdal'... No
Probing for `FSC Heracles'... No
Probing for `FSC Hades'... No
Probing for `FSC Syleus'... No
Client found at address 0x77
Probing for `Asus Mozart-2'... No
Next adapter: AMDGPU DM i2c hw bus 0 (i2c-5)
Do you want to scan it? (yes/NO/selectively): yes
Next adapter: AMDGPU DM i2c hw bus 1 (i2c-6)
Do you want to scan it? (yes/NO/selectively): yes
Next adapter: AMDGPU DM i2c hw bus 2 (i2c-7)
Do you want to scan it? (yes/NO/selectively): yes
Next adapter: AMDGPU DM aux hw bus 0 (i2c-8)
Do you want to scan it? (yes/NO/selectively): yes
Next adapter: AMDGPU DM aux hw bus 2 (i2c-9)
Do you want to scan it? (yes/NO/selectively): yes
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `to-be-written':
* ISA bus, address 0xa30
Chip `ITE IT8613E Super IO Sensors' (confidence: 9)
Note: there is no driver for ITE IT8613E Super IO Sensors yet.
Check https://hwmon.wiki.kernel.org/device_support_status for updates.
No modules to load, skipping modules configuration.
Unloading i2c-dev... OK
Unloading cpuid... OK
IT8613Eというセンサーはあるけど、ドライバが無いよ!と怒られています。
詰まり、ファン回転数を取得するドライバがDebian12に入っていないんですね。
ドライバ探して30分。
IT8613Eのドライバを探すこと30分。
Redditの書き込みを参考に、githubからit87というドライバを持ってきてインストールすれば良さそうと当たりをつけました。
早速インストールしてみましょう。
root@Deabin12:~# git clone https://github.com/frankcrawford/it87.git
root@Debian12:~# cd it87
root@Debian12:~# make dkms
backportsリポジトリのカーネルで起動していなければ素直にドライバのビルドが通ると思います(詰まりbackportsリポジトリを適用していたため素直に通らなかったが本記事では話が脇道に逸れるため割愛)。
fancontrolのconfigを書きます
各センサー/コントローラーが使用しているデバイスドライバの名前を正確に知る必要があります。
/sys/class/hwmon/ 配下の "hwmonX/name" をcatして、先ずデバイス名を知る必要があります。
root@Debian12:~# cat /sys/class/hwmon/hwmon2/name
k10temp
root@Debian12:~# cat /sys/class/hwmon/hwmon3/name
it8613
これで /sys/class/hwmon/hwmon2がCPU 、 /sys/class/hwmon/hwmon3がファンのセンサー兼コントローラー と分かりました。
次に次のコマンドを実行します。
root@Debian12:~# readlink -f /sys/class/hwmon/hwmon2/device | sed -e 's/^\/sys\///'
devices/pci0000:00/0000:00:18.3
root@Debian12:~# readlink -f /sys/class/hwmon/hwmon3/device | sed -e 's/^\/sys\///'
devices/platform/it87.2608
これで使用しているデバイスドライバの正確な名前が判明しましたので、Arch LinuxのWikiの記事を参考に、/etc/fancontrol を作成します。
INTERVAL=10
DEVPATH=hwmon2=devices/pci0000:00/0000:00:18.3 hwmon3=devices/platform/it87.2608
DEVNAME=hwmon2=k10temp hwmon3=it8613
FCTEMPS=hwmon3/pwm2=hwmon3/temp1_input
FCTEMPS=hwmon3/pwm3=hwmon3/temp1_input
FCTEMPS=hwmon3/pwm4=hwmon3/temp1_input
FCTEMPS=hwmon3/pwm5=hwmon3/temp1_input
FCFANS=hwmon3/pwm2=hwmon3/fan2_input
FCFANS=hwmon3/pwm3=hwmon3/fan3_input
FCFANS=hwmon3/pwm4=hwmon3/fan4_input
MINTEMP=hwmon3/pwm1=35000
MINTEMP=hwmon3/pwm2=35000
MINTEMP=hwmon3/pwm3=35000
MINTEMP=hwmon3/pwm4=35000
MINTEMP=hwmon3/pwm5=35000
MAXTEMP=hwmon3/pwm1=65000
MAXTEMP=hwmon3/pwm2=65000
MAXTEMP=hwmon3/pwm3=65000
MAXTEMP=hwmon3/pwm4=65000
MAXTEMP=hwmon3/pwm5=65000
MINSTART=hwmon3/pwm1=255
MINSTART=hwmon3/pwm2=255
MINSTART=hwmon3/pwm3=255
MINSTART=hwmon3/pwm4=255
MINSTART=hwmon3/pwm5=255
MINSTOP=hwmon3/pwm1=140
MINSTOP=hwmon3/pwm2=140
MINSTOP=hwmon3/pwm3=140
MINSTOP=hwmon3/pwm4=140
MINSTOP=hwmon3/pwm5=140
MINPWM=hwmon3/pwm1=140
MINPWM=hwmon3/pwm2=140
MINPWM=hwmon3/pwm3=140
MINPWM=hwmon3/pwm4=140
MINPWM=hwmon3/pwm5=140
MAXPWM=hwmon3/pwm1=255
MAXPWM=hwmon3/pwm2=255
MAXPWM=hwmon3/pwm3=255
MAXPWM=hwmon3/pwm4=255
MAXPWM=hwmon3/pwm5=255
やや冗長ですが、上掲のような記述になります。
もっと良い書き方があったら是非教えてください(切実)。
書き終わったら、次のコマンドを実行します。
root@Debian12:~# systemctl enable fancontrol.service --now
root@Debian12:~# systemctl status fancontrol.service
* fancontrol.service - fan speed regulator
Loaded: loaded (/lib/systemd/system/fancontrol.service; enabled; preset: enabled)
Active: active (running) since Sat 2025-04-12 22:36:19 JST; 2h 26min ago
Docs: man:fancontrol(8)
man:pwmconfig(8)
Process: 111995 ExecStartPre=/usr/sbin/fancontrol --check (code=exited, status=0/SUCCESS)
Main PID: 112239 (fancontrol)
Tasks: 2 (limit: 629145)
Memory: 1.4M
CPU: 9.929s
CGroup: /system.slice/fancontrol.service
|-112239 /bin/bash /usr/sbin/fancontrol
`-147390 sleep 10
Apr 12 22:36:19 Debian12 fancontrol[112239]: Controls
Apr 12 22:36:19 Debian12 fancontrol[112239]: MINTEMP=35000
Apr 12 22:36:19 Debian12 fancontrol[112239]: MAXTEMP=65000
Apr 12 22:36:19 Debian12 fancontrol[112239]: MINSTART=255
Apr 12 22:36:19 Debian12 fancontrol[112239]: MINSTOP=140
Apr 12 22:36:19 Debian12 fancontrol[112239]: MINPWM=140
Apr 12 22:36:19 Debian12 fancontrol[112239]: MAXPWM=255
Apr 12 22:36:19 Debian12 fancontrol[112239]: AVERAGE=1
Apr 12 22:36:19 Debian12 fancontrol[112239]: Enabling PWM on fans...
Apr 12 22:36:19 Debian12 fancontrol[112239]: Starting automatic fan control...
"Active: active (running)" の表示があればOKです。
上手く行けば、一瞬ファン回転数が大きくなった後、直ぐに制御されて静かになると思います。
作業結果
- 本記事の作業により、Debian12(おそらく他のLinux)でもファン回転数の自動コントロールを有効化出来た。
- 本記事の作業後、HDD温度が5〜10℃(!)程度、有意に低下した。
- 本記事の作業により、若干の騒音値上昇が起きた(生活雑音に紛れる程度)。
観察していると、どうもファンコントロールを入れる前は最低回転数(300rpm)でしかファンが回っていなかった気がする……
と言うか、もしかして昨夏の旧仮想化基盤サーバー(Xeon E5-2697v2)が喧しかったり発熱が制御出来なかったのってもしかして……(それ以上いけない