You are not logged in.

#1 2026-04-27 18:52:09

ghorvath
Member
Registered: 2015-10-01
Posts: 166

Conky hwmon 32-bit overflow?

Hi Team!

Using Bunsenlabs Carbon on my shiny new Framework laptop 13, and I love it, like I did all previous versions. I thought I create a nice conky for the amdgpu. This checks the frequency, the original number in sysfs is in Hz, so need to divide by 10^9 to get it in GHz:

${hwmon amdgpu freq 1 0,000000001 0,00}

However, when on full speed, the frequency reaches almost 3 GHz, which in Hz is more than 2^31 Hz, and then conky actually produces a negative number. :-( I am assuming 32 bit overflow here, but I don' actually know.

I could write a shell script cat-ing the corresponding sysfs file, and with bc dividing by 10^9, but I would prefer to avoid that, because I believe conky uses less resources.

Is this some known limitation that I could not find?
Does anyone have any suggestions on how this can be worked around within conky itself?

Offline

#2 Yesterday 08:17:38

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,951

Re: Conky hwmon 32-bit overflow?

^conky has the conversion built into its variables:

freq

for Mhz and

freq_g

for Ghz installed or build-in.
It counts from 1

1 CPU1      ${cpu cpu1}%  ${alignr}${freq 1} MHz
2 CPU2      ${cpu cpu2}%  ${alignr}${freq 2} MHz
3 CPU3      ${cpu cpu3}%  ${alignr}${freq 3} MHz
4 CPU4      ${cpu cpu4}%  ${alignr}${freq 4} MHz
===============================================
1 CPU1      ${cpu cpu1}%  ${alignr}${freq_g 1} GHz
2 CPU2      ${cpu cpu2}%  ${alignr}${freq_g 2} GHz
3 CPU3      ${cpu cpu3}%  ${alignr}${freq_g 3} GHz
4 CPU4      ${cpu cpu4}%  ${alignr}${freq_g 4} GHz

Bildschirmfoto-2026-04-28-10-04-03.png

Offline

#3 Yesterday 19:48:33

ghorvath
Member
Registered: 2015-10-01
Posts: 166

Re: Conky hwmon 32-bit overflow?

Hi @unklar!
Thanks for the suggestion. Though, I thought that freq and freq_g only works with the CPU cores. Would it also be able to query the GPU frequency?

${freq_g amdgpu}

seems to query frequency for CPU core 1.

Offline

#4 Today 12:59:12

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,951

Re: Conky hwmon 32-bit overflow?

What is the command output of

for m in /sys/class/hwmon/* ; do echo -n "$m = " ; cat $m/name ; done

and

sensors

?

Last edited by unklar (Today 12:59:39)

Offline

Board footer

Powered by FluxBB