20c8f determine CPU temperature - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old December 8th, 2008, 15:57
Ole Ole is offline
Junior Member
 
Join Date: Nov 2008
Location: Saint-Petersburg, Russia
Posts: 72
Thanks: 3
Thanked 9 Times in 8 Posts
Default determine CPU temperature

Hello!

What there is a unique, a general method of fetching of statistics on CPU
temperature in FreeBSD? At "general" method - i mean is available in view of excluding
vendor-specific healh-agents with their vendors lock-in API.

As i know some way for this: smb(4) (for old PC?), coretemp(4) (this is for
new and only Intel hardware ?) and ipmi(4) if available, so each machine
customize for temp statistics throuch individual setup for source data?

And it is necessary to prefer what data if it is some given. For example 2
commands on host give diffrent result:
(With 'ipmitool')

Quote:
% ipmitool sensor |egrep "[0-9]++ Temp"
CPU 1 Temp | na | degrees C | na | na | 74.000 | -128.000 | -48.000 | na | na
CPU 2 Temp | na | degrees C | na | na | 74.000 | -128.000 | -48.000 | na | na
<< i get 74C on my CPU1 and CPU2

(with coretemp(4) i get individual per-core sensor)
Quote:
% sysctl -a |egrep -E "cpu\.[0-9]+\.temp"
dev.cpu.0.temperature: 38
dev.cpu.1.temperature: 45
dev.cpu.2.temperature: 42
dev.cpu.3.temperature: 69
ipmi/coretemp facility is fetching information for CPU from diffrent sensors?

And how much correctly with coretemp(4) to receive the general temperature
(one number as in Bios) if average(sum(core temperature)) / (num of core) ?
Thanks in advance!
Reply With Quote
  #2  
Old December 8th, 2008, 18:32
sverreh's Avatar
sverreh sverreh is offline
Member
 
Join Date: Nov 2008
Location: Norway
Posts: 124
Thanks: 25
Thanked 14 Times in 13 Posts
Default

I use this on 7.0:

Code:
# sysctl hw.acpi.thermal.tz0.temperature
I don't know if this is general enough for you, but at least it is not vendor specific.
Reply With Quote
  #3  
Old December 8th, 2008, 19:18
felix's Avatar
felix felix is offline
Junior Member
 
Join Date: Nov 2008
Posts: 17
Thanks: 0
Thanked 14 Times in 3 Posts
Default

Quote:
Originally Posted by sverreh View Post
I use this on 7.0:

Code:
# sysctl hw.acpi.thermal.tz0.temperature
FreeBSD 7.0-RELEASE (GENERIC) #0: Sun Feb 24 19:59:52 UTC 2008
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2992.51-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0xf41 Stepping = 1
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE ,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH, DTS,ACPI,MMX,FXSR,SSE,SSE2,
Features2=0x441d<SSE3,DTES64,MON,DS_CPL,CNXT-ID,xTPR>
Logical CPUs per core: 2

Code:
# sysctl hw.acpi.thermal.tz0.temperature
sysctl: unknown oid 'hw.acpi.thermal.tz0.temperature'

Last edited by felix; December 8th, 2008 at 20:04.
Reply With Quote
  #4  
Old December 8th, 2008, 19:43
Ole Ole is offline
Junior Member
 
Join Date: Nov 2008
Location: Saint-Petersburg, Russia
Posts: 72
Thanks: 3
Thanked 9 Times in 8 Posts
Default

Unusable for me too:
Quote:
[root@ ~]# uname -rp
8.0-CURRENT i386
[root@ ~]# sysctl hw.acpi.thermal.tz0.temperature
sysctl: unknown oid 'hw.acpi.thermal.tz0.temperature'
Quote:
I don't know if this is general enough for you, but at least it is not vendor specific.
- Everything that not require downloads special (!= FreeBSD/kernel/userland) soft.
Reply With Quote
  #5  
Old December 8th, 2008, 19:54
softblur softblur is offline
Junior Member
 
Join Date: Nov 2008
Location: Norway
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is your processor? I have an Athlon 64 X2 6000+ myself, and the only thing that seems to work is sysutils/k8temp. Even so, there is some discussion about how to interpret the offset corrections.
Reply With Quote
  #6  
Old December 8th, 2008, 20:05
sverreh's Avatar
sverreh sverreh is offline
Member
 
Join Date: Nov 2008
Location: Norway
Posts: 124
Thanks: 25
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by felix View Post
FreeBSD 7.0-RELEASE (GENERIC) #0: Sun Feb 24 19:59:52 UTC 2008

Code:
# sysctl hw.acpi.thermal.tz0.temperature
sysctl: unknown oid 'hw.acpi.thermal.tz0.temperature'
So then I'm wrong! I thought this was new in 7.0, because I didn't find it on 6.1. But that was another machine.

Code:
  # uname -mrisv
FreeBSD 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386 GENERIC
 # sysctl hw.acpi.thermal.tz0.temperature
hw.acpi.thermal.tz0.temperature: 43.0C
 #
CPU (From /var/run/dmesg.boot):

Code:
CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz (2806.37-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf29  Stepping = 9
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x4400<CNXT-ID,xTPR>
  Logical CPUs per core: 2

Last edited by sverreh; December 8th, 2008 at 20:13. Reason: Added CPU info
Reply With Quote
  #7  
Old December 8th, 2008, 21:04
none's Avatar
none none is offline
Junior Member
 
Join Date: Nov 2008
Posts: 94
Thanks: 7
Thanked 2 Times in 2 Posts
Default

hail,

I have a pretty old cpu and this works fine:

[xxx@xxx /usr/home/xxx/bin]$ cat tz.sh
sysctl hw.acpi.thermal.tz0.temperature
[xxx@xxx /usr/home/xxx/bin]$ ./tz.sh
hw.acpi.thermal.tz0.temperature: 43.5C

[xxx@xxx /usr/home/xxx/bin]$ dmesg | head -12
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.1-PRERELEASE #1: Thu Nov 13 23:54:59 BRT 2008
root@lamneth:/usr/obj/usr/src/sys/xxx_7-3G
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) XP 1700+ (1466.51-MHz 686-class CPU)
Origin = "AuthenticAMD" Id = 0x681 Stepping = 1
Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE, CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR, SSE>
AMD Features=0xc0400800<SYSCALL,MMX+,3DNow!+,3DNow!>
real memory = 1072562176 (1022 MB)

just on my turion laptop it always said 60°, no matter what
I loaded no special modules though

none
__________________
Nenhum_de_Nos
"We will call you cygnus, The God of balance you shall be"
Reply With Quote
  #8  
Old December 8th, 2008, 21:54
Ole Ole is offline
Junior Member
 
Join Date: Nov 2008
Location: Saint-Petersburg, Russia
Posts: 72
Thanks: 3
Thanked 9 Times in 8 Posts
Default

Quote:
Originally Posted by softblur View Post
What is your processor? I have an Athlon 64 X2 6000+ myself, and the only thing that seems to work is sysutils/k8temp. Even so, there is some discussion about how to interpret the offset corrections.
my home desktop station hw:
Quote:
dmesg |head -n24
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-CURRENT #14 r184646M: Mon Dec 8 19:57:54 MSK 2008
root@:/usr/obj/usr/src/sys/home
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz (2833.31-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x10677 Stepping = 7
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE ,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH, DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x8e3fd<SSE3,DTES64,MON,DS_CPL,VMX,SMX,E ST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1>
AMD Features=0x20000000<LM>
AMD Features2=0x1<LAHF>
TSC: P-state invariant
Cores per package: 4
real memory = 2146697216 (2047 MB)
avail memory = 2088386560 (1991 MB)
ACPI APIC Table: <101308 APIC1117>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP): APIC ID: 3
ioapic0 <Version 1.1> irqs 0-23 on motherboard
hw.acpi.thermal.tz0.temperature - its unknown OIDs for my system but coretemp is usable:
Quote:
% kldload coretemp
% sysctl -a |grep temper
dev.cpu.0.temperature: 60
dev.cpu.1.temperature: 60
dev.cpu.2.temperature: 64
dev.cpu.3.temperature: 64
As i understand from man acpi_thermal(4) OID hw.acpi.thermal.tz0.temperature produce by some acpi module
Quote:
ls /boot/kernel |grep ^acpi
acpi.ko
acpi_aiboost.ko
acpi_asus.ko
acpi_dock.ko
acpi_fujitsu.ko
acpi_ibm.ko
acpi_panasonic.ko
acpi_sony.ko
acpi_toshiba.ko
acpi_video.ko
For me all of this acpi_* (particularly acpi_asus) not correct for me (Motherboard is Asus P5N64) no one gets OIDs.

BTW, hw.acpi.thermal.tz%d.temperature - it temperature for CPU? Not motherboard sensor?
Reply With Quote
  #9  
Old December 9th, 2008, 08:47
sT4k3's Avatar
sT4k3 sT4k3 is offline
Junior Member
 
Join Date: Nov 2008
Location: Russia, Perm
Posts: 21
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hi, I have servers on Intel Xeon CPU, but
Quote:
sysctl -a | grep tempe
hw.acpi.thermal.tz0.temperature: 8.3C
this is wrong, than to take temperature on this cpu ?
Reply With Quote
  #10  
Old December 9th, 2008, 13:00
braveduck's Avatar
braveduck braveduck is offline
Junior Member
 
Join Date: Nov 2008
Location: Kyiv
Posts: 21
Thanks: 4
Thanked 6 Times in 4 Posts
Default

sysutils/healthd works fine for me
Reply With Quote
  #11  
Old December 12th, 2008, 10:32
X-Istence X-Istence is offline
Junior Member
 
Join Date: Nov 2008
Location: ::1
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem you are seeing with the acpi thermal zones is the fact that FreeBSD may not fully support the ACPI information given to it, especially if the motherboard has only been tested with Windows.

Other reasons for seeing values that never change is because the BIOS is using the ACPI data to control the fans and ACPI is given false information so that the OS does not attempt to modify the fan speeds based upon this data.

The reason some of you may not have the thermal zones is because the motherboard does not export them in ACPI and thus they are not useable.

For most of my motherboards I use mbmon from the ports tree, works like a charm on most of my systems.
Reply With Quote
  #12  
Old December 12th, 2008, 21:45
softblur softblur is offline
Junior Member
 
Join Date: Nov 2008
Location: Norway
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

X-Istence, you may be right as far as your comments go.

But some programs, like sysutils/k8temp, read straight from the processor according to documentation from AMD, so the whole issue of ACPI and motherboard is bypassed. I suppose similar programs exist for Intel processors. The surprising thing is that the correct interpretation of readings and offset corrections still seems to be troublesome. At least, with the googling I have done, I have not found any definitive answer. Like sT4k3 I find that the core temp reported is sometimes below ambient temperature, which simply cannot be the case.

And, FWIW, mbmon does not work on my current system.
Reply With Quote
  #13  
Old December 12th, 2008, 23:30
X-Istence X-Istence is offline
Junior Member
 
Join Date: Nov 2008
Location: ::1
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I never went as far as to insinuate that ACPI was required for everything. Yes, software exists that reads it directly from the hardware in question bypassing ACPI, which is the only way to get valid data most of the time. I was just pointing out the flaws in ACPI and while it is a standard way to get data from a motherboard for some odd reason not everything is supported everywhere causing problems as a whole.
Reply With Quote
  #14  
Old March 2nd, 2009, 19:16
Darwin Darwin is offline
Junior Member
 
Join Date: Nov 2008
Location: Russia
Posts: 14
Thanks: 0
Thanked 3 Times in 2 Posts
Default

FreeBSD 7.0-RELEASE

Code:
(21:15)-[root@home /home/Darwin]# kldstat | grep core
13    1 0xc3a88000 3000     coretemp.ko
(21:15)-[root@home /home/Darwin]# 
(21:15)-[root@home /home/Darwin]# sysctl -a | grep temp
(21:15)-[root@home /home/Darwin]#
__________________
FreeBSD - my life.
Reply With Quote
  #15  
Old March 2nd, 2009, 22:23
ale's Avatar
ale ale is offline
Senior Member
 
Join Date: Nov 2008
Location: Roma
Posts: 1,064
Thanks: 0
Thanked 160 Times in 146 Posts
Default

As I don't have an Intel cpu on my desktop, but I have an Asus mb, as an alternative to k8temp:

# kldload acpi_aiboost
Code:
$ sysctl -a | grep aiboost
dev.acpi_aiboost.0.%desc: ASUStek AIBOOSTER
dev.acpi_aiboost.0.%driver: acpi_aiboost
dev.acpi_aiboost.0.%location: handle=\_SB_.PCI0.SBRG.ASOC
dev.acpi_aiboost.0.%pnpinfo: _HID=ATK0110 _UID=16843024
dev.acpi_aiboost.0.%parent: acpi0
dev.acpi_aiboost.0.temp0: 510
dev.acpi_aiboost.0.temp1: 300
dev.acpi_aiboost.0.volt0: 1312
dev.acpi_aiboost.0.volt1: 3328
dev.acpi_aiboost.0.volt2: 4919
dev.acpi_aiboost.0.volt3: 11430
dev.acpi_aiboost.0.fan0: 2960
dev.acpi_aiboost.0.fan1: 0
dev.acpi_aiboost.0.fan2: 0
I guess the temperature should be divided by 10.
Reply With Quote
  #16  
Old March 3rd, 2009, 11:27
trev trev is offline
Member
 
Join Date: Dec 2008
Posts: 343
Thanks: 13
Thanked 39 Times in 36 Posts
Default

AMD Phenom 9550 - none of the existing kernel modules or ports utils work, so I wrote my own to interrogate the ITE IT8718F super i/o chip environment controller on the Gigabyte motherboard

Code:
root# it8718fd -v
Found an ITE IT8718F (id 0x8718, version 0x05) at special address port 0x2e

System 41C
CPU 37C
Northbridge 85C

CPU 2039 rpm
System 0 rpm
Northbridge 5400 rpm

Vcore    1.06
VDDR     2.00
+3.3     3.23
+5       4.95
+12      11.49
-12      -11.86
-5       -6.85
VSB      0.00
Vbat     3.18
It can also be run as a daemon with output via syslog:

Code:
Mar  3 21:24:22 shadow it8718fd: Temp 41, 37, 85; RPM 2020, 0, 5443; Volts 1.06, 2.00, 3.23, 4.95, 11.49, -11.86, -6.85, 0.00, 3.18
Reply With Quote
  #17  
Old March 3rd, 2009, 11:52
kegf kegf is offline
Junior Member
 
Join Date: Nov 2008
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
Default

Mbmon - nice motherboard monitor with different access methods ("VIA686 HWM directly"|"SMBus"|"ISA I/O port").

# mbmon -I -c
Temp.= 31.0, 51.0, 0.0; Rot.= 2678, 3750, 2083
Vcore = 1.36, 3.15; Volt. = 3.26, 5.13, 11.98, -14.59, -7.71
Reply With Quote
  #18  
Old November 17th, 2009, 16:02
Mad_Dud's Avatar
Mad_Dud Mad_Dud is offline
Junior Member
 
Join Date: Jan 2009
Posts: 18
Thanks: 4
Thanked 0 Times in 0 Posts
Default

I also can't get thermal data on my box.

Code:
x# uname -a
FreeBSD --- 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 08:49:13 UTC 2009
     root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
x# mbmon
ioctl(smb0:open): No such file or directory
No Hardware Monitor found!!
InitMBInfo: Bad file descriptor
x# mbmon -d                                                   
ioctl(smb0:open): No such file or irectory                       
SMBus[Intel8XX(ICH/ICH2/ICH3/ICH4/ICH5/ICH6)] found, but No HWM available on it!!
No Hardware Monitor found!!                                                      
InitMBInfo: Bad file descriptor    
x# sysctl -a hw.acpi.thermal.tz0.temperature                                 
sysctl: unknown oid 'hw.acpi.thermal.tz0.temperature'    
x# sysctl -a | grep temp
net.inet6.ip6.use_tempaddr: 0
net.inet6.ip6.temppltime: 86400
net.inet6.ip6.tempvltime: 604800
net.inet6.ip6.prefer_tempaddr: 0
x#  sysctl -a | grep CPU                                                  
hw.model: Intel(R) Pentium(R) 4 CPU 3.00GHz                                                                    
dev.cpu.0.%desc: ACPI CPU                                                                                      
dev.cpu.0.%location: handle=\_PR_.CPU1                                                                         
dev.cpu.1.%desc: ACPI CPU                                                                                      
dev.cpu.1.%location: handle=\_PR_.CPU2                                                                         
dev.p4tcc.0.%desc: CPU Frequency Thermal Control                                                               
dev.p4tcc.1.%desc: CPU Frequency Thermal Control                                                               
x#  sysctl -a | grep cpu                                                  
kern.threads.virtual_cpu: 2                                                                                    
kern.ccpu: 0                                                                                                   
kern.smp.cpus: 2                                                                                               
kern.smp.maxcpus: 16                                                                                           
debug.cpufreq.verbose: 0                                                                                       
debug.cpufreq.lowest: 0                                                                                        
debug.kdb.stop_cpus: 1                                                                                         
debug.stop_cpus_with_nmi: 1                                                                                    
debug.PMAP1changedcpu: 3698                                                                                    
hw.ncpu: 2                                                                                                     
hw.acpi.cpu.cx_lowest: C1                                                                                      
machdep.cpu_idle_hlt: 1                                                                                        
machdep.hlt_cpus: 0
machdep.hlt_logical_cpus: 0
machdep.logical_cpus_mask: 2
dev.cpu.0.%desc: ACPI CPU
dev.cpu.0.%driver: cpu
dev.cpu.0.%location: handle=\_PR_.CPU1
dev.cpu.0.%pnpinfo: _HID=none _UID=0
dev.cpu.0.%parent: acpi0
dev.cpu.0.freq: 2992
dev.cpu.0.freq_levels: 2992/-1 2618/-1 2244/-1 1870/-1 1496/-1 1122/-1 748/-1
dev.cpu.0.cx_supported: C1/0
dev.cpu.0.cx_lowest: C1
dev.cpu.0.cx_usage: 100.00%
dev.cpu.1.%desc: ACPI CPU
dev.cpu.1.%driver: cpu
dev.cpu.1.%location: handle=\_PR_.CPU2
dev.cpu.1.%pnpinfo: _HID=none _UID=0
dev.cpu.1.%parent: acpi0
dev.cpu.1.cx_supported: C1/0
dev.cpu.1.cx_lowest: C1
dev.cpu.1.cx_usage: 100.00%
dev.p4tcc.0.%parent: cpu0
dev.p4tcc.1.%parent: cpu1
dev.cpufreq.0.%driver: cpufreq
dev.cpufreq.0.%parent: cpu0
dev.cpufreq.1.%driver: cpufreq
dev.cpufreq.1.%parent: cpu1
Reply With Quote
  #19  
Old August 21st, 2011, 15:17
CISCOKID CISCOKID is offline
Junior Member
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When I run the command: sysctl -a | grep tempe
I get the following...

Code:
dev.cpu.0.temperature: 42
dev.cpu.1.temperature: 41
dev.cpu.2.temperature: 45
dev.cpu.3.temperature: 45
Are these values in CELSIUS or FAHRENHEIT? I can't recall the last time I cleaned my cooling fans so I'm wondering if I should.

Last edited by DutchDaemon; August 21st, 2011 at 17:43.
Reply With Quote
  #20  
Old August 21st, 2011, 16:40
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,720
Thanks: 432
Thanked 1,760 Times in 1,457 Posts
Default

Celsius.
Reply With Quote
  #21  
Old August 21st, 2011, 19:53
xibo xibo is offline
Member
 
Join Date: Dec 2010
Location: Germany
Posts: 300
Thanks: 13
Thanked 61 Times in 50 Posts
Default

45C is fine, but cleaning your computer won't hurt
Reply With Quote
Reply

Tags
cpu temperature

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:21.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0