Table of Contents | ||
---|---|---|
|
1. Structure
...
2. Resource
To support the use of dual NPUs, it is necessary to prepare the system environment and runtime environment of the C3V-W Dual EVB. Currently, two parts of the compressed packages are available:
system environment:
View file name master_dual_npu_support.tar.gz VSI SDK libraries:
andView file name galcore_sdk0.tar.gz View file name galcore_sdk1.tar.gz
2.1. System Environment
The system environment provides compressed packages:master_dual_npu_support.tar.gz. Which is contains two patch files. This patch is based on the following version:
https://github.com/sunplus-plus1/Q654.git
linux/kernel
...
commit f85ca635311c4fdff741ffe7ef87f8a1243144a7 (master)
boot/xboot
commit f2f03a8ba9bcfb1b0c1efd4f6e351b8c50641224 (origin/v1.0, master)
Please apply patch modifications based on this version.
...
master_dual_npu_linux.patch: The Linux patch file. The path is as follows: "Q654\linux\kernel".
master_dual_npu_xboot.patch: the xboot folder patch file. The path is as follows: "Q654\boot\xboot".
2.2.
...
SDK Libraries
The VSI SDK Libraries have been included in the compressed files:
...
When running the app, it is necessary to specify the link library path: LD_LIBRARY_PATH
3.
...
Environment Preparation
3.1 System
Please patch file modifications into the Xboot and Linux codes, and Compile the working environments for the master and slave separately. Reburn master and slave ISP_SD_BOOOT.img to micro SD card.
Execute the following command in the master Linux system:
Code Block |
---|
cat /sys/kernel/debug/clk/clk_summary | grep "NPU_SLAVE" |
When you see the following results, it indicates that the modifications to the Master kernel have taken effect.
Code Block |
---|
NPU_SLAVE 0 0 0 500000000 0 0 50000 |
Please confirm that the Slave serial port prints the following log, which indicates that Slave CPU has been initialized
Code Block |
---|
---- CPIO-R slave mode Begin ---- VCO: 4.0G, PLL: 1.0G PHY status change: 0x08000001 PHY status check Passed CPIO Initial Finished PHY Mode: 0x0000008D Timer start: 0x00000000 Timer End: 0x00000009 gic init ... |
3.2 NPU Modules Compile
NPU Version choice v6.4.15.9. Compile master/slave modules
Code Block | ||
---|---|---|
| ||
make kconfig > Device Drivers > Multimedia support > Media drivers > ML Inference Processor VIP9000_NPU > NPU Core choice |
...
galcore1.ko:slave NPU module;
...
3.3 Insmod Modules
Install the model using the following parameters:
Code Block | ||
---|---|---|
| ||
insmod ./galcore0.ko powerManagement=1 mmuPageTablePool=0 major=199 insmod ./galcore1.ko powerManagement=1 mmuPageTablePool=0 major=200 |
Please change the permissions of the device node:
Code Block |
---|
sudo chmod 666 /dev/galcore
sudo chmod 666 /dev/galcore1 |
After successful installation, you can see it in the device list /dev/galcore and /dev/galcore1.
...
Code Block |
---|
crw-rw-rw- 1 root root 199, 0 Nov 21 21:11 /dev/galcore
crw-rw-rw- 1 root root 200, 0 Nov 21 21:11 /dev/galcore1 |
3.4. Run Process
Executing the required processes in the script is recommended. Different SDK paths can be specified in the script file.
...