s4y / syspower

Get real-time Mac power consumption.
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Test on Apple Silicon Macs #1

Open s4y opened 3 years ago

s4y commented 3 years ago

It’s unknown whether this works (or can be made to work) on newer Macs.

luiscruz commented 3 years ago

I was looking into this and I'm afraid it will not work. The SMC is specific to Intel-based Macs. The good news is that, probably, the new Macs will have something quite similar. I'm hoping that the same approach with a few adjustments will work.

s4y commented 2 years ago

Update: this does work on new M1-based Macs. The only sensor that appears from the currently-supported set is PSTR (total power), but it looks like the SMC interface is the same and there are a number of new sensors which I have to go through.

s4y commented 2 years ago

I've noticed that it only works when I build it for x86, though. If I build a native version no sensors are detected. I'm not sure what's going on yet, open to ideas.

luiscruz commented 2 years ago

This is wonderful news! I’m afraid I can’t really help because I don’t have access to an m1-based Mac but I’m really looking forward to seeing it working

maufadel commented 1 year ago

Hi! I'm looking into measuring energy consumption in ARM-based devices and I saw this tool so I was curious. Could you please let me know if this is indeed working on Apple Silicon? If you need testing, I am willing to help out :)

luiscruz commented 1 year ago

Hi @maufadel I don't think it's working as is, but @s4y might have more details.

I think nowadays there are some solutions out there. For example, the Mx Power Gadget is a port of the Intel Power Gadget. I'm compiling a list of tools here: https://luiscruz.github.io/2021/07/20/measuring-energy.html If you come across any interesting profiling tool for M1 please let me know.

maufadel commented 1 year ago

Hi @luiscruz, thank you for your reply, and sorry for replying so late! I have seen your article and I've found it very useful. I hadn't read about the Mx Power Gadget tool though; I will test it because it seems interesting. I have recently started my PhD and the idea for my thesis is to monitor and improve the energy consumption of software solutions in Cloud and Edge. For now, I'm focusing on finding an approach that allows monitoring the consumption of applications in multi-platform scenarios, e.g., we might have an application that has multiple components that are deployed on Edge and Cloud, so to monitor the energy usage we need to get energy metrics from Raspberry Pis, Edge nodes, and AWS. Would you happen to know of any tool that would allow me to do this? Thank you once again!