Skip to content

Test on Threadripper 2990WX and fix SMT - #1

Open
steckdenis wants to merge 1 commit into
djselbeck:masterfrom
steckdenis:master
Open

steckdenis wants to merge 1 commit into
djselbeck:masterfrom
steckdenis:master

Conversation

@steckdenis

Copy link
Copy Markdown

On almost every Linux kernel, core i and i+1 are the two threads of a single physical core. Power consumption statistics can therefore be obtained by reading the MSRs or cores 0, 2, 4, ..., 60, 62.

This pull request makes rapl report proper power consumption on my machine. By the way, this tool is absolutely amazing! I have been looking for something like this for a year and a half!

On almost every Linux kernel, core i and i+1 are the two threads of a
single physical core. Power consumption statistics can therefore be
obtained by reading the MSRs or cores 0, 2, 4, ..., 60, 62.
@Asheboy

Asheboy commented Oct 13, 2020

Copy link
Copy Markdown

I agree with this. @djselbeck can this be merged?

@bachandi

Copy link
Copy Markdown

On a Threadripper PRO 3975WX (64 threads) with 5.11 Kernel core i and i + 32 are the two threads of a single physical core so there would be some logic needed to check which core numbering is needed instead of just changing to i*2

BTW great tool.

@c10l

c10l commented Mar 1, 2023

Copy link
Copy Markdown

On a AMD Ryzen 7 PRO 4750G with Radeon Graphics (8 cores, 16 threads), i and i + 8 are the 2 threads of the same core.

@maximilianpalm

Copy link
Copy Markdown

Could you use /proc/cpuinfo or similar to accurately determine the core configuration? This way, you can first detect whether SMT is active. If needed, you could then get the mapping of the logical to the physical cores.

On a Ryzen 9 5950X (32 threads) with Ubuntu 22.04.3 LTS (6.2.0-33-generic) and SMT enabled I get i and i + 16:

$ egrep "core id|processor" /proc/cpuinfo
processor	: 0
core id		: 0
processor	: 1
core id		: 1
[...]
processor	: 14
core id		: 14
processor	: 15
core id		: 15

processor	: 16
core id		: 0
processor	: 17
core id		: 1
[...]
processor	: 30
core id		: 14
processor	: 31
core id		: 15

(Skipped lines and added line break for readability)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants