Environment Setup
- Before app development, install the driver, firmware, and CANN software. For details about how to deploy an environment, see CANN Software Installation Guide.
After the CANN package is installed, log in to the environment as the CANN operating user and run the source $INSTALL_DIR/set_env.sh command to set environment variables. Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.
- (Optional) Use environment variables ASCEND_CACHE_PATH and ASCEND_WORK_PATH to set the flushing path of the files generated during the building and running of the app. This operation involves functions such as ATC model conversion, app build and configuration, intelligent AOE model tuning, performance data collection, and log collection. The files flushed include operator building cache files, knowledge base files, tuning result files, performance data files, and log files.
The following is a configuration example. For details about the configuration, see Environment Variables.
export ASCEND_CACHE_PATH=/repo/task001/cache export ASCEND_WORK_PATH=/repo/task001/172.16.1.12_01_03
Run the export command to make the environment variable take effect only in the current terminal window and only for the AI app processes started after the environment variable is set.
If you write the export command to the ~/.bashrc file to make the environment variable permanent, the environment variable takes effect for all AI app processes of the user. This method may affect other app processes that do not require device ID adjustment. Therefore, exercise caution when using this method. To write the export command to the ~/.bashrc file, perform the following steps:
- Run the vi ~/.bashrc command in any directory as the installation user and append the preceding commands to the file.
- Run the :wq! command to save the file and exit.
- Run the source ~/.bashrc command to make the environment variable take effect.