Profiling the NPU and Installing gputop for Neural Processing Unit in NXP i.MX8M Plus
Getting started with AI on NXP i.MX8M Plus RidgeRun documentation is currently under development. |
Including the gputop module
This binary is provided by the recipes at sources/meta-imx/meta-sdk, so if you are developing for i.MX8M Plus from the Variscite images based on the NXP BSP, you will have the dependencies for this sampler. In order to include gputop to be a GPU/NPU usage sampler for the i.MX8M Plus, then go to the local.conf file, and add the following line:
CORE_IMAGE_EXTRA_INSTALL += "gputop"
After adding this line, please configure the environment and rebake the image:
cd $HOME/<your image folder> source setup-environment <your build directory> bitbake imx-image-core
Then flash the image into the SD card, and boot the board. Access it by serial or SSH, and then execute:
gputop
The output of the command above is like the following:
Galcore version:6.4.3.305572, gpuperfcnt:8e763ddca55b, 1.4 3D:GC7000,Rev:6204 Core: 999 MHz, Shader: 999 MHz 3D:GC8000,Rev:8002 Core: 999 MHz, Shader: 999 MHz 2D:GC520,Rev:5341 3D Cores:2,2D Cores:1,VG Cores:0 IMX8_DDR0: axid-read:15.66,axid-write:6.46 IMX8_DDR1: PID RES(kB) CONT(kB) VIRT(kB) Non-PGD(kB) Total(kB) CMD 760 33171 2147 0 0 35318 car TOT: 33171 2147 0 0 35318 TOT_CON: - - - - 228972
As you can see in the previous output, there is a process called car with a PID of 760. This means that this process is using the NPU or the GPU since both of the accelerators use axi for communicate. In this specific case, the process was detecting license plates from an image using the NPU for accelerating the inference.