...
Table of Contents | ||
---|---|---|
|
1. NPU Driver
The SP7350 Linux includes the NPU driver by default, supporting three versions: 6.4.13.8, 6.4.15.9, and 6.4.18.5. By default, version 6.4.15.9 is selected.
1.1. Changing the Version
To switch to a different version, run the ‘make kconfig’ command in the project's top directory. When the Linux Kernel Configuration menu appears, move cursor to select the desired driver version. The path is:
...
After selecting the desired driver version, complete the Linux compilation process by running the ‘make’ command.
1.2. Power Management
The NPU driver supports power management, allowing it to power on when the driver probes and power off when the driver is removed. To enable this function, insert the NPU driver with the ‘powerManagement=1’ parameter. Use the ‘modprobe’ command as shown below:
...
Code Block |
---|
~ # ls /dev/galcore /dev/galcore |
2. NN Shared Libraries
Neural network (NN) applications cannot directly interact with the NPU but instead rely on the NPU driver and prebuilt NN shared libraries. These libraries, along with relevant header files, are stored in the project directory of the SP7350 for different versions.
...
Upon selecting a version of the NPU driver, the corresponding NN shared libraries are automatically copied to the '/lib64' directory of the root file system on the target SP7350 system. This ensures that the required libraries are readily accessible for NN applications.
3. NN Applications
Neural network (NN) applications leverage the NPU to execute complex neural network operations by invoking functions within NN shared libraries.
3.1. Compiling NN Applications
When compiling NN applications, users must include the appropriate header files and shared libraries, as demonstrated below:
Code Block | ||
---|---|---|
| ||
INCLUDES+=-I$(VIVANTE_SDK_DIR)/include/HAL \ -I$(VIVANTE_SDK_DIR)/include/CL \ -I$(VIVANTE_SDK_DIR)/include/VX \ -I$(VIVANTE_SDK_DIR)/include/ovxlib \ -I$(VIVANTE_SDK_DIR)/include/jpeg LIBS+=-lOpenVX -lOpenVXU -lCLC -lVSC -lGAL -ljpeg -lovxlib |
3.2. Running NN Application
During runtime, ensure that the NN shared libraries are accessible by setting the library path accordingly:
...