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

[BUG] CPU temperature not being detected #9

Closed
hecto600 opened this issue Oct 15, 2024 · 10 comments · Fixed by #10
Closed

[BUG] CPU temperature not being detected #9

hecto600 opened this issue Oct 15, 2024 · 10 comments · Fixed by #10

Comments

@hecto600
Copy link

the command gopsuinfo -i t not showing cpu temperature. See attachment below with lmsensors comparison:
swappy-20241015_102715

Ps:
I'm using intel processor i7-4790k and archlinux up to date

@nwg-piotr
Copy link
Owner

I see 27 degrees in the output.

@hecto600
Copy link
Author

Sorry for not clarifying. It shows 27, but for sure it isn't the actual cpu temperature. It doesn't change even if I open games which normally gets 60-80 degrees when used with lm_sensors sensors, kde or waybar. When the system is idling I have seen the CPU get as low as 45 degrees, but never 27. Somehow the temp showing in gopsuinfo -i t is similar with sensors category ACPI (I don't know what it is or what is capturing but it is always 27 degrees, regardless of the stress the CPU is under)

@nwg-piotr
Copy link
Owner

Well, the code returns what it finds as coretemp when acpitz not found or equal zero.

if v, ok := vals["acpitz"]; ok {
. This could be inverted, of course, but I wonder if it's going to spoil the temperature indication on other processors.

@hecto600
Copy link
Author

It is working now, thanks :). It seems though it only captures cpu core 0 temp:
swappy-20241017_110226

If it isn't too much trouble could it be the average cpu temperature?

@nwg-piotr
Copy link
Owner

It should take the coretemp_packageid0_input first, if it exists. Wish I had the coretemp sensor in my machine... OK, I'll try to only check the coretemp_packageid0_input value in main loop, and calculate an average cores temp value outside the loop, if it fails.

@hecto600
Copy link
Author

Can I help you testing somehow? I don't understand much about the process but I could run your script and give the results

@nwg-piotr
Copy link
Owner

Sure. I'll be able to get back to my desk later tonight. I'll let you know how to test it in a simple way.

@nwg-piotr
Copy link
Owner

OK, you can test it by building & running from the coretemp-all branch. You need to install git and go packages first.

git clone https://github.com/nwg-piotr/gopsuinfo.git -b coretemp-all
cd gopsuinfo
go run . -i t

This may take some time at first run.

@hecto600
Copy link
Author

It seems to be working as expected now, here are some results:
swappy-2024-10-18_035939

@nwg-piotr
Copy link
Owner

nwg-piotr commented Oct 18, 2024

Same here (I'm at the office, on Intel CPU). Last night I tested on an old, 2-core i3 in my ancient testing laptop. I think I could release already.

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

Successfully merging a pull request may close this issue.

2 participants