熱対策

室温は27℃でも、排気口付近の本体下面がすごく熱くなって、GKrellMによる温度表示は60℃を下回ることがなく座椅子膝上直置きは無理な季節です。
色々調べてみると、ubuntu12.04は省電力をテーマの一つとして力を入れているという事なので、何とかならないものかと思いました。
前に書いたとおりBIOSでIntel HD Graphics 3000(Integrated Graphics)固定にすると、firefox起動時でも55℃くらいなので効果大です。
NVIDIA Optimus(自動切替)を選択しているだけでも、NVIDIA NVS 4200Mがかなり電力を消費するみたいです。

本題は、GPU以外の熱対策は何かできないかということでして、比較すべきではないかもしれませんけれどWindows起動時に比べてubuntu起動時のほうが熱い傾向にあったことから、何とかしたいと考えた次第です。要は「冷やす」か「消費電力量を減らす」かですけれど、やっぱり元を断たなきゃダメということで、結論から言うと、省電力化のために次のスクリプトを実行させることにしました。

#!/bin/sh

sleep 10

# Reduce power for SATA link power management
for i in 0 1 2 3 4 5 ; do
echo min_power>/sys/class/scsi_host/host${i}/link_power_management_policy
done

# Disable the NMI watchdog
echo 0 > /proc/sys/kernel/watchdog

# Enable Audio codec power management
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller

# Autosuspend for USB device
for i in /sys/bus/usb/devices/*/power/autosuspend; do
echo 1 > $i;
done
for i in /sys/bus/usb/devices/*/power/level; do
echo auto > $i;
done

# Runtime power-management for PCI devices
for i in /sys/bus/pci/devices/*/power/control ; do
echo auto > ${i}
done

これで体感的速度は殆ど変わらず省電力化できました。温度も45℃から50℃くらいなので大満足です。
スクリプトの実行には管理者権限が必要ですが、毎回ターミナルから起動させるのもなんなので、sudoersを編集して自動起動させることにしました。
sudoersの編集は、ターミナルから

sudo visudo

最終行に以下を追加(グループhoge)しました。スクリプト名は適当です。

%hoge ALL=NOPASSWD: /usr/local/sbin/power_save.sh

保存してターミナルに戻って、パスワード入力を求められる設定にします。新規にターミナルを起動してもいいです。

sudo -k

実行してみます。

sudo /usr/local/sbin/power_save.sh

省電力の確認・設定にはpowertopが便利ですが、設定を変更しても保存されず、再起動すると元に戻ってしまいます。
また、jupiterでPerformanceを確認したらPower On Demandになっていました。
CPUクロックの時間的変化を見る時は、ターミナルで

watch -n 1 grep ‘MHz’ /proc/cpuinfo

 
スクリプトは次のページを参考にしました。
http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption
http://www.joshuagranick.com/blog/2012/04/27/increase-battery-life-in-linux/

スクリプト実行前後のpowertopの様子は、

スクリプト実行前
Bad Enable SATA link power management for /dev/sda
Bad NMI watchdog should be turned off
Bad Power Aware CPU scheduler
Bad VM writeback timeout
Bad Enable Audio codec power management
Bad Autosuspend for USB device xHCI Host Controller [usb3]
Bad Autosuspend for USB device xHCI Host Controller [usb4]
Bad Autosuspend for USB device Broadcom Bluetooth Device (Broadcom Corp)
Bad Autosuspend for unknown USB device 1-1 (8087:0024)
Bad Autosuspend for unknown USB device 2-1 (8087:0024)
Bad Autosuspend for USB device EHCI Host Controller [usb1]
Bad Autosuspend for USB device EHCI Host Controller [usb2]
Bad Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family DRAM Controller
Bad Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
Bad Runtime PM for PCI Device Ricoh Co Ltd Device e823
Bad Runtime PM for PCI Device Intel Corporation 82579LM Gigabit Network Connection
Bad Runtime PM for PCI Device Intel Corporation Centrino Ultimate-N 6300
Good Bluetooth device interface status
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller
Good Runtime PM for PCI Device NVIDIA Corporation GF119 [Quadro NVS 4200M]
Good Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
Good Runtime PM for PCI Device NEC Corporation uPD720200 USB 3.0 Host Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family KT Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
Good Wake-on-lan status for device eth0
Good Wake-on-lan status for device wlan0
Good Using ‘ondemand’ cpufreq governor
 
 
スクリプト実行後
Bad Wireless Power Saving for interface wlan0
Bad Power Aware CPU scheduler
Bad VM writeback timeout
Bad Enable Audio codec power management
Good Enable SATA link power management for /dev/sda
Good NMI watchdog should be turned off
Good Bluetooth device interface status
Good Autosuspend for USB device EHCI Host Controller [usb1]
Good Autosuspend for USB device EHCI Host Controller [usb2]
Good Autosuspend for USB device xHCI Host Controller [usb3]
Good Autosuspend for USB device xHCI Host Controller [usb4]
Good Autosuspend for unknown USB device 1-1 (8087:0024)
Good Autosuspend for unknown USB device 2-1 (8087:0024)
Good Autosuspend for USB device Broadcom Bluetooth Device (Broadcom Corp)
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family KT Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
Good Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2
Good Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family DRAM Controller
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4
Good Runtime PM for PCI Device NEC Corporation uPD720200 USB 3.0 Host Controller
Good Runtime PM for PCI Device Ricoh Co Ltd Device e823
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
Good Runtime PM for PCI Device Intel Corporation Centrino Ultimate-N 6300
Good Runtime PM for PCI Device Intel Corporation 82579LM Gigabit Network Connection
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5
Good Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller
Good Wake-on-lan status for device eth0
Good Wake-on-lan status for device wlan0
Good Using ‘ondemand’ cpufreq governor

他にも、不要なサービスを停止する、gnome-classicにする、上記のBADをすべてGoodにする等の対策はありますので、省電力を極めたい方はお試しください。
 
 

Ubuntu, ThinkPad

Posted by yoshimi