amanusk / s-tui

Terminal-based CPU stress and monitoring utility
https://amanusk.github.io/s-tui/
GNU General Public License v2.0
4.01k stars 139 forks source link

Read AMD CPU power from MSRs #166

Closed schaerfo closed 3 years ago

schaerfo commented 3 years ago

Because of the unfortunate situation with the amd_energy driver only being available on model 31h, I have implemented reading the power draw directly from MSRs, like in https://github.com/djselbeck/rapl-read-ryzen.

The power reader is available under the following conditions:

I have tested it only on a Ryzen 7 4800HS, and would suggest it is tested on a variety of other CPUs as well. Especially, I would be interested if per-package power reporting works as expected on multi-CPU systems.

Please let me know what you think!

amanusk commented 3 years ago

Hey, Sorry for the late response to this. I think this is a great addition to have in general. There were features that relied on reading MSRs directly in s-tui before but were removed to not enforce using root. This can still be a good idea, until a solution that does not require root is introduced.

If it's not too much trouble, please shoot me an email to amanusk <at> tuta <dot> io to discuss this furter. And thanks again for the work.

amanusk commented 3 years ago

I still don't have AMD hardware to test this with, unfortunately, but it does not seem to break anything when working with Intel. I'm going to merge this to master and we can hopefully get feedback on from AMD users. Now that Intel requires root to get power anyway, seems like this is a good fit