Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Structure

image-20240603-072005.pngImage Removedimage-20240603-081950.pngImage Added

2. Resource

To support the use of dual NPUs, it is necessary to prepare the system environment and runtime environment of the C3V Dual EVB. Currently, two parts of the compressed packages are available:

  • system environment:

    View file
    namemaster_dual_npu_support.tar.gz

  • VSI SDK libraries:

    View file
    namegalcore_sdk0.tar.gz
    and
    View file
    namegalcore_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

master: a8e7251a4bc175994ea31a968e1e35cf0b0cd8e8

Please apply patch modifications based on this version.

The two patch files are xboot and Linux:

  • 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. VSI SDK Libraries

The VSI SDK Libraries have been included in the compressed files:

  • galcore_sdk0.tar.gz:the galcore SDK library for NPU master: /dev/galcore

  • galcore_sdk1.tar.gz:the galcore SDK library for NPU slave: /dev/galcore1

When running the app, it is necessary to specify the link library path: LD_LIBRARY_PATH

3. Environmental preparation

  1. Please patch file modifications into the Xboot and Linux codes, and Compile the working environments for the master and slave separately.

  2. Compile master/slave modules

Code Block
languagebash
make kconfig
> Device Drivers 
  > Multimedia support 
    > Media drivers 
      > ML Inference Processor VIP9000_NPU
        > NPU Core choice
image-20240603-072428.png

Compile Master NPU and Slave NPU separately once. After compilation, it can be done to generate two module files under the path of Linux/kernel/drivers/media/platform/deploy/vip9000/:

galcore0.ko:master NPU module;

galcore1.ko:slave NPU module;

  1. insmod module

Install the model using the following parameters:

Code Block
languagebash
insmod ./galcore0.ko powerManagement=1 mmuPageTablePool=0 major=199
insmod ./galcore1.ko powerManagement=1 mmuPageTablePool=0 major=200

After successful installation, you can see it in the device list /dev/galcore and /dev/galcore1.

  1. run process

Executing the required processes in the script is recommended. Different SDK paths can be specified in the script file.

  • master_npu_process.sh

Code Block
languagebash
export LD_LIBRARY_PATH=/path_to_sample_app:/path_to_galcore0_sdk
./sample_app
  • slave_npu_process.sh

Code Block
languagebash
export LD_LIBRARY_PATH=/path_to_sample_app:/path_to_galcore1_sdk
./sample_app