Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Threadripper 2990WX and fix SMT #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

steckdenis
Copy link

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
Copy link

Asheboy commented Oct 13, 2020

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

@bachandi
Copy link

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
Copy link

c10l commented Mar 1, 2023

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

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.

None yet

5 participants