NPU loading shows around 30%

I’m trying to find the reason why my usage is about 30% in my device. I use Ubuntu 20.04.
What do you think? I deactivated the module and activated again. It always requires 27-30% usage minimum. When I use AI it increases but this number always more than 27-30%.

cat /sys/kernel/debug/galcore/

chip id should setting by <echo **id>chipinfo>
PID NAME
gpu0 mc clock: 799993254 HZ.
gpu0 sh clock: 800004723 HZ.
GPU Idle: 0 ns
galcore module param will dumped by printk
Dump one core: For example, dump core 0: echo 0 > /sys/kernel/debug/gc/dump_trigger; cat /sys/kernel/debug/gc/dump_trigger
Dump all cores: echo all > /sys/kernel/debug/gc/dump_trigger; cat /sys/kernel/debug/gc/dump_trigger
The dump will be in [dmesg].
On: 2,243,923,041,652 ns
Off: 19,211,429,968 ns
Idle: 0 ns
Suspend: 0 ns
gpu : 0
model : 8000
revision : 7120
product : 45080009
eco : 0

core : 0
load : 29%

VIDEO MEMORY:
POOL SYSTEM:
Free : 2080334 B
Used : 16818 B
MinFree : 2080334 B
MaxUsed : 16818 B
Total : 2097152 B
POOL VIRTUAL:
Used : 0 B
MaxUsed : 0 B
power off timeout: 300 ms.
version: 6.4.8.7.1.1.1

Hello @FelixFelicisus

@ivan.li will help you to check this issue later.

Hello @FelixFelicisus
Please refer to this article to calculate the usage rate.
http://docs.khadas.com/products/sbc/vim3/npu/npu-performance

inceptionv3/VIM3# ./run.sh

[ 1] TOTAL_READ_BANDWIDTH (MByte): 69.470709
[ 2] TOTAL_WRITE_BANDWIDTH (MByte): 18.217142
[ 3] AXI_READ_BANDWIDTH (MByte): 33.036594
[ 4] AXI_WRITE_BANDWIDTH (MByte): 15.209099
[ 5] DDR_READ_BANDWIDTH (MByte): 36.434115
[ 6] DDR_WRITE_BANDWIDTH (MByte): 3.008043
[ 7] GPUTOTALCYCLES: 37117151
[ 8] GPUIDLECYCLES: 17855555

NPU = (GPUTOTALCYCLES - GPUIDLECYCLES)/GPUTOTALCYCLES = (37117151 - 17855555)/ 37117151 * 100% = 52 %.

I didn’t change anything in started algorithm. As I understand this method lets to work with some image, but I tried to test npu without loading. And I never see around zero usage. It’s strange for me.

@FelixFelicisus the GPU and NPU on the VIM3 have a shared bus interface, the idle cycles not only include the NPU running and GPU halted, but also memory accesses during which the GPU and NPU are stalled, we do not have the specific details as to how many cycles the memory fetch can take, so these cycles are often added along with the NPU’s cycle count, because of this reason you won’t see 0% NPU usage, nor will you see 100% usage.

Regards.

1 Like

You can improve the percentage used when you run your AI program on the faster A73 cores instead of letting the OS schedule it over the A73 and A53 cores.

You can do this by setting the CPU affinity of your AI program to use only the A73 cores.

1 Like

@Electr1 I would like to get statistics with GPU and NPU independently. Maybe I don’t understand correctly. Is it possible to get clear npu usage and clear gpu usage or not?

@FelixFelicisus it won’t be possible to get 100% accurate statistics.

1 Like