# Not getting temperature from AMD FX-6300



## G_Nerc (Feb 16, 2013)

Good day!
On my system *FreeBSD 9.1 amd64* I can't get information about processor temperature:

CPU: AMD FX-6300 (3.5Ð“Ð“Ñ†, 8Mb, Socket AM3+)
MB: ASUS M5A97 R2.0 (AM3, AMD970/SB950)
I'm trying

```
device amdtemp
```
 and

```
device coretemp
```
in kernel config, but there is nothing in output of:
`$ sysctl -a| grep -i temp`
except

```
device amdtemp
hw.usb.template: 0
```
dmesg(8) from that PC on *PASTEBIN*


----------



## tingo (Feb 16, 2013)

In case you don't know: you can load kernel modules with kldload(8), you don't have to compile a new kernel.
coretemp(4) is for Intel Core cpus, it won't work with AMD cpus.
Since this is a motherboard from Asus, have your tied loading the aibs(4) kernel module? Perhaps it will work.


----------



## G_Nerc (Feb 16, 2013)

*tingo* thanks!
Yes I know that possible kldload modules, and I try that, just I know there is possible situation that kldload'ed module may work different (or not work) for example ndis.ko
And I know that coretemp for intel processors, I'm just try all variants 
I'm try *kldload aibs*, and it doesn't appears something new in output of *sysctl -a | grep -i temp*


----------



## Crest (Feb 16, 2013)

The FreeBSD 9.1 amdtemp kernel module lacks support for Bulldozer and newer cores. Take a look at the modules Makefile, find the source file (sys/dev/amdtemp/amdtemp.c), get it from -CURRENT and build, install and load the new module.


----------



## G_Nerc (Feb 16, 2013)

Yes *Crest* that solution working! But it seems some not fully adequate information:
*sysctl -a | grep -i temp*

```
dev.cpu.o.temperature: 16.2C
```
But PC located at office without condition so I don't think 16.2C is right temperature for processor core , I'm not in that office now, I will check when I will be at place.
What needs to do for best calibrate output from amdtemp for that processor?


----------



## tingo (Feb 17, 2013)

Crest said:
			
		

> The FreeBSD 9.1 amdtemp kernel module lacks support for Bulldozer and newer cores. Take a look at the modules Makefile, find the source file (sys/dev/amdtemp/amdtemp.c), get it from -CURRENT and build, install and load the new module.



Unfortunately, the latest revision doesn't compile on FreeBSD 8.3-stable:

```
root@kg-quiet# uname -a
FreeBSD kg-quiet.kg4.no 8.3-STABLE FreeBSD 8.3-STABLE #2: Fri Jan  4 19:18:15 CET 2013
     root@kg-quiet.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
root@kg-quiet# cd /usr/src/sys/dev/amdtemp
root@kg-quiet# ls -l /home/tingo/dl/amd*
lrwxr-xr-x  1 tingo  users     25 Feb 17 13:20 /home/tingo/dl/amdtemp.c -> amdtemp.c?revision=246128
-rw-r--r--  1 tingo  users  14509 Feb 17 13:17 /home/tingo/dl/amdtemp.c?revision=246128
root@kg-quiet# mv amdtemp.c amdtemp.c_old
root@kg-quiet# cp /home/tingo/dl/amdtemp.c .
root@kg-quiet# cd /usr/src/sys/modules/amdtemp
root@kg-quiet# make
Warning: Object directory not changed from original /usr/src/sys/modules/amdtemp
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:50:28: error: x86/pci_cfgreg.h: No such file or directory
cc1: warnings being treated as errors
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c: In function 'amdtemp_attach':
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:314: warning: implicit declaration of function 'pci_cfgregread'
/usr/src/sys/modules/amdtemp/../../dev/amdtemp/amdtemp.c:314: warning: nested extern declaration of 'pci_cfgregread'
*** Error code 1

Stop in /usr/src/sys/modules/amdtemp.
```
I'll ask for a MFC on the -stable mailinglist.


----------

