A utility to read the on-die temperature sensors on AMD K8/K10 CPUs on BSD systems.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Makefile
README
k8temp.8
k8temp.c
k8temp.h
k8temp_devpci.c
k8temp_devpci.h
k8temp_libpci.c
k8temp_libpci.h
k8temp_pci.h

README

k8temp - AMD K8 thermal diode reader
====================================

Synopsis
--------
k8temp displays readings from the on-die thermal diodes found in most
AMD K8 processors, including Athlon 64's and Opterons.

As of 0.4.0, k8temp can also produce values from AMD K10's, including
Barcelona and Phenom.  This support is experimental, and is unlikely to
report realistic values at this time.


=======
WARNING
=======
Since this pokes at PCI registers, it has the potential to make your system
crash, reboot, catch fire, and frame you for conspiracy to murder heads of state.

k8temp has caused at least one of these things to happen during development.


Installation
------------
If you're on FreeBSD, consider using the port at sysutils/k8temp.

Otherwise, just:

  make
  make install

The Makefile should detect any flags your OS needs.

If you want to try it on a system without bsd.prog.mk:

  cc -o k8temp k8temp.c k8temp_devpci.c

OpenBSD users (who have USER_PCI configured kernels) may want:

  cc -DWITHOUT_PCIOCGETCONF -o k8temp k8temp.c k8temp_devpci.c

NetBSD users can try:

  cc -DWITH_LIBPCI -o k8temp k8temp.c k8temp_libpci.c

But note this has only been build tested (on FreeBSD and NetBSD/Sparc...)

DragonFlyBSD should Just Work(tm), since it has an identical /dev/pci API
to FreeBSD.

Let me know if you get it working on systems other than FreeBSD 6 or 7.


Examples
--------
-% sudo k8temp
CPU 0 Core 0 Sensor 0: 35c
CPU 0 Core 1 Sensor 0: 36c
CPU 1 Core 0 Sensor 0: 33c
CPU 1 Core 1 Sensor 0: 32c
-% sudo k8temp -n 0:0:0 1:0:0
35
33
-% sudo k8temp -d
CPUID: Vendor: AuthenticAMD, Id=0x20f12 Model=1 Family=15 Stepping=2
Advanced Power Management=0xf
   Temperature sensor: Yes
 Frequency ID control: Yes
   Voltage ID control: Yes
    THERMTRIP support: Yes
   HW Thermal control: No
   SW Thermal control: No
   100MHz multipliers: No
   HW P-State control: No
        TSC Invariant: No
Thermtrip=0x0d540524 (CurTmp=0x54 (35c) TjOffset=0x0d DiodeOffset=0x05 (6c))
CPU 0 Core 0 Sensor 0: 35c
Thermtrip=0x0d560520 (CurTmp=0x56 (37c) TjOffset=0x0d DiodeOffset=0x05 (6c))
CPU 0 Core 1 Sensor 0: 37c
Thermtrip=0x0f530224 (CurTmp=0x53 (34c) TjOffset=0x0f DiodeOffset=0x02 (9c))
CPU 1 Core 0 Sensor 0: 34c
Thermtrip=0x0f520220 (CurTmp=0x52 (33c) TjOffset=0x0f DiodeOffset=0x02 (9c))
CPU 1 Core 1 Sensor 0: 33c

Yes, some AMD64's allegedly have two sensors per core.


References
----------
BIOS and Kernel Developer's Guide for AMD NPT Family 0fh Processors.
 Section 4.6.23, Thermtrip Status Register.
  http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf

BIOS and Kernel Developer's Guide (BKDG) For AMD Family 10h Processors
 Section 3.6.F3xA4, Reported Temperature Control Register.
  http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116.pdf

AMD CPUID Specification, revision 2.26.
  http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf

Linux kernel, drivers/hwmon/k8temp.c


Blame
-----
k8temp was written by Thomas Hurst <tom@hur.st>

WWW:  http://hur.st/k8temp/