-
Notifications
You must be signed in to change notification settings - Fork 521
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
Sensors@claudiux: Add cpu power consumption tab #6518
Comments
@fzamperin |
I was doing some research but so far didn't find a way to fetch it :/ |
@claudiux After doing an extensive search it's not possible to catch the value without sudo privilege. Can we work this around? I don't know exactly the architecture and environment about applets on cinnamon but I'm willing to help with the implementation. Other tools like Turbostat only work with root privilegies also. |
All the solutions I envisage would create a safety problem. I prefer not to implement them. I'll keep thinking about it. |
UPDATE I was able to make this work without sudo, it uses this tool: https://github.com/intel/pcm I ran a docker container using the pcm tool from intel and was able to fetch the values, so I created this dummy code just to test: const { Message, Session } = imports.gi.Soup;
const session = new Session();
session.timeout = 2;
const url = 'http://localhost:9738/persecond/1';
function fetchCPUInformation() {
const message = Message.new('GET', url);
message.request_headers.append('Accept', 'application/json');
const result = session.send_and_read(message, null);
const data = result.get_data();
const responseString = new TextDecoder('utf-8').decode(data);
return JSON.parse(responseString);
}
function addWattageToTooltip(tooltips) {
const result = fetchCPUInformation();
let joules = result['Uncore Aggregate']['Uncore Counters']['Package Joules Consumed'];
tooltips.push(`${joules} W`);
}
module.exports = {
addWattageToTooltip
} Then added it on the applets.js to see if it works, I'm just not quite sure if this works on other cpus like AMD or ARM |
@fzamperin +1! Please create a PR including changes in .js scripts and in |
@claudiux After a quick research, I saw that only Intel cpus are supported using the PCM tool, do you want me to create a PR only for Intel? And then we can see how to support AMD or ARM? Let me know your thoughts. |
@fzamperin Yes, but please only display these options when PCM tools are available and usable. |
Applet name and maintainer
Sensors@claudiux @claudiux
What would you like to see?
@claudiux Thanks for this amazing Applet! Being using it for years!
I have a suggestion for a new Feature, I want to measure my CPU power consumption, I have a 13700K and I see that I can get the power consumption in Joules from:
/sys/class/powercap/intel-rapl/*/energy_uj
. At first I tried to tweak intolm_sensors
to see if I can grab this value to make the Applet display it fromsensors
but it didn't work. Do you think we can work to make this happen? As of right now I just know about Raptor Lake consumption but I think other processors output the power different way.Let me know if you find that this is interesting somehow. Thanks!
The text was updated successfully, but these errors were encountered: