wcpufreq not working??? Cannot change cpufreq or governor

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

wcpufreq not working??? Cannot change cpufreq or governor

Post by lizardidi »

My system info:
Hardware= Raspberry Pi Zero v1.3
OS= Raspup 8.2.1 (running in Pupmode 13)
Memory= 8gb micro sd card

Problem:
After i set up my raspup, the default governor is "powersafe" and the cpufreq is 700 mhz. I remember under Raspbian i can run my pizero under 1000mhz.
In terminal, i opened "wcpufreq", and clicked "Next". However, the cpufreq & governor option dialog never pop up. So i am stucked with 700mhz with powersafe as cpu governor, which is rather slow for pi zero.

This is the options that never appear (screenshot from dpup stretch) :
Image


The error code in terminal:
"/usr/sbin/wcpufreq: line 131: dmidecode: command not found"
"/usr/sbin/wcpufreq: line 132: [: -lt: unary operator expected"

Is there other methods i can try to change cpufreq and governor?

Many thanks in advance. =)
williams2
Posts: 1028
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 293 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by williams2 »

In a text terminal console:

Code: Select all

# cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors
ondemand performance
# echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
# echo ondemand > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
# echo ondemand > /sys/devices/system/cpu/cpufreq/policy2/scaling_governor
# echo ondemand > /sys/devices/system/cpu/cpufreq/policy3/scaling_governor
# cat /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
95
# echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
You can put the echo commands in /etc/rc.d/rc.local to make them execute on every boot.

This should work with most Pups, not sure about Raspup.

The up_threshold switches to high speed when that cpu core is using the percentage in up_threshold or more.
If up_threshold is 95, it won't switch to high speed until the cpu core is using 95% capacity.

Misconfiguring the scaling governor can cause overheating.
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by lizardidi »

thanks williams2 for the tip. This issue probably due to the bug in raspup wcpufreq or problem with my savefile.

i chose the governor 'performance' via
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
then, i put this script in the startup folder so it run every boot. since pizero only 1 cpu core. When run at 1000mhz, the pizero with raspup obviously more responsive, the pkg-cli also load n download packages much faster.

The cpu temperature is 51c max. Is my setting ok? Or i must use ondemand like you suggest?
williams2
Posts: 1028
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 293 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by williams2 »

You can tweak the settings how you like.

The main options are the governor and if you choose ondemand, you can tweak the up_threshold

I have a choice of ondemand and performance.
Performance is good for a desktop, I am running a laptop at the moment.
It normally runs about 54C to about 68C

If I set it to run always at 700Mhz, it definitely runs a few degrees cooler,
and runs quite well, for the most part.

ondemand might run cooler, and use less power so the battery would last longer, and the charger/power supply would use a little less power and run a little cooler too.

The main difference between ondemand and performance is that when the machine is not working hard, and it often is not working hard, the cpu will be running at a slower speed and with a lower voltage, and run cooler and use less power.

You probably wouldn't notice much difference between performance and ondemand, in functionality.
It would probably seem to run at about the same speed.
It might run a little cooler using ondemand.

You seem to be missing the executable file /usr/sbin/dmidecode
I don't know why, maybe it is missing from the OS, maybe it got deleted.
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by lizardidi »

:thumbup2:

thanks you so much william!
User avatar
mikewalsh
Moderator
Posts: 5698
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 616 times
Been thanked: 1759 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by mikewalsh »

I would think, rather, that it's got summat to do wi' the fact that a Raspberry Pi uses an ARM processor.....RISC operation, completely different way of doing things, y'know?

Usually, frequency scaling is more about getting the things to run cooler where possible, as much of the time as you can. With x86 operation, this is necessary.....the little buggers CAN generate an awful lot of localised heat, depending on predicted TDP, etc. A RISC processor, on the other hand, operates at far lower voltages to begin with; I mean, never forget that a lot of these things are designed and built to generate, what......perhaps 2-3W of heat, total? With the expected usage 'envelope' being, usually, a smartphone or tablet, with next to nowhere to put a heatsink anyway.....

So I can't say I'm surprised to hear there's a lack of built-in provision for such a thing as frequency scaling in the first place.

(*shrug*)

Any idea, out of pure curiosity, exactly what CPU/system-on-a-chip you're running in there?


Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

williams2
Posts: 1028
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 293 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by williams2 »

The dmidecode executable file returns information about the bios.
In this case, it is checking the year that the bios was built.
If the bios is older than 2007, it prints a message saying cpu scaling might not work.
That is all that that line does.

I don't know why the dmidecode file is not there.
Maybe it was accidentally left out.

If you changed this:

Code: Select all

BIOS_DATE="`dmidecode -s "bios-release-date"`"
to this:

Code: Select all

BIOS_DATE=2008
then wcpufreq should work.
Or install or reinstall dmidecode.

cpu freq scaling just runs the cpu at a slower clock speed.
The faster the clock speed, the hotter the cpu chip runs.
And the voltage to the cpu can be reduced.

Reading and writing to /sys/ is talking directly to the kernel,
or at least, to the kernel modules that connect to and control the hardware.
If the cpufreq items are there in /sys/ then a kernel module intended to control the speed of the cpu clock must have loaded, though it doesn't guarantee that the module is actually working properly.

You can ask the kernel for information about the cpu like this:

Code: Select all

# cat /proc/cpuinfo
That's what wcpufreq does.
User avatar
lizardidi
Posts: 72
Joined: Sat Jul 18, 2020 9:42 am
Has thanked: 20 times
Been thanked: 12 times

Re: wcpufreq not working??? Cannot change cpufreq or governor

Post by lizardidi »

Any idea, out of pure curiosity, exactly what CPU/system-on-a-chip you're running in there?
Hi mike,
i just running the raspberry pi zero as a travel-to-go ultra portable pc together with a powerbank, a phone, and a wireless keyboard. Sometimes i hooked up a tv monitor for bigger display. (too lazy to bring my bulky 12 yrs old laptop)

overall, the wcpufreq on raspup is not a big issue as i can manually select governor via commandline. The reason i chose to run puppy over other OS (raspbian etc) is puppy run slimmer, and much faster on this much underpowered board.

For eg. a simple catfish file search on those debian-based systems took me 60 seconds to return results. Whereas, puppy pfind found the file in under 5 seconds. On the same Raspberry Pi Zero.

I been using pi zero in such a way for few months now. Just switch to puppy for arm and realise the difference.
Post Reply

Return to “Beginners Help”