how to read CPU temp from /sys, what to think of it
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i compiled in powersave governor and every last intel support i could find so that would work (acpi, apm, pch, ich, i2c, blah - intel supports). my cpus were running at ~ 74 deg F but /proc/cpuinfo sayd "3.2 GHz" freq. (likely wrong)
temp?_crit says 100 deg C crit, 84 C max: but intel says the max is 80 deg C TJmax. 100 C is 212 deg F, 80C is 176 deg). but /sys/modules/coretemp/parameters/tjmax says 0 (ex, not 80000). it's possible 84C is stored in chip as TJmax, but i doubt 100C is. but i really don't know.
i loaded acpi-cpufreq and now see 800 MHz in /proc/cpuinfo. the 800 thing i found acpi-cpufreq is my "scaling_driver" and i can set governor in /sys/devices/system/cpu/cpufreq/policy?/
i've been compiling kernels. temp appears to change 2 C change only in 2 processors only, but in 'performace mode' see a 25C to 36C (9 C change) using.
my processor is "locked", however i have no idea if that doesn't mean i can't destroy it if i try hard ?
I'm hoping someone knows what i'm doing wrong / how to read the temps "correctly" from /sys
---------------------
i have a locked processor i'd be surprised if i found out it "isn't really locked". comment on that if you know any way i could destroy this cpu please.
(forget saying yast/aptget cpufreq doesn't cut it here - i want to verify the value not rely that some software version doesn't know lk-4.16.x changes right? temp isn't something i want to leave as maybe broken)
i can guess if TCC 80C (when cpu ajusts it's own freq. so it doesn't go over - if not disabled - which i'm unsure of) then linux might say 84C is a "max" (or warning level, failure) (or maybe this chip does 84C when produced). but then i can't guess what 100C is.
the i5 has auto frequency scaling internally, why doesn't /proc/cpuinfo show change unless acpi-cpufreq has "taken over governing" over the cpu afs?
should recompile kernel without the linux governor assuming i5's internal gov will enact itself and be better*?
what remains un-explained is how temp?_crit can say 100C is "limit" while intel and other sources don't mention 212 deg F anywhere
* (if i do there's no way to know what freq is, i won't know if it's "on" or "off", as cpufreq won't compile unless one of it's governors is selected)
Last edited by X-LFS-2010; 06-08-2018 at 09:31 PM.
Typical temperatures for CPUs are
Operating ~75C
Critical (by which stage effects on behaviour are usually noticeable) ~120C
TJmax 150 - 200C
These may vary especially with ultra small new tab size. But heat is generated in the core, cooling is external, and sensors in between. So if you have a TJmax of 100C it may be what the sensor is going to report
I wouldn't bother reading specs, but keep the operating temperature in double figures. What you read as TJmax could also be critical temperature.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
The programs you use to output temp are reading it from /sys. So, they really 'do' know. You don't know how to read the sys values. Many times the value in sys is the arithmetic difference between the current condition and the maximum permissible. So, you need to read the module documentation in order to know what you're doing directly reading the sys file system.
I would just install lm-sensors. Run sensors-detect, and then run sensors. It will do all the translations for you, and output just what you want.
yes, the Intel documentation does say TJmax is the package temperature (reported by sensors) not internal temperature of the cpu.
and that there are two temps: the case temp and cpu "package" temp
I later booted windows 10 and saw see a 25C to 36C (9 C change) is what the desktop (no software running but the monitor), is pushing.
I'm still not %100 on upper limits but I feel better about 36C not being a problem
the other problem is if Linux-4.16.12 /sys is telling me "target temperatures" or real measurements or estimates
WHY? well Intel docs say the 6500u cannot do separate frequency per processor. and Linux-2.3.x (I bothered to make one) … it's cpufreq says all cpu freq change to the same freq (they fluctuate together - all 4)
that leaves a question for Linux-4.16.12: is it truthful about cpufreq being different on each processor (perhaps newer kernel code does what Intel doc says can't be done?) or is it giving … partially bogus info?
I disagree totally that a Linux hacker should not trust kernel variables in /sys. if a module exports fake variables than it shouldn't even be an experimental option in the kernel. but cpufreq isn't one of those I assume
Last edited by X-LFS-2010; 06-14-2018 at 04:28 AM.
I am surprised to find no 'critical' temperature, as acpi uses that for shutting down due to overheating. Thermally runaway is possible as you approach TJMax. I am also surprised to see TJmax specified at what I would expect to be TJ critical. Where does acpi shut down?
Video transcoding on my 4 core, 3.8GHz PC desktop tries to run many threads until some internal heat sensor pulls the plug.
Perhaps a laptop would be different?
So I run a script to vary the frequency, depending on the temperature.
Frequencies can be found in
CPU temperature (on my machine) can be found in /sys/class/hwmon/hwmon1/temp1_input
It would be nice if I could tell the kernel to run my CPU at some moderate temperature, since excessive temperature is going to reduce the life of an expensive component.
Currently, I don't let my CPU exceed 65 degrees.
^ funny, I just spent an intense week transcoding most of my videos to smaller chunks, running all 4 threads on 99% for hours and hours, for days and days.
Conky shows CPU temperature, usage and frequency.
When it gets too hot the frequency scales down.
This is an MSI mobo with an Intel CPU (i3-6100 iirc).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.