The reason that you observed that VsiPreparedModel::initialize() three times is due to your model were splitted to 3 sub-graph, those sub-graph were executed separately by VsiNpu. Would you please refer to following command to enable npu profiling?
On Target
Click 10 times on About Tablet option in Settings, to become a developer
Choose Settings -> Developer Options -> OEM Unlocking to enable OEM unlocking.
In Android terminal (UART terminal) enter the following command:
$ reboot bootloader
On Host
device connected via USB-C:
$ sudo fastboot oem unlock
disable the DM-verity
$ adb root
$ adb disable-verity
$ adb reboot
disable selinux, exec the below cmd in uboot command,
# setenv append_bootargs androidboot.selinux=permissive
or
$ setenforce 0
After unlock android, then run following steps to enable profiling service:
- Rename service binary in /vendor/bin/hw/ from android.neural.network***vsi-npu*** to other name.
- Kill current server: ps -ef | grep vsi-npu then kill it.
- Start the service from /vendor/bin/hw
-
setprop VSI_NN_LOG_LEVEL 5
- Collect log in logcat