How I Got Conky to Show My AMDGPU Temps and AMD CPU Temps

I simply wanted Conky to give me the temps and GPU % usage.
I could not find this information anywhere.

Upon digging deeply, I found that sensors could get me the temps and radeontop could get me the usage data for the GPU. Fortunately, I already had radeontop as I was using that for some checks here and there when I was running different benchmarks.

To get conky to show the GPU load, I used the following:

${execi 5 radeontop -d- -l1 | grep -o ‘gpu [0-9]{1,3}’ | cut -c 5-7 }%

To get the sensors data, I first ran the command sensors.
This gave me the following info:

amdgpu-pci-0c00
Adapter: PCI adapter
vddgfx: +0.95 V
fan1: 1662 RPM (min = 400 RPM, max = 3300 RPM)
temp1: +50.0°C (crit = +91.0°C, hyst = -273.1°C)
power1: 18.00 W (cap = 180.00 W)

k10temp-pci-00c3
Adapter: PCI adapter
Tdie: +46.9°C (high = +70.0°C)
Tctl: +46.9°C

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

So now it’s a simple matter of grepping the results.
Here is the line I used for GPU temps:

${execi 60 sensors | grep temp1 | cut -c 16-19}°C

Here is the line I used for CPU temps:

${color6}${execi 60 sensors | grep Tdie: | cut -c 16-19}°C

Anyways, this seems to get me in the ballpark.
If there is a better way, or if you have suggestions, feel free to toss them here!
Hope this helps your conky enjoyment.

5 Likes

I doesn’t use conky, but at some point I tired to get the same done as you trying, for learning purpose.

This is what I did …

Core1  ${cpu cpu1}%
Core2  ${cpu cpu2}%
Core3  ${cpu cpu3}%

After that I used a bash script including the temps via sensors.
This was the script …

#!/bin/bash
CPU_usage="$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]%"
CPU_temp=$(sensors -u | grep "temp2_input" | cut -d" " -f4 | cut -d"." -f1)
printf "CPU: %-3s %3d°C\n" "$CPU_usage" "$CPU_temp"
exit 0

My output of sensors -u is quite long , so I will give you the short version …

sensors -u 
...
temp2:
  temp2_input: 30.000
  temp2_max: 87.000
  temp2_min: -108.000
  temp2_alarm: 0.000
  temp2_type: 4.000
  temp2_offset: 0.000

You have to narrow down the temps you like to show and run
grep "temp2_input" | cut -d" " -f4 | cut -d"." -f1
against it.
You can put it after execi 1 in your conkyrc file.

To get sensors running with all available sensors you need to run sensors-detect once.

Hope this will help.

Addition …
Here you have some good bookmarks about conky.


http://conky.sourceforge.net/config_settings.html
http://conky.sourceforge.net/variables.html
https://wiki.ubuntuusers.de/Conky/ (german)

1 Like

cool info! thanks!

Conky? LOL! Was this software you are using named after him?