-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Handle Macs' CPUs better #12
Comments
Turns out neither me nor PhD have a Mac so, if someone wants to contribute in some way – the comments on this issue and PRs are always open |
I have a MacBook Pro so I can help with diagnosing and fixing this. |
According to this source. All that has to be called is |
So there's no way to do it without spawning another process? Sucks, but workable. OTOH, I can't seem to find the clock freq in the screenshot in the blog post? |
Sadly yes, another process will have to be spawned but, clock freq is reported using: Since all that would be needed is the clock, EDIT |
Since For now, could you check with the |
Absolutely, I'll give it a shot. I'll let you know in a little bit. |
Oh, and, @CGMX, if you'd be so kind, do |
Unsure, I'll take a look however. |
Okay:
|
Thanks, I hate it! |
…and type The only thing that's left is the quantities Ref: #12
Doesn't check package count because sysctl doesn't provide it :v Ref: #12
Alright! This (mostly) covers all funxions that relied on |
Hey sorry, I'll get testing this. Had a crazy weekend and couldn't get to it. |
Here's the output from CPU example:
|
I can tell you right off the bat it's identifying my core quantities wrong. |
Thanks! Hmm, weird... What does |
Interesting, so So this is actually correct:
|
Only explanation I have for this is that "logical per package" is taking into account the total amount of physical & logical cores/threads |
…chdep.cpu.cores_per_package and machdep.cpu.logical_per_package Ref: #12 Ref: #12 (comment)
Oh, thanks, musta missed those keys when looking through the logs! If the latest commits on |
Oh you're way good! macOS doesn't make it easy like any other Linux distro sadly. I'll run another test and then let you know |
Just pulled latest changes from
|
Also per your comment here, there will always be 1 package as no Mac systems have more than one package (>1 CPU) Edit |
wait what theh ell I changed it to use |
It's all good. We'll figure this out...
Remember with Intel HyperThreading whatever physical count of CPUs (in terms of physical cores) you have, effectively double as HyperThreading creates logical CPUs based off your physical ones: So after thinking about this more, that printout from infoware is correct it just isn't showing "physical" core package, it's showing total core package (which takes into account HyperThreading). I might be wrong but this seems to be what it's doing. |
I'm going to do a little more digging into Intel's SMT methodology and see if this is actually the case. |
1 similar comment
I'm going to do a little more digging into Intel's SMT methodology and see if this is actually the case. |
Works for me. iMac 17,1 with Intel i5 6600:
|
Well |
…and type The only thing that's left is the quantities Ref: #12
Doesn't check package count because sysctl doesn't provide it :v Ref: #12
…chdep.cpu.cores_per_package and machdep.cpu.logical_per_package Ref: #12 Ref: #12 (comment)
Changes landed in |
#11 happened because the Mac the author was using didn't have
/proc/cpuinfo
– there should probably be either (a) an alt name for/proc/cpuinfo
or (b) some other way of getting that data out of Macs.The text was updated successfully, but these errors were encountered: