Compass_NPU_driver includes two parts: kernel mode driver(KMD) and user mode library(UMD). KMD is a standard Linux char driver model for NPU. UMD can be compiled as dynamicly and static libraty accordingly. User application directly call top APIs in UMD and then indirectly call the interface of KMD to interract with NPU hardware.
include kernel driver (KMD) and user lib (UMD).
the reference related to how to config dts to enable AIPU on embedded boards.
the samples related to how to call UMD APIs to implement inference APPs.
the unit test cases for UMD and KMD.
Here take Juno(arm64) board as an example, If you use nother board, please change below env variables accordingly in bash_env_setup.sh (for bash) or env_setup.sh (for csh)
/home/ai/scrach01
|
|-- AIPU_BSP
|-- kernel
| |-- linux-5.11.18
|
`-- toolchain
|-- gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu
change work directory to Linux/ in Compass_NPU_driver
set common env variables
set top directory for compile package CONFIG_DRV_BTENVAR_BASE_DIR=/home/ai/scrach01 CONFIG_DRV_BTENVAR_BSP_BASE_DIR=${CONFIG_DRV_BTENVAR_BASE_DIR}/AIPU_BSP
specify cross-compile toolchain path CONFIG_DRV_BTENVAR_CROSS_CXX_PATH=${CONFIG_DRV_BTENVAR_BSP_BASE_DIR}/toolchain/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin
specify Linux kernel source code top directory CONFIG_DRV_BTENVAR_JUNO_KPATH=${CONFIG_DRV_BTENVAR_BSP_BASE_DIR}/kernel/linux-5.11.18
specify compiler for compiling samples COMPASS_DRV_BTENVAR_CROSS_CXX=aarch64-linux-gnu-g++
specify corss-copiler for compiling Linux kernel COMPASS_DRV_BTENVAR_CROSS_COMPILE_GNU=aarch64-linux-gnu-
compile commands
# cd Linux
# source bash_env_setup.sh (for bash env)
or
# source env_setup.sh (for csh env)
# ./build_all.sh -p juno [-d]
Set below env variables accordingly.
/home/ai/scratch01/
|
|-- AIPU_SIMULATOR
|
|-- bin
| |-- aipu_simulator_x1
| |-- aipu_simulator_x2
| |-- aipu_simulator_z1
| |-- aipu_simulator_z2
| |-- aipu_simulator_z3
|
`-- lib
|-- libaipu_simulator_x1.so
|-- libaipu_simulator_x2.so
|-- libaipu_simulator_z1.so
|-- libaipu_simulator_z2.so
|-- libaipu_simulator_z3.so
set top directory for compile package CONFIG_DRV_BTENVAR_BASE_DIR=/home/ai/scratch01 CONFIG_DRV_RTENVAR_SIM_BASE_PATH=${CONFIG_DRV_BTENVAR_BASE_DIR}/AIPU_SIMULATOR
specify X86 g++ and lib path CONFIG_DRV_BRENVAR_X86_CLPATH=/arm/tools/gnu/gcc/7.3.0/rhe7-x86_64/lib64 (optional) COMPASS_DRV_BTENVAR_X86_CXX=g++
specify path where store aipu v1/v2/v3 simulators and libraries CONFIG_DRV_RTENVAR_SIM_PATH=${CONFIG_DRV_RTENVAR_SIM_BASE_PATH}/bin/ COMPASS_DRV_RTENVAR_SIM_LPATH=${CONFIG_DRV_RTENVAR_SIM_BASE_PATH}/lib/
compile commands
# cd Linux
# source bash_env_setup.sh (for bash env)
or
# source env_setup.sh (for csh env)
# ./build_all.sh -p sim [-d]
2.3 Recommend document
Here take Juno(arm64) board as an example, it has to do #2.1 firstly before doing this step. then
# cd Linux
# source bash_env_setup.sh
# ./build_all.sh -p juno -t sample [-d]
After perform this command successfully, the samples are also stored in forder 'bin'.
it has to do #2.2 firstly before doing this step. then
# cd Linux
# source bash_env_setup.sh
# ./build_all.sh -p sim -t sample [-d]
After perform this command successfully, the samples are also stored in forder 'bin'.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. Open source ecosystem
2. Collaboration, People, Software
3. Evaluation model