Differences Between the Working Modes of Ascend AI Processors
The Ascend AI Processor can work in EP or RC mode. Note the following differences in app development for the two working modes.
Environment Setup
Working Mode |
See Also |
|---|---|
EP |
Before setting up the development environment and operating environment, refer to: |
RC |
App Building
Note the following differences between the two working modes regarding app building in terms of the environment variable configuration and build command.
- Environment variable configuration
Table 2 Environment variable configuration Working Mode
Environment Variable
EP
- If the development environment and operating environment have the same CPU architecture (x86, for example):
export DDK_PATH=$HOME/Ascend/ascend-toolkit/latest/x86_64-linux export NPU_HOST_LIB=$HOME/Ascend/ascend-toolkit/latest/x86_64-linux/compiler/lib64/stub
- If the development environment uses the x86 architecture while the operating environment uses the Arm architecture:
export DDK_PATH=$HOME/Ascend/ascend-toolkit/latest/arm64-linux export NPU_HOST_LIB=$HOME/Ascend/ascend-toolkit/latest/arm64-linux/runtime/lib64/stub
RC
In RC mode, the development environment runs Ubuntu (x86) while the operating environment runs Ubuntu (Arm). Configure the following environment variables:
export DDK_PATH=$HOME/Ascend/ascend-toolkit/latest/arm64-linux export NPU_HOST_LIB=$HOME/Ascend/ascend-toolkit/latest/arm64-linux/runtime/lib64/stub
$HOME/Ascend/ascend-toolkit/latest in the environment variable configuration in the table is for reference only.
- In EP mode, replace it with the actual standard-form compiler or Runtime installation path.
- In RC mode, replace it with the actual MiniRC-form Runtime installation path.
- If the development environment and operating environment have the same CPU architecture (x86, for example):
- Build command
Table 3 Build command Working Mode
Environment Variable
EP
- If the CPU architecture of the development environment matches that of the operating environment:
cmake ../../../src -DCMAKE_CXX_COMPILER=g++ -DCMAKE_SKIP_RPATH=TRUE
- If the CPU architecture of the development environment differs from that of the operating environment:
cmake ../../../src -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SKIP_RPATH=TRUE
RC
In RC mode, the development environment runs Ubuntu (x86) while the operating environment runs Ubuntu (Arm). The build command is:
cmake ../../../src -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SKIP_RPATH=TRUE
- If the CPU architecture of the development environment matches that of the operating environment: