Before You Start

Environment Preparation

  1. Install CANN packages based on the actual scenario and configure CANN environment variables. For details, see CANN Software Installation.

    In the Ascend EP scenario, the msprof tool is saved in ${INSTALL_DIR}/tools/profiler/bin. 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.

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

  2. Set public environment variables.

    After the CANN software 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.

  3. Set Python environment variables.

    If there are multiple Python 3 series versions, specify your Python installation path as needed. 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 them 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 variables take effect.

Restrictions

Before using the tool, understand the following restrictions: