Environment Setup

  • Environment Setup

    Refer to the CANN Software Installation Guide to install CANN software packages based on the actual environment.

    In the Ascend EP scenario, the msprof tool is saved in ${INSTALL_DIR}/tools/profiler/bin, Replace ${INSTALL_DIR} with the actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest..

    In the Ascend RC scenario, the msprof tool is saved in /var.

  • Set public environment variables.

    After the CANN software is installed, when you build and run your application as the CANN running user, log in to the environment as the CANN running user and run the source ${install_path}/set_env.sh command to set environment variables. {install_path} indicates the CANN installation path, for example, /usr/local/Ascend/ascend-toolkit.

  • Set Python environment variables.
    If multiple Python 3 versions exist, specify your Python installation path as required. The following takes Python 3.7.5 as an example.
    export PATH=/usr/local/python3.7.5/bin:$PATH
    # Set the library path for Python 3.7.5.
    export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH

The preceding environment variables take effect only in the current window. You can write the preceding commands to the ~/.bashrc file to make the environment variables take effect permanently. The operations are as follows:

  1. Run the vi ~/.bashrc command in any directory as the installation user and append the preceding commands to the file.
  2. Run the :wq! command to save the file and exit.
  3. Run the source ~/.bashrc command to make the environment variable take effect.