Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which sensors are available on a multi-CPU AMD system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Mon Aug 12, 2024 5:35 pm    Post subject: Which sensors are available on a multi-CPU AMD system? Reply with quote

Hi All,

Following advice in this topic i'm starting a separate topic for this question: https://forums.gentoo.org/viewtopic-t-1163405.html

I'm working on a program that sets the CPU's maximum frequency based on it's temperature. This allows systems to run cooler, it keeps my passive cooled system at about 70 degrees max under full load, and keeps more power hungry systems cooler so active fans can run slower (and make less noise).

One feature i'd like to add is multi-CPU support. So this is not multi-CORE, but really two (or more) physically separate CPU's on the motherboard. Sysfs reports which core belongs to which physical package, so setting the frequency per physical CPU should be easy.
Temperature readings for intel are easy too, there is a sensor called "Package id <number>" per CPU. For AMD systems i can't find the information to locate the sensors and how to relate them to a physical CPU.

If someone has access to a multi-CPU AMD system, would you be willing to run this script to collect some information and post the results here?
Code:
#!/bin/bash

HWMONS=`find /sys/class/hwmon/ -mindepth 1`

for HWMON in $HWMONS
do
 echo "Directory: $HWMON"
 echo "Driver: `cat "$HWMON/name"`"
 
 TEMPS=`find "$HWMON/" -maxdepth 2 -name "temp*_input"`
 for TEMP in $TEMPS
 do
  LABEL=${TEMP//_input/_label}
  if [ -r "$LABEL" ]
  then
   echo "`cat $LABEL` at $TEMP, value: `cat $TEMP`"
  else
   echo "Unnamed sensor at $TEMP, value: `cat $TEMP`"
  fi

 done

done

It will list all hwmon's with driver names and sensors, root privileges are not required. For example this is the output on my single-CPU multi-CORE intel system:
Code:
Directory: /sys/class/hwmon/hwmon2
Driver: drivetemp
Unnamed sensor at /sys/class/hwmon/hwmon2/temp1_input, value: 42000
Directory: /sys/class/hwmon/hwmon0
Driver: acpitz
Unnamed sensor at /sys/class/hwmon/hwmon0/temp1_input, value: 48000
Directory: /sys/class/hwmon/hwmon1
Driver: coretemp
Core 1 at /sys/class/hwmon/hwmon1/temp3_input, value: 46000
Core 2 at /sys/class/hwmon/hwmon1/temp4_input, value: 46000
Package id 0 at /sys/class/hwmon/hwmon1/temp1_input, value: 48000
Core 3 at /sys/class/hwmon/hwmon1/temp5_input, value: 46000
Core 0 at /sys/class/hwmon/hwmon1/temp2_input, value: 46000


Thanks in advance for any information you can provide.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
molletts
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2013
Posts: 129

PostPosted: Tue Aug 13, 2024 6:32 pm    Post subject: Reply with quote

This is from an older dual-Opteron 6380 (Piledriver) system, using the k10temp sensor driver:
Code:
Directory: /sys/class/hwmon/hwmon8
Driver: be2net
Unnamed sensor at /sys/class/hwmon/hwmon8/temp1_input, value: 44000
Directory: /sys/class/hwmon/hwmon6
Driver: be2net
Unnamed sensor at /sys/class/hwmon/hwmon6/temp1_input, value: 44000
Directory: /sys/class/hwmon/hwmon4
Driver: k10temp
Unnamed sensor at /sys/class/hwmon/hwmon4/temp1_input, value: 28500
Directory: /sys/class/hwmon/hwmon2
Driver: k10temp
Unnamed sensor at /sys/class/hwmon/hwmon2/temp1_input, value: 30625
Directory: /sys/class/hwmon/hwmon0
Driver: fam15h_power
Directory: /sys/class/hwmon/hwmon7
Driver: tg3
Unnamed sensor at /sys/class/hwmon/hwmon7/temp1_input, value: 55000
Directory: /sys/class/hwmon/hwmon5
Driver: k10temp
Unnamed sensor at /sys/class/hwmon/hwmon5/temp1_input, value: 28625
Directory: /sys/class/hwmon/hwmon3
Driver: fam15h_power
Directory: /sys/class/hwmon/hwmon1
Driver: k10temp
Unnamed sensor at /sys/class/hwmon/hwmon1/temp1_input, value: 34000

Unfortunately, it only reports a single temperature per package [EDIT: correction: actually per die, with two 8-core dies per package, therefore four k10temp instances listed], as you can see. They look a bit on the low side, too, given that the system is busy at the moment. The iLO management module reports the CPU temps to be about 12° above this. My FX-9590 (also Piledriver) desktop routinely reports about 20° below its actual temperature via the k10temp sensors.


Last edited by molletts on Sun Sep 29, 2024 8:57 am; edited 1 time in total
Back to top
View user's profile Send private message
assemblerhead
n00b
n00b


Joined: 23 Jan 2016
Posts: 36
Location: TX,US

PostPosted: Fri Sep 27, 2024 11:44 pm    Post subject: Reply with quote

AMD 3950X 16 Core

Sensor modules : lm92, k10temp, jedec, nct6775

Code:

Directory: /sys/class/hwmon/hwmon2
Driver: amdgpu
mem at /sys/class/hwmon/hwmon2/temp3_input, value: 42000
edge at /sys/class/hwmon/hwmon2/temp1_input, value: 30000
junction at /sys/class/hwmon/hwmon2/temp2_input, value: 36000
Directory: /sys/class/hwmon/hwmon0
Driver: k10temp
Tccd1 at /sys/class/hwmon/hwmon0/temp3_input, value: 39750
Tccd2 at /sys/class/hwmon/hwmon0/temp4_input, value: 37250
Tctl at /sys/class/hwmon/hwmon0/temp1_input, value: 37750
Directory: /sys/class/hwmon/hwmon1
Driver: nct6797
AUXTIN3 at /sys/class/hwmon/hwmon1/temp6_input, value: -3000
TSI0_TEMP at /sys/class/hwmon/hwmon1/temp13_input, value: 37875
AUXTIN0 at /sys/class/hwmon/hwmon1/temp3_input, value: 34500
PCH_CPU_TEMP at /sys/class/hwmon/hwmon1/temp10_input, value: 0
SMBUSMASTER 0 at /sys/class/hwmon/hwmon1/temp7_input, value: 37500
AUXTIN1 at /sys/class/hwmon/hwmon1/temp4_input, value: -128000
PCH_MCH_TEMP at /sys/class/hwmon/hwmon1/temp11_input, value: 0
PCH_CHIP_CPU_MAX_TEMP at /sys/class/hwmon/hwmon1/temp8_input, value: 0
SYSTIN at /sys/class/hwmon/hwmon1/temp1_input, value: 33000
AUXTIN2 at /sys/class/hwmon/hwmon1/temp5_input, value: 52000
Agent0 Dimm0 at /sys/class/hwmon/hwmon1/temp12_input, value: 0
PCH_CHIP_TEMP at /sys/class/hwmon/hwmon1/temp9_input, value: 0
CPUTIN at /sys/class/hwmon/hwmon1/temp2_input, value: 33000
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Sat Sep 28, 2024 2:43 pm    Post subject: Reply with quote

Thanks for sharing your outputs

Quote:
Unfortunately, it only reports a single temperature per package, as you can see.

I see. My main interest is to see how to distinguish the sensors from both CPU's, to see which sensor belongs to which CPU. They both use the k10temp module and they both don't provide a label :(. This confirms what I've seen before.
Also sorry for my late response, somehow i've missed your reply.

Quote:
AMD 3950X 16 Core

This seems like a single CPU with 16 cores, so CPU-wise this gives no new information for me.
The nct6797 driver makes me curious, guessing from the sensors names it seems to be your motherboard, is that correct?
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
molletts
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2013
Posts: 129

PostPosted: Sun Sep 29, 2024 8:55 am    Post subject: Reply with quote

You just prompted me to re-read what I wrote and I noticed a brainfart - I should have written "it only reports a single temperature per die" rather than "per package".

That's no more helpful from the point of view of identifying which temperature corresponds with which CPU, though.

[EDIT: gah, spleling :roll:]


Last edited by molletts on Sun Sep 29, 2024 7:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Sun Sep 29, 2024 9:00 am    Post subject: Reply with quote

Thanks for pointing that out, i hadn't noticed there were 4 k10temp modules.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3425
Location: Canada

PostPosted: Sun Sep 29, 2024 5:59 pm    Post subject: Reply with quote

Module coretemp does not do anything for AMD's ?
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Tue Oct 01, 2024 5:14 pm    Post subject: Reply with quote

Not that i'm aware of, any output i've seen on AMD systems only shows k10temp. Coretemp seems to be intel specific.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Tue Oct 01, 2024 5:37 pm    Post subject: Reply with quote

pa4wdh wrote:
[...] Coretemp seems to be intel specific.

Yes, it is. This kernel configuration of CONFIG_SENSORS_CORETEMP is titled: "Intel Core/Core2/Atom temperature sensor" and the <Help> says also: "Most of the family 6 CPUs are supported."

(Family 6 is Intel CPU)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
druggo
Guru
Guru


Joined: 24 Sep 2003
Posts: 318
Location: Hangzhou, China

PostPosted: Wed Oct 02, 2024 3:50 pm    Post subject: Reply with quote

AMD EPYC 7B12 64-Core Processor X2

Code:
Directory: /sys/class/hwmon/hwmon6
Driver: k10temp
Tccd4 at /sys/class/hwmon/hwmon6/temp6_input, value: 48000
Tccd1 at /sys/class/hwmon/hwmon6/temp3_input, value: 48250
Tccd8 at /sys/class/hwmon/hwmon6/temp10_input, value: 48250
Tccd5 at /sys/class/hwmon/hwmon6/temp7_input, value: 56500
Tccd2 at /sys/class/hwmon/hwmon6/temp4_input, value: 47250
Tccd6 at /sys/class/hwmon/hwmon6/temp8_input, value: 49750
Tctl at /sys/class/hwmon/hwmon6/temp1_input, value: 53750
Tccd3 at /sys/class/hwmon/hwmon6/temp5_input, value: 50000
Tccd7 at /sys/class/hwmon/hwmon6/temp9_input, value: 47750
Directory: /sys/class/hwmon/hwmon4
Driver: nvme
Composite at /sys/class/hwmon/hwmon4/temp1_input, value: 46850
Sensor 1 at /sys/class/hwmon/hwmon4/temp2_input, value: 43850
Directory: /sys/class/hwmon/hwmon2
Driver: nvme
Composite at /sys/class/hwmon/hwmon2/temp1_input, value: 45850
Sensor 1 at /sys/class/hwmon/hwmon2/temp2_input, value: 42850
Directory: /sys/class/hwmon/hwmon0
Driver: i350bb
loc1 at /sys/class/hwmon/hwmon0/temp1_input, value: 47000
Directory: /sys/class/hwmon/hwmon5
Driver: k10temp
Tccd4 at /sys/class/hwmon/hwmon5/temp6_input, value: 54500
Tccd1 at /sys/class/hwmon/hwmon5/temp3_input, value: 46750
Tccd8 at /sys/class/hwmon/hwmon5/temp10_input, value: 51500
Tccd5 at /sys/class/hwmon/hwmon5/temp7_input, value: 47750
Tccd2 at /sys/class/hwmon/hwmon5/temp4_input, value: 53250
Tccd6 at /sys/class/hwmon/hwmon5/temp8_input, value: 47250
Tctl at /sys/class/hwmon/hwmon5/temp1_input, value: 54500
Tccd3 at /sys/class/hwmon/hwmon5/temp5_input, value: 57000
Tccd7 at /sys/class/hwmon/hwmon5/temp9_input, value: 52250
Directory: /sys/class/hwmon/hwmon3
Driver: nvme
Composite at /sys/class/hwmon/hwmon3/temp1_input, value: 45850
Sensor 1 at /sys/class/hwmon/hwmon3/temp2_input, value: 43850
Directory: /sys/class/hwmon/hwmon1
Driver: nvme
Composite at /sys/class/hwmon/hwmon1/temp1_input, value: 44850
Sensor 1 at /sys/class/hwmon/hwmon1/temp2_input, value: 42850

_________________
HighWayToHell(blog)
https://blog.druggo.org/
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 882

PostPosted: Wed Oct 02, 2024 4:51 pm    Post subject: Reply with quote

Nice system druggo :)

Sensor wise it seems to follow the same structure as other AMD systems i've seen.
I'm somewhat amazed that there doesn't seem to be a way to determine which sensor belongs to which physical CPU on AMD systems. Or is there a way i'm not aware of? It could be as simple as a symlink somewhere in /sys.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum