Search This Blog

Thursday, February 09, 2006

温度、风扇、电压和cool'n'quiet(athlon64)

要在系统中得到主板上各处的温度,风扇转速和电压,必须在内核中有相应的支持,还要有lm-sensors,下面简单介绍一下步骤:
编译内核,在device drivers->i2c中选上对应的选项
< *> I2C support
I2C device interface
I2C Algorithms ---> //这里面的全选上
I2C Hardware Bus support ---> //这里面的选上对应硬件的模块
Miscellaneous I2C Chip support --->
[ ] I2C Core debugging messages
[ ] I2C Algorithm debugging messages
[ ] I2C Bus debugging messages
[ ] I2C Chip debugging messages


然后是device drivers->Hardware Monitoring support
这里要先弄清楚自己主板的sensor的芯片,然后选上对应的模块
然后安装lm-sensors,root运行sensors-detect,按照提示一步一步来,如果成功探测到芯片的话,最后按照提示把结果写入 /etc/modules就可以了,然后/etc/init.d/lm-sensors start,重新启动一下gkrellm,就会发现风扇,温度和电压已经可选了,随时监控:)

接着再说说AMD的cool'n'quiet
cool'n'quiet技术可以根据当前CPU的负载来自动调节CPU的频率,电压以及风扇的转速,电费吃人啊,能省则省啦
当然,这个功能也是需要内核的支持的,在Power management options->ACPI (Advanced Configuration and Power Interface) Support里选上Processor
CPU Frequency scaling里
[*] CPU Frequency scaling
[ ] Enable CPUfreq debugging
< *> CPU frequency translation statistics
[ ] CPU frequency translation statistics details
Default CPUFreq governor (performance) --->
--- 'performance' governor
'powersave' governor
'userspace' governor for userspace frequency scaling
'ondemand' cpufreq policy governor
<> Intel Enhanced SpeedStep
<> ACPI Processor P-States driver
--- shared options
[ ] /proc/acpi/processor/../performance interface (deprecated)


还要在bios里把pownow功能打开
完成后加载上必要的模块,先看一下/proc/cpuinfo
root@huzhou:/home/cxl# cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 47
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 0
cpu MHz : 2025.046
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm
bogomips : 4054.34
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc


然后root@huzhou:/home/cxl# echo ondemand>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
再看看
root@huzhou:/home/cxl# cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 47
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 0
cpu MHz : 1125.025
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm
bogomips : 2252.41
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc


可以看到频率已经从2025降到1125了(我超过频,如果没超频的话,是从1800到1000)
如果这时候有CPU密集型的进程运行,再看频率,会发现又是2025了

另外,如果发现加载powernow-k8模块时有如下错误的话
powernow-k8: BIOS error - no PSB or ACPI _PSS objects
可以尝试一下升级bios
enjoy it!

No comments: