RK3588|RK3588 CPU GPU DDR NPU定频和性能模式设置

RK3588 CPU GPU NPU DDR定频和性能模式设置方法
文章目录

  • RK3588 CPU GPU NPU DDR定频和性能模式设置方法
    • 查看RK3588 CPU GPU DDR NPU的频率电压表
    • CPU定频
      • 获取当前CPU支持的频点
      • 获取cpu运行的模式
      • 设置手动定频模式:userspace
      • 设置频率为2016000
      • 确认是否设置成功
    • GPU定频
      • GPU的节点路径
      • 获取GPU支持的频点
      • 获取GPU运行的模式
      • 设置手动定频模式:userspace
      • 设置频率为1000000000
      • 确认是否设置成功
      • 查看GPU的负载
    • DDR定频
      • DDR的节点路径
      • 获取DDR支持的频点
      • 获取DDR运行的模式
      • 设置手动定频模式:userspace
      • 设置频率为2112000000
      • 确认是否设置成功
      • 查看DDR的负载
    • NPU定频
      • NPU的节点路径
      • 获取NPU支持的频点
      • 获取NPU运行的模式
      • 设置手动定频模式:userspace
      • 设置频率为1000000000
      • 确认是否设置成功
      • 查看NPU的负载
    • CPU性能模式
    • GPU性能模式
    • DDR性能模式
    • NPU性能模式

查看RK3588 CPU GPU DDR NPU的频率电压表 在设计上面通过ADB命令可以查看机器的频率电压信息:
rk3588_s:/ $ su rk3588_s:/ # cat /d/opp/opp_summary devicerate(Hz)target(uV)min(uV)max(uV) ------------------------------------------------------------------- platform-fdab0000.npu 200000000675000675000850000 675000675000850000 300000000675000675000850000 675000675000850000 400000000675000675000850000 675000675000850000 500000000675000675000850000 675000675000850000 600000000675000675000850000 675000675000850000 700000000675000675000850000 675000675000850000 800000000712500712500850000 712500712500850000 900000000762500762500850000 762500762500850000 1000000000812500812500850000 812500812500850000 platform-dmc 528000000675000675000675000 1068000000725000725000725000 1560000000800000800000800000 2112000000850000850000850000 platform-fb000000.gpu 300000000675000675000850000 675000675000850000 400000000675000675000850000 675000675000850000 500000000675000675000850000 675000675000850000 600000000675000675000850000 675000675000850000 700000000675000675000850000 675000675000850000 800000000700000700000850000 700000700000850000 900000000750000750000850000 750000750000850000 1000000000800000800000850000 800000800000850000 cpu6 4080000006750006750001000000 6750006750001000000 6000000006750006750001000000 6750006750001000000 8160000006750006750001000000 6750006750001000000 10080000006750006750001000000 6750006750001000000 12000000006750006750001000000 6750006750001000000 14160000006750006750001000000 6750006750001000000 16080000007000007000001000000 7000007000001000000 18000000007625007625001000000 7625007625001000000 20160000008375008375001000000 8375008375001000000 22080000009125009125001000000 9125009125001000000 24000000009625009625001000000 9625009625001000000 cpu4 4080000006750006750001000000 6750006750001000000 6000000006750006750001000000 6750006750001000000 8160000006750006750001000000 6750006750001000000 10080000006750006750001000000 6750006750001000000 12000000006750006750001000000 6750006750001000000 14160000006750006750001000000 6750006750001000000 16080000007000007000001000000 7000007000001000000 18000000007625007625001000000 7625007625001000000 20160000008375008375001000000 8375008375001000000 22080000009125009125001000000 9125009125001000000 24000000009625009625001000000 9625009625001000000 cpu0 408000000675000675000950000 675000675000950000 600000000675000675000950000 675000675000950000 816000000675000675000950000 675000675000950000 1008000000675000675000950000 675000675000950000 1200000000675000675000950000 675000675000950000 1416000000712500712500950000 712500712500950000 1608000000787500787500950000 787500787500950000 1800000000875000875000950000 875000875000950000

CPU定频 RK3588的cpu是4个A55+4个A76,分为3组单独管理,节点分别是:
/sys/devices/system/cpu/cpufreq/policy0:(对应4个A55:CPU0-3) affected_cpuscpuinfo_max_freqcpuinfo_transition_latencyscaling_available_frequenciesscaling_cur_freqscaling_governorscaling_min_freqstats cpuinfo_cur_freqcpuinfo_min_freqrelated_cpusscaling_available_governorsscaling_driverscaling_max_freqscaling_setspeed/sys/devices/system/cpu/cpufreq/policy4:(对应2个A76:CPU4-5) affected_cpuscpuinfo_max_freqcpuinfo_transition_latencyscaling_available_frequenciesscaling_cur_freqscaling_governorscaling_min_freqstats cpuinfo_cur_freqcpuinfo_min_freqrelated_cpusscaling_available_governorsscaling_driverscaling_max_freqscaling_setspeed/sys/devices/system/cpu/cpufreq/policy6:(对应2个A76:CPU6-7) affected_cpuscpuinfo_max_freqcpuinfo_transition_latencyscaling_available_frequenciesscaling_cur_freqscaling_governorscaling_min_freqstats cpuinfo_cur_freqcpuinfo_min_freqrelated_cpusscaling_available_governorsscaling_driverscaling_max_freqscaling_setspeed rk3588_s:/ #

以上3个CPU是独立控制,下面以设置CPU6-7为例说明如何设置CPU6-7的频率
获取当前CPU支持的频点
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies 408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000 2400000

获取cpu运行的模式
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_governors conservative ondemand userspace powersave performance schedutil

默认是自动变频模式:schedutil(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su rk3588_s:/ # echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor

设置频率为2016000
rk3588_s:/ # echo 2016000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_setspeed

确认是否设置成功
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/cpuinfo_cur_freq 2016000

【RK3588|RK3588 CPU GPU DDR NPU定频和性能模式设置】其他两组CPU也是类似的方式进行设置,操作对应的节点即可。
GPU定频 GPU的节点路径
rk3588_s:/ # ls sys/class/devfreq/fb000000.gpu/ available_frequenciescur_freqgovernormax_freqnamepowertarget_freqtrans_stat available_governorsdeviceloadmin_freqpolling_intervalsubsystemtimeruevent

获取GPU支持的频点
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/available_frequencies 1000000000 900000000 800000000 700000000 600000000 500000000 400000000 300000000 200000000

获取GPU运行的模式
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/available_governors dmc_ondemand userspace powersave performance simple_ondemand

默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su rk3588_s:/ # echo userspace > sys/class/devfreq/fb000000.gpu/governor

设置频率为1000000000
rk3588_s:/ # echo 1000000000 > sys/class/devfreq/fb000000.gpu/userspace/set_freq

确认是否设置成功
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/cur_freq 1000000000

查看GPU的负载
rk3588_s_evb7:/ # cat /sys/class/devfreq/fb000000.gpu/load 28@300000000Hz

DDR定频 DDR的节点路径
1|rk3588_s:/ # ls sys/class/devfreq/dmc/ available_frequenciescur_freqdowndifferentialloadmin_freqpolling_intervalsubsystemtarget_freqtrans_statupthreshold available_governorsdevicegovernormax_freqnamepowersystem_statustimeruevent

获取DDR支持的频点
rk3588_s:/ # cat sys/class/devfreq/dmc/available_frequencies 528000000 1068000000 1560000000 2112000000

获取DDR运行的模式
rk3588_s:/ # cat sys/class/devfreq/dmc/available_governors dmc_ondemand userspace powersave performance simple_ondemand

默认是自动变频模式:dmc_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su rk3588_s:/ # echo userspace > sys/class/devfreq/dmc/governor

设置频率为2112000000
rk3588_s:/ # echo 2112000000 > sys/class/devfreq/dmc/userspace/set_freq

确认是否设置成功
rk3588_s:/ # cat sys/class/devfreq/dmc/cur_freq 2112000000

查看DDR的负载
rk3588_s_evb7:/ # cat /sys/class/devfreq/dmc/load 7@528000000Hz

NPU定频 NPU的节点路径
1|rk3588_s:/ # ls sys/class/devfreq/fdab0000.npu/ available_frequenciescur_freqgovernormax_freqnamepowertarget_freqtrans_statuserspace available_governorsdeviceloadmin_freqpolling_intervalsubsystemtimeruevent

获取NPU支持的频点
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/available_frequencies 200000000 300000000 400000000 500000000 600000000 700000000 800000000 900000000 1000000000

获取NPU运行的模式
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/available_governors dmc_ondemand userspace powersave performance simple_ondemand

默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su rk3588_s:/ # echo userspace > sys/class/devfreq/fdab0000.npu/governor

设置频率为1000000000
rk3588_s:/ # echo 1000000000 > sys/class/devfreq/fdab0000.npu/userspace/set_freq

确认是否设置成功
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/cur_freq 1000000000

查看NPU的负载
rk3588_s_evb7:/ # cat /sys/kernel/debug/rknpu/load NPU load:Core0:0%, Core1:0%, Core2:0%,

CPU性能模式
1|rk3588_s:/ $ su rk3588_s:/ # echo performance > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor

GPU性能模式
1|rk3588_s:/ $ su rk3588_s:/ # echo performance > sys/class/devfreq/fb000000.gpu/governor

DDR性能模式
1|rk3588_s:/ $ su rk3588_s:/ # echo performance > sys/class/devfreq/dmc/governor

NPU性能模式
1|rk3588_s:/ $ su rk3588_s:/ # echo performance > sys/class/devfreq/fdab0000.npu/governor

如果有帮到您,欢迎 点赞 关注
博客主页

    推荐阅读