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

Does not work on the M2 #14

Open
JJ opened this issue Mar 12, 2024 · 4 comments
Open

Does not work on the M2 #14

JJ opened this issue Mar 12, 2024 · 4 comments

Comments

@JJ
Copy link

JJ commented Mar 12, 2024

| M2 | t8112 | Should work? |

The answer is regretfully no, it exits with a 133 code.

@sammcj
Copy link

sammcj commented Apr 11, 2024

Confirming the same for me on M2 Max

sudo socpwrbud
zsh: trace trap  sudo socpwrbud

@dehydratedpotato
Copy link
Owner

@JJ @sammcj finally got to it. Don't have an M2 machine to test but tried to fix some stuff up to make more portable in latest commit. Maybe it'll work now?

@sammcj
Copy link

sammcj commented May 15, 2024

Great, thanks!

It builds in Xcode:

Profiling Apple M2 Max (T6021)...

0-Core PCPU
    Average frequency: 2152 mhz
    Average voltage:   916 mv
    Active residency:  100.00 %
    Idle residency:    0.00 %

    DVFS distribution:
        948 MHz (790 mv): 3.39%
        1452 MHz (806 mv): 25.91%
        1704 MHz (834 mv): 17.09%
        1968 MHz (859 mv): 21.73%
        2208 MHz (896 mv): 0.79%
        2400 MHz (915 mv): 0.69%
        2568 MHz (934 mv): 2.36%
        2724 MHz (981 mv): 0.31%
        2868 MHz (1015 mv): 8.27%
        3132 MHz (1093 mv): 0.38%
        3264 MHz (1146 mv): 0.64%
        3360 MHz (1146 mv): 1.16%
        3408 MHz (1146 mv): 0.68%
        3504 MHz (1146 mv): 3.66%
        3528 MHz (1196 mv): 10.18%
        3696 MHz (1196 mv): 2.76%

Integrated Graphics
    Average frequency: 444 mhz
    Average voltage:   621 mv
    Active residency:  8.71 %
    Idle residency:    91.29 %

    DVFS distribution:
        444 MHz (621 mv): 100.00%

0-Core ECPU
    Average frequency: 1737 mhz
    Average voltage:   691 mv
    Active residency:  100.00 %
    Idle residency:    0.00 %

    DVFS distribution:
        1284 MHz (625 mv): 42.79%
        1752 MHz (678 mv): 16.91%
        2004 MHz (706 mv): 16.54%
        2256 MHz (778 mv): 9.59%
        2424 MHz (831 mv): 14.17%

0-Core PCPU1
    Average frequency: 0 mhz
    Average voltage:   0 mv
    Active residency:  0.00 %
    Idle residency:    0.00 %

    DVFS distribution:
        none

Just note that the make seems broken though:

socpowerbud/socpwrbud [2] $ make                                                                                     (mainU)
clang -fobjc-arc -funroll-loops -Ofast -arch arm64 -mmacosx-version-min=11.0 -o socpwrbud socpwrbud.m -lIOReport -framework Foundation -framework IOKit
socpwrbud.m:127:48: error: initializer element is not a compile-time constant
  127 | static const NSArray* performanceCounterKeys = @[ @"ECPU", @"PCPU", /* pleb chips (M1, M2, M3, M3 Pro) */
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128 |                                                   @"ECPU0", @"PCPU0", @"PCPU1", /* Max Chips */
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129 |                                                   @"EACC_CPU", @"PACC0_CPU", @"PACC1_CPU" /* Ultra Chips */];
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
socpwrbud.m:186:40: warning: 'kIOMainPortDefault' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
  186 |     if (!(IOServiceGetMatchingServices(kIOMainPortDefault, service, &iter) == kIOReturnSuccess)) return nil;
      |                                        ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:112:19: note: 'kIOMainPortDefault' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
  112 | const mach_port_t kIOMainPortDefault
      |                   ^
socpwrbud.m:186:40: note: enclose 'kIOMainPortDefault' in an @available check to silence this warning
  186 |     if (!(IOServiceGetMatchingServices(kIOMainPortDefault, service, &iter) == kIOReturnSuccess)) return nil;
      |                                        ^~~~~~~~~~~~~~~~~~
socpwrbud.m:242:40: warning: 'kIOMainPortDefault' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]
  242 |     if (!(IOServiceGetMatchingServices(kIOMainPortDefault, service, &iter) == kIOReturnSuccess)) return;
      |                                        ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:112:19: note: 'kIOMainPortDefault' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
  112 | const mach_port_t kIOMainPortDefault
      |                   ^
socpwrbud.m:242:40: note: enclose 'kIOMainPortDefault' in an @available check to silence this warning
  242 |     if (!(IOServiceGetMatchingServices(kIOMainPortDefault, service, &iter) == kIOReturnSuccess)) return;
      |                                        ^~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
make: *** [socpwrbud] Error 1

@dehydratedpotato
Copy link
Owner

@sammcj sweet! for the make file ill just have to set the target to macosx 12.

But one thing does make me nervous about your output, are no core metrics working for the CPUs?

also, that out of order-ness of the gpu being under pcpu but above ecpu...its hurting my eyes lol

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

No branches or pull requests

3 participants