打印
[ARM入门]

RK3588性能设置 CPU GPU DDR NPU 频率设置

[复制链接]
40|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
ZXjsy|  楼主 | 2025-3-6 17:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一.CPU定频/sys/devices/system/cpu/cpufreq/policy0:(对应4个A55:CPU0-3)affected_cpus     cpuinfo_max_freq  cpuinfo_transition_latency  scaling_available_frequencies  scaling_cur_freq  scaling_governor  scaling_min_freq  statscpuinfo_cur_freq  cpuinfo_min_freq  related_cpus                scaling_available_governors    scaling_driver    scaling_max_freq  scaling_setspeed/sys/devices/system/cpu/cpufreq/policy4:(对应2个A76:CPU4-5)affected_cpus     cpuinfo_max_freq  cpuinfo_transition_latency  scaling_available_frequencies  scaling_cur_freq  scaling_governor  scaling_min_freq  statscpuinfo_cur_freq  cpuinfo_min_freq  related_cpus                scaling_available_governors    scaling_driver    scaling_max_freq  scaling_setspeed/sys/devices/system/cpu/cpufreq/policy6:(对应2个A76:CPU6-7)affected_cpus     cpuinfo_max_freq  cpuinfo_transition_latency  scaling_available_frequencies  scaling_cur_freq  scaling_governor  scaling_min_freq  statscpuinfo_cur_freq  cpuinfo_min_freq  related_cpus                scaling_available_governors    scaling_driver    scaling_max_freq  scaling_setspeedrk3588_s:/ #
[color=rgb(51, 51, 51) !important]2. 获取当前CPU支持的频点
cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000 2304000
[color=rgb(51, 51, 51) !important]3. 获取cpu运行的模式
cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_governorsconservative ondemand userspace powersave performance schedutil默认是自动变频模式:schedutil(恢复的话设置为该模式即可)。
[color=rgb(51, 51, 51) !important]4. 设置手动定频模式:userspace
echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
[color=rgb(51, 51, 51) !important]5. 设置频率为2016000
echo 2016000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_setspeed
[color=rgb(51, 51, 51) !important]确认是否设置成功
cat /sys/devices/system/cpu/cpufreq/policy6/cpuinfo_cur_freq2016000
[color=rgb(51, 51, 51) !important]二.GPU定频
[color=rgb(51, 51, 51) !important]1. GPU的节点路径
ls /sys/class/devfreq/fb000000.gpu/available_frequencies cur_freq governor max_freq name power target_freq trans_statavailable_governors device load min_freq polling_interval subsystem timer uevent
[color=rgb(51, 51, 51) !important]2. 获取GPU支持的频点
cat /sys/class/devfreq/fb000000.gpu/available_frequencies1000000000 900000000 800000000 700000000 600000000 500000000 400000000 300000000
[color=rgb(51, 51, 51) !important]3. 获取GPU运行的模式
cat /sys/class/devfreq/fb000000.gpu/available_governorsuserspace powersave performance simple_ondemand
[color=rgb(51, 51, 51) !important]默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)。
[color=rgb(51, 51, 51) !important]4. 设置手动定频模式:userspace
echo userspace > /sys/class/devfreq/fb000000.gpu/governor
[color=rgb(51, 51, 51) !important]5. 设置频率为1000000000
echo 1000000000 > /sys/class/devfreq/fb000000.gpu/userspace/set_freqcat /sys/class/devfreq/fb000000.gpu/cur_freq
[color=rgb(51, 51, 51) !important]6. 查看GPU的负载
cat /sys/class/devfreq/fb000000.gpu/load0@1000000000Hz三.NPU定频
[color=rgb(51, 51, 51) !important]1. NPU的节点路径
ls /sys/class/devfreq/fdab0000.npu/available_frequencies device max_freq polling_interval target_freq ueventavailable_governors governor min_freq power timer userspacecur_freq load name subsystem trans_stat
[color=rgb(51, 51, 51) !important]2. 获取NPU支持的频点
cat /sys/class/devfreq/fdab0000.npu/available_frequencies300000000 400000000 500000000 600000000 700000000 800000000 900000000 1000000000
[color=rgb(51, 51, 51) !important]3. 获取NPU运行的模式
cat /sys/class/devfreq/fdab0000.npu/available_governorsuserspace powersave performance simple_ondemand
[color=rgb(51, 51, 51) !important]默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)。
[color=rgb(51, 51, 51) !important]4. 设置手动定频模式:userspace
echo userspace > /sys/class/devfreq/fdab0000.npu/governor
[color=rgb(51, 51, 51) !important]5. 设置频率为1000000000
echo 1000000000 > /sys/class/devfreq/fdab0000.npu/userspace/set_freqcat /sys/class/devfreq/fdab0000.npu/cur_freq
[color=rgb(51, 51, 51) !important]6. 查看NPU的负载
cat /sys/kernel/debug/rknpu/loadNPU load: Core0: 0%, Core1: 0%, Core2: 0%四.RK3588 CPU GPU NPU 温度监控
[color=rgb(51, 51, 51) !important]CPU利用率95%以上时的CPU温升情况,记录cpu各个核的温度,主要针对一下的cpu
[color=rgb(51, 51, 51) !important]RK3588的芯片有7路TS-ADC分别对应:芯片中心位置、A76_0/1、A76_2/3、DSU 、A55_0/1/2/3、PD_CENTER、 NPU、GPU。
[color=rgb(51, 51, 51) !important](1)芯片中心位置温度:
[color=rgb(51, 51, 51) !important](2)CPU大核A76_0/1 即CPU4和CPU5的温度:
[color=rgb(51, 51, 51) !important](3)CPU大核A76_2/3 即CPU6和CPU7的温度:
[color=rgb(51, 51, 51) !important](4)CPU小核A55_0/12/3 即CPU0、CPU1、CPU2、CPU3的温度
[color=rgb(51, 51, 51) !important](5)PD_CENTER的温度:
[color=rgb(51, 51, 51) !important](6)GPU的温度
[color=rgb(51, 51, 51) !important](7) NPU的温度
[color=rgb(51, 51, 51) !important]可先运行cpuburn,指定压测核数:
[color=rgb(51, 51, 51) !important]cpuburn -n=4
[color=rgb(51, 51, 51) !important]然后执行下面的附件脚本,每十分钟记录一次,记录24小时,一共24*6=144次。
复制#!/bin/bashif [ -f /tmp/cpu_temper.log ];then        rm -rf /tmp/cpu_temper.logfifor i in {1..144}do        echo  "$(date +%Y-%m-%d %H:%M:%S)" >> /tmp/cpu_temper.log        soc_thermal=`cat /sys/class/thermal/thermal_zone0/temp`        soc_thermal_interger=${soc_thermal:0:2}        soc_thermal_decimal=${soc_thermal:2:3}        soc_thermal_float="soc_thermal="${soc_thermal_interger}"."${soc_thermal_decimal}        CPU_A76_01=`cat /sys/class/thermal/thermal_zone1/temp`        CPU_A76_01_interger=${CPU_A76_01:0:2}        CPU_A76_01_decimal=${CPU_A76_01:2:3}        CPU_A76_01_float="CPU_A76_01="${CPU_A76_01_interger}"."${CPU_A76_01_decimal}        CPU_A76_23=`cat /sys/class/thermal/thermal_zone2/temp`        CPU_A76_23_interger=${CPU_A76_23:0:2}        CPU_A76_23_decimal=${CPU_A76_23:2:3}        CPU_A76_23_float="CPU_A76_23="${CPU_A76_23_interger}"."${CPU_A76_23_decimal}        CPU_A55_0123=`cat /sys/class/thermal/thermal_zone3/temp`        CPU_A55_0123_interger=${CPU_A55_0123:0:2}        CPU_A55_0123_decimal=${CPU_A55_0123:2:3}        CPU_A55_0123_float="CPU_A55_0123="${CPU_A55_0123_interger}"."${CPU_A55_0123_decimal}        PD_CENTER=`cat /sys/class/thermal/thermal_zone4/temp`        PD_CENTER_interger=${PD_CENTER:0:2}        PD_CENTER_decimal=${PD_CENTER:2:3}        PD_CENTER_float="PD_CENTER="${PD_CENTER_interger}"."${PD_CENTER_decimal}        GPU=`cat /sys/class/thermal/thermal_zone5/temp`        GPU_interger=${GPU:0:2}        GPU_decimal=${GPU:2:3}        GPU_float="GPU="${GPU_interger}"."${GPU_decimal}        NPU=`cat /sys/class/thermal/thermal_zone6/temp`        NPU_interger=${NPU:0:2}        NPU_decimal=${NPU:2:3}        NPU_float="NPU="${NPU_interger}"."${NPU_decimal}        line=${soc_thermal_float}"  "${CPU_A76_01_float}"  "${CPU_A76_23_float}"  "${CPU_A55_0123_float}"  "${PD_CENTER_float}"  "${GPU_float}"  "${NPU_float}        echo $line >> /tmp/cpu_temper.log        sync        sleep 600sdone

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

19

主题

20

帖子

0

粉丝