6
$\begingroup$

On Linux systems, the sensors command shows information about your system's temperature:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +64.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:        +58.0°C  (high = +80.0°C, crit = +100.0°C)
Core 1:        +63.0°C  (high = +80.0°C, crit = +100.0°C)
Core 2:        +64.0°C  (high = +80.0°C, crit = +100.0°C)
Core 3:        +58.0°C  (high = +80.0°C, crit = +100.0°C)

acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +105.0°C)
temp2:        +29.8°C  (crit = +105.0°C)

nouveau-pci-0100
Adapter: PCI adapter
GPU core:     +0.90 V  (min =  +0.85 V, max =  +1.00 V)
temp1:        +42.0°C  (high = +95.0°C, hyst =  +3.0°C)
                       (crit = +105.0°C, hyst =  +5.0°C)
                       (emerg = +135.0°C, hyst =  +5.0°C)

asus-isa-0000
Adapter: ISA adapter
cpu_fan:        0 RPM

Are there well-known Mathematica paclets or techniques that one can use to track system temperature in real-time (especially CPU/core temperatures)?

$\endgroup$
  • 1
    $\begingroup$ Mathematica does not provide this functionality built in. You'd likely have to hook up to some third party tool. $\endgroup$ – ktm Mar 31 at 20:02
5
$\begingroup$

Install the sensors command by using sudo apt-get install lm-sensors

Given the output on my system, a little string manipulation gives the temperature of each of the six cores.

temp[]:=
   Block[{s,p},
      s=RunProcess["sensors","StandardOutput"];
      p=Drop[StringPosition[s,":"],2][[All,1]];
      Map[ToExpression[StringTake[s,{#+11,#+14}]]&,p]
]

Now run within Dynamic

Dynamic[
   ListLinePlot[temp[],
      InterpolationOrder->0,Filling->Axis,
      PlotRange->{{1,6},{15,30}},
      Frame->True,FrameLabel->{"Core Number","Temperature  C"}]
]

dynamic temperatures

| improve this answer | |
$\endgroup$
  • 2
    $\begingroup$ Your answer is great. I want to know how to get CPU temperature information under the Windows system. $\endgroup$ – Montevideo Apr 1 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.