Joshua-Riek / ubuntu-rockchip

Ubuntu for Rockchip RK35XX Devices
https://joshua-riek.github.io/ubuntu-rockchip-download/
GNU General Public License v3.0
2.11k stars 230 forks source link

Inspecting CPU core frequencies on Rock5B? #233

Closed guynich closed 1 year ago

guynich commented 1 year ago

Thanks for this work on rockchip - I'm running v1.18 release on OrangePi 5 and OKdo radxa Rock5B.
On the OrangePi I can get the CPU core frequencies by running lscpu | grep CPU, e.g.:

orangepi@orangepi:~$ lscpu | grep CPU
CPU op-mode(s):                  32-bit, 64-bit
CPU(s):                          8
On-line CPU(s) list:             0-7
CPU max MHz:                     1800.0000
CPU min MHz:                     408.0000
CPU max MHz:                     2256.0000
CPU min MHz:                     408.0000
orangepi@orangepi:~$ 

If I try the same on Rock5B I do not see the MHz values, e.g.:

rock5b-1@rock5b-1:~$ lscpu | grep CPU
CPU op-mode(s):                  32-bit, 64-bit
CPU(s):                          8
On-line CPU(s) list:             0-7
rock5b-1@rock5b-1:~$

I've also tried this sudo cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq: but cpufreq is not found on Rock5B Any suggestions how to find the CPU core frequencies?

Joshua-Riek commented 1 year ago

One moment, I need to flash a new image to my sdcard.

The path you are looking for should be /sys/bus/cpu/devices/cpu*/cpufreq/, but I need to confirm.

Joshua-Riek commented 1 year ago

Yeah, it looks like you were looking at the wrong path.

ubuntu@ubuntu:~$ sudo cat /sys/bus/cpu/devices/cpu*/cpufreq/cpuinfo_cur_freq 
1800000
1800000
1800000
1800000
2304000
2304000
2352000
2352000
guynich commented 1 year ago

Thanks for checking this so fast. I suspect I have a corrupted microSD card because I see this:

rock5b-1@rock5b-1:~$ ls /sys/bus/cpu/devices/cpu*/cpufreq
ls: cannot access '/sys/bus/cpu/devices/cpu*/cpufreq': No such file or directory
rock5b-1@rock5b-1:~$ 

I'll write a new card and test again. Thanks again Joshua!

guynich commented 1 year ago

I flashed a microSD card from v1.19 release, and your command described above in link works exactly as you said.

Also the command I described lscpu | grep CPU includes the CPU MHz values as expected.

Sorry for the false alarm. Thanks Joshua