Conky not displaying cpu frequency

I recently installed FreeBSD 11.1 in a vm to try to learn my way around. As I was tweaking conky to my liking, I noticed the CPU frequency was reading 0 MHZ for all four cores. I run conky in a couple other vm's as well as the host Debian system and have never had this issue.

I've searched for similar issues here on the forum as well as the web but can't find any insight. The only thing I can think of is that there's a pkg I need to install so that conky can read the info but I haven't been able to identify one.

Here's the pertinent section of .conkyrc

Code:
${color grey}Processors
CPU1: ${cpu cpu1}% $alignr ${freq_g 1} Ghz $alignr${cpubar cpu1 8,60}
CPU2: ${cpu cpu2}% $alignr ${freq_g 2} Ghz $alignr${cpubar cpu2 8,60}
CPU3: ${cpu cpu3}% $alignr ${freq_g 3} Ghz $alignr${cpubar cpu3 8,60}
CPU4: ${cpu cpu4}% $alignr ${freq_g 4} Ghz $alignr${cpubar cpu4 8,60}

Thanks for any suggestions.
 
I recently installed FreeBSD 11.1 in a vm to try to learn my way around. As I was tweaking conky to my liking...
Firstly, why do you need conky in a vm? :) It is not your desktop.

There can be a lot of reasons, why it is not displayed properly,
for example, your virtual machine is not displaying frequency correctly,
or something like that.

Try it on your real hardware, to be sure that conky works fine :)

P.S: Tried to display CPU frequency using conky, and it seems it is really not showing it (shows zero).
Try cpufreq(4) kernel module, after it's loaded, it should show current CPU frequency
using % sysctl dev.cpu.0.freq or % sysctl dev.cpu.1.freq etc. So load it,
using # kldload cpufreq and then try to add
Code:
${execi 5 sysctl dev.cpu.0.freq}
to ~/.conkyrc
 
Last edited by a moderator:
I try to set up a vm as close to my actual desktop as possible. I might do all my computing for a week on any one of the machines to learn the os better. I have three vm's on this host (FreeBSD, Slackware, and LMDE) , all running conky and only FreeBSD has the cpu frequency not displaying issue. The code I posted is the same on the other 2 vm's and the host (except the host is expanded out to 8 cores). I'll take a look at cpufreq(4)() to see if that will work, but it seems that there should be an easier way.


Edited to add...

I tried your suggestions with the following results.

Code:
root@FreeBSD-vm:/home/bryan # kldload cpufreq
kldload: can't load cpufreq: module already loaded or in kernel

Code:
$ sysctl dev.cpu.1.freq
sysctl: unknown oid 'dev.cpu.1.freq'
 
Perhaps that requires some extra configuration? Besides having a quad-core CPU with HT, the output of sysctl on my system (11.1 on real hardware) only shows dev.cpu.0.freq, but doesn't include that item for the other cores. There are entries for dev.cpu.1 to dev.cpu.7, but only dev.cpu.0 features freq and freq_levels for me.
 
Perhaps it is broken?
Because after trying to load it even manually (it should be included in kernel)
no dev.cpu.*.freq sysctl appears for me too (FreeBSD 11.1-REALESE),
first I thought that may be I got something misconfigured, when I was writing
previous post. But, it seems, it is not the reason why it is not working, I got the
same results as bryanmc.
 
Back
Top