1. Kernel Driver Compilation
The C3V Linux working environment compiles NN drivers by default, with the default driver version being V6.4.15.9. If you want to configure the driver version, please refer to 1.1, otherwise please skip it.
1.1. Driver version configuration
To choose the NN driver, you can use the command “make kconfig”. After entering the kernel configuration menu, select the corresponding driver version. The path for driver configuration is as follows:
Device Drivers -> Multimedia support -> Media drivers -> ML Inference Processor VIP9000_NPU
Select the required driver version and use the command “make” to complete the Linux compilation process.
1.2. Driver Power Management
If you need to enable the power management function of the NN driver, you need to set the parameter “powerManagement=1” when probe the galcore.ko module.
modprobe galcore powerManagement=1
2. VIP9000 SDK Usage
2.1. App Complication
The VIP9000 SDK has been placed in the C3V Linux system directory. The path of VIP9000 SDK is: workspace/linux/rootfs/initramfs/prebuilt/vip9000sdk.
When compiling NN related applicaiton, it is necessary to include SDK headers and libraries.
Example of SDK Include Path:
INCLUDES+=-I$(VIVANTE_SDK_DIR)/include/ \ -I$(VIVANTE_SDK_DIR)/include/CL \ -I$(VIVANTE_SDK_DIR)/include/VX \ -I$(VIVANTE_SDK_DIR)/include/ovxlib \ -I$(VIVANTE_SDK_DIR)/include/jpeg
Example of SDK Link Libraries:
LIBS+=-lOpenVX -lOpenVXU -lCLC -lVSC -lGAL -ljpeg -lovxlib
2.2. App Running
The location of the library files for the VIP9000 SDK in the C3V Linux system is /lib64. When executing NN related applications, it is necessary to specify the address of the SDK libraries:
export LD_LIBRARY_PATH=/lib64:$LD_LIBRARY_PATH