4

I'm new to ubuntu and I'm having some trouble with reading temperatures on my system. I've tried using lm-sensors and psensors by following some guides with no luck. Ive also tried hardinfo which seems really nice and useful, when I use it to monitor my cpy temps I get the following info:

hardinfo sreenshot

Note: The pc has no problems detecting the cores or cpu usage.

When I run hardinfo from terminal I get this message as well:

hardinfo terminal

Related to the matter, but unrelated to ubuntu, the cpu temps on my computer runs really hot when I monitor it through the bios it goes from 35-45 celcius, I'm unsure if this is because the motherboard doesn't read the temperature right or if the cooler paste somehow was spread badly when I mounted my new cooler, it is a corsair 150i pro which comes with pre-applied cooler paste or lastly if the fans on it somehow doesn't spin fast enough (I'm assuming if the system cant read the cpu temperature it cant control the fan speed as necessary).

I understand if the second part is in the wrong forum but I would appreciate if I could get help for both since I think the problems are related.

Thanks in advance.

Edit: I realized the temperature monitoring worked all along, it was just that it had(to me) a strange name - "k10temp_temp1" and there is, apparently, only 1 sensor on my cpu (ryzen 2700x) which was new to me coming from windows and intel.

Mads
  • 43
  • What processor make and model? Do: grep name /proc/cpuinfo – Doug Smythies Dec 16 '18 at 00:52
  • Ryzen 2700x with asus rog strix b450-E gaming – Mads Dec 16 '18 at 00:57
  • 1
    I'm not sure, but I think turbostat (linux-tools-common package) works with AMD Ryzen. Try it. Example sudo turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgTmp,PkgWatt --interval 15. By the way a processor temperature of 45 degrees is actually pretty good. – Doug Smythies Dec 16 '18 at 01:02
  • I tried to run the command, it doesn't recognize it. Do I need to install it first? Maybe you're right I shouldn't be so worried about the temperature, it is just that it is the idle temperature and my room is like 18-20 celsius. – Mads Dec 16 '18 at 01:05
  • Yes, you probably need to install it: sudo apt install linux-tools-common (I think). – Doug Smythies Dec 16 '18 at 01:13
  • Its starting to print some stuff now. – Mads Dec 16 '18 at 01:17
  • It prints the buzy and mhz but no temperatures – Mads Dec 16 '18 at 01:18
  • I don't know if its related but the system seems a bit unstable, firefox crashes regularly, sometimes I get logged out, i can't tell whether thats because the pc restarts or just simply logs out since it "reloads" so fast - I'm using nvme. – Mads Dec 16 '18 at 01:29
  • Reading around it would seem that i might need some "kernel module" but I have no knowledge about getting that. – Mads Dec 16 '18 at 01:32
  • 1

2 Answers2

1

There are text files containing temperature data here: /sys/devices/platform/coretemp.0/hwmon/hwmon[0-9]

The [0-9] is shown as a variable. There is actually just a single digit number there, that changes from from startup to startup.

I'm running Ubuntu on a Macbook Pro 2009 9dual core processor), and have found these two files to contain my two CPU core temperatures:

cpucoretemp0 -> /sys/devices/platform/coretemp.0/hwmon/hwmon[0-9]/temp2_input

cpucoretemp1 -> /sys/devices/platform/coretemp.0/hwmon/hwmon[0-9]/temp3_input
JustinMT
  • 46
  • 4
  • When I go to that directory theres no folders/files named coretemp – Mads Dec 16 '18 at 03:37
  • Nevermind found it, it was named differently but there is no file named anything with temp or temperature – Mads Dec 16 '18 at 03:41
  • I can find /sys/devices/platform/eeepc-wmi/hwmon/hwmon1 which contains fan1_input, fan1_label, name, pwm1_enable and uevent but no temp – Mads Dec 16 '18 at 03:44
  • Go to /sys/devices/platform/ and search for "temp". The folder name is likely different for different hardware. – JustinMT Dec 16 '18 at 03:47
  • My fan data is here: /sys/devices/platform/applesmc.768/fan2_output – JustinMT Dec 16 '18 at 03:48
  • I looked around some more and found /sys/devices/platform/eeepc-wmi/hwmon/hwmon1/subsystem which contains hwmon0 and hwmon1. hwmon0 contains 2 temp files temp1_input and temp1_max, they contain some odd numbers however, like 40000 and 70000, am i supposed to divide by 1000 and thats the temperature? – Mads Dec 16 '18 at 03:48
  • Shouldn't there also be 8 files since i have eight cores? only 1 shows up – Mads Dec 16 '18 at 03:54
  • Yes, you divide by 1000. – JustinMT Dec 16 '18 at 04:12
  • You may only have two temperature sensors, even though there are eight cores. You should be able to find the number of temperature sensors by googling you CPU specs. – JustinMT Dec 16 '18 at 04:13
  • I suggest you also look in to how Linux sets your CPU clock speed. My apple has a 2.67 GHz processor, with discrete speed settings between 1.6 GHz and 3.1 GHz. Linux sets the speed to 3.1 GHz, which probably comes from the BIOS, and I'm guessing apple starts up with the higher speed for better start up time while not degrading the life of the CPU. – JustinMT Dec 16 '18 at 04:17
  • I found my computer was hot because the CPU was always running too fast, so I wrote a bash script to set the CPU speed I want (& fan speed). – JustinMT Dec 16 '18 at 04:18
  • You may be correct, it would seem that there is indeed only one sensor on my processor, so it was working all along. At the same time I found out that the temperature that I have to look for was labeled as k10temp/temp1 which confused me initially because to me (as a noob) the label didn't suggest that it was the cpu temp. It also shows much better temps now (maybe the bios doesn't use offset?) the idle temperature is more like 23-35 celcius now compared to 35-45 monitored in bios. I learn something new everyday :) – Mads Dec 16 '18 at 05:55
  • However, I still can't monitor my fan speed as it just says it runs at 0 rpm permanently :/ – Mads Dec 16 '18 at 05:58
1

I use an alias to monitor temperature:

$ temp
INT3400 Thermal  20.0°C
SEN1             52.0°C
SEN2             50.0°C
SEN3             57.0°C
SEN4             60.0°C
B0D4             50.0°C
pch_skylake      81.5°C
x86_pkg_temp     50.0°C

Note: pch_skylake is the Thunderbolt port which for some reason is always out of wack. The bottom temperature x86_pkg_temp is the temperature I use for overall system temperature. The first four SEN temperatures (SEN1 through SEN4) are the CPU core temperatures (Intel Quad Cord i7-6700HQ processor).

You can mimic my temp alias by copying and pasting this line into the terminal:

paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/'

Source: How do I get the CPU temperature?