Linux Lite Forums

Hardware - Support => Video Cards => Topic started by: m654321 on September 14, 2019, 06:53:56 AM

Title: How do I find the GPU temperature of an Intel card using command-line?
Post by: m654321 on September 14, 2019, 06:53:56 AM
I sometimes use the 'sensors' with/without the 'watch'  command in terminal to check on CPU temperatures. On the same machine, I'd like to check GPU temperatures - I can find info on this for nvidia GPUs on the web, but not Intel ones. The Dell Lattitude D630 in question (my daily driver - see signature) has an Intel card - details of its video card are contained in the following:
Code: [Select]
mike@D630:~$ sudo lshw -C display
[sudo] password for mike:
  *-display:0             
       description: VGA compatible controller
       product: Mobile GM965/GL960 Integrated Graphics Controller (primary)
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 0c
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:27 memory:f6e00000-f6efffff memory:e0000000-efffffff ioport:efe8(size=8)
  *-display:1 UNCLAIMED
       description: Display controller
       product: Mobile GM965/GL960 Integrated Graphics Controller (secondary)
       vendor: Intel Corporation
       physical id: 2.1
       bus info: pci@0000:00:02.1
       version: 0c
       width: 64 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list
       configuration: latency=0
       resources: memory:f6f00000-f6ffffff


Using command-line, how can I get the GPU temperatures?
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: Moltke on September 14, 2019, 09:51:53 AM
Quote
Using command-line, how can I get the GPU temperatures?
  You might try with
Code: [Select]
inxi -s This is what it shows here
Code: [Select]
inxi -s
Sensors:   System Temperatures: cpu: 75.5 C mobo: N/A gpu: radeon temp: 76 C
           Fan Speeds (RPM): N/A

To install just run
Code: [Select]
sudo apt-get install inxi
Hope this helps! :)
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: trinidad on September 14, 2019, 10:42:44 AM
LL comes with inxi already installed.
TC
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: m654321 on September 15, 2019, 08:59:47 AM
@Moltke
Thanks for your reply - unfortunately this doesn't seem to work for the GPU (at least for the Dell Latitude D630), see below:
Code: [Select]
mike@D630:~$ inxi -s
Sensors:   System Temperatures: cpu: 38.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
mike@D630:~$

For some reason it says mobo is not available (not detected), and of course the Intel card is integrated into the mobo, so therefore no GPU temperature reading ...

I notice the temperatures on your setup are pretty high (75-76 C); maybe more cooling needed ...
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: Moltke on September 15, 2019, 10:30:08 AM
Quote
product: Mobile GM965/GL960 Integrated Graphics Controller (primary)
Upon some reading, it seems that on machines with no dedicated GPU but integrated ones only, both cpu and gpu temps are the same. However, you could try finding temps on "/sys/class/"  from a terminal do
Code: [Select]
ls /sys/class/ you'll see something similar to this:
Code: [Select]
$ ls /sys/class/
ata_device  devcoredump     gpio         kfd            net           pwm           scsi_host    vtconsole
ata_link    devfreq         graphics     leds           nvme          rapidio_port  sound        watchdog
ata_port    dma             hidraw       mdio_bus       pci_bus       regulator     spi_master   wmi
backlight   dmi             hwmon        mem            phy           rfkill        thermal
bdi         drm             i2c-adapter  memstick_host  powercap      rtc           tpm
block       drm_dp_aux_dev  ieee80211    misc           power_supply  scsi_device   tty
bluetooth   extcon          input        mmc_host       pps           scsi_disk     vc
bsg         firmware        iommu        nd             ptp           scsi_generic  video4linux
CPU temps are usually read from /hwmon/hwmon0/temp1_input, so if I run here
Code: [Select]
cat /sys/class/hwmon/hwmon0/temp1_input I get this
Code: [Select]
67000 which is the temperature for the cpu, as for the gpu temps they can be read from /graphics/fb0/device/hwmon/hwmon2/temp1_input so running
Code: [Select]
cat /sys/class/graphics/fb0/device/hwmon/hwmon2/temp1_input shows
Code: [Select]
66000 which is about the same than the cpu reports. So you could try something like this
Code: [Select]
watch -c cat /sys/class/graphics/fb0/device/hwmon/hwmon2/temp1_input which will monitor the gpu temps every 2 secs.

Hope this helps! :)
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: trinidad on September 15, 2019, 11:35:03 AM
You can also add to Lite's conky widget with something like below, but you'll have to figure out which is the right number sensor.
${hwmon temp 2}C
Also possible with lm sensors like the syntax below for conky for CPU multiple cores
${exec sensors | grep 'Core 0' | awk '{print $3}' | cut -c2-3}C
Updates will be at conky's pace.You can also display in conky from cat like already suggested.

TC
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: Moltke on September 15, 2019, 12:28:20 PM
You can also add to Lite's conky widget with something like below, but you'll have to figure out which is the right number sensor.
${hwmon temp 2}C
Also possible with lm sensors like the syntax below for conky for CPU multiple cores
${exec sensors | grep 'Core 0' | awk '{print $3}' | cut -c2-3}C
Updates will be at conky's pace.You can also display in conky from cat like already suggested.

TC

@trinidad  I was just thinking in this. I just can't figure out how to.  BTW, this:
Code: [Select]
${exec sensors | grep 'Core 0' | awk '{print $3}' | cut -c2-3}C didn't work for me nor did
Code: [Select]
${hwmon temp 2}C conky widget only shows  "C" but no temps are shown.
EDIT:
Aha! Figured it out
Code: [Select]
${execi 60 sensors | grep temp1 | cut -c 16-19}C adding this line to my .conkyrc made the trick. Thanks to your code/line  :)
Title: Re: How do I find the GPU temperature of an Intel card using command-line?
Post by: Moltke on September 15, 2019, 12:46:25 PM
@Moltke
Thanks for your reply - unfortunately this doesn't seem to work for the GPU (at least for the Dell Latitude D630), see below:
Code: [Select]
mike@D630:~$ inxi -s
Sensors:   System Temperatures: cpu: 38.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
mike@D630:~$

For some reason it says mobo is not available (not detected), and of course the Intel card is integrated into the mobo, so therefore no GPU temperature reading ...

I notice the temperatures on your setup are pretty high (75-76 C); maybe more cooling needed ...

Yes, I have to do something about it. I used to have this "cooling fan" I placed under the laptop but it broke and I  haven't been able to buy a new one, they got pretty expensive down here.  Also, temperatures here where I live are pretty high right now, it is like hell on earth whenever I go out lol