Environment Configuration

Prerequisite

Before using MindCluster ToolBox, ensure that the CANN development environment or operating environment has been set up and software listed in Table 1 has been installed based on the actual application scenario. For details about how to set up the environment and install the software, see CANN Software Installation Guide.

Table 1 Required software packages

Required Software Package

Application Scenario

Required or Not

Description

npu-driver

Inference and training

Required

-

npu-firmware

Inference and training

Required

-

Toolkit

Inference and training

Required

-

Ascend-cann-ops

Training

Required

It must be installed in the toolkit directory. Ensure the toolkit of the same version is installed and select the ops package corresponding to the running device.

In versions earlier than CANN 8.5.0, the package name is Ascend-cann-kernels.

Versions earlier than CANN 8.5.0:
  • The toolkit must be installed in the following scenarios: AICORE/one-click diagnosis, AICORE/high-risk address of on-chip memory/AICPU/one-click on-chip memory stress testing, and NPU environment restoration.
  • In training scenarios,one of the NNAE and toolkit must be installed. They can be installed separately or simultaneously.
  • In inference scenarios,one of the NNRT and toolkit must be installed. They can be installed separately or simultaneously.

Constraints

  • When MindCluster ToolBox is used, the command length cannot exceed 4096 characters.
  • For security purposes, ensure that the directories and files involved in this document meet the security requirements of your organization when using MindCluster ToolBox.
  • The executable file Ascend-DMI, together with ToolBox, is installed by the root user in the /usr/local/Ascend/toolbox/latest/Ascend-DMI/bin directory.

Adding Environment Variables

  • Environment variables are not shared by different users and need to be added separately. The following describes how to add environment variables if the installation user of CANN is root.
    1. If a specified user is used to run Ascend DMI, the user must have been added to the running user group of CANN. You can run the following command to query the running user group of CANN:
      cat /etc/ascend_install.info | grep "UserGroup"
    2. CANN provides a process-level environment variable setting script. Configure the following environment variables based on the actual software package. The default installation path of the root user is used as an example.
      Table 2 Environment variables

      Software Package

      Environment Variable

      Required or Not

      ToolBox

      source /usr/local/Ascend/toolbox/set_env.sh

      Yes

      export ASCEND_DMI_LOG_LEVEL=1

      NOTE:

      When ASCEND_DMI_LOG_LEVEL is set to 1, debug logs are recorded.

      • Log path
        • root user: /var/log/ascend-dmi/ascend-dmi-debug.log
        • Non-root user: ~/var/log/ascend-dmi/ascend-dmi-debug.log
      • If this environment variable is not specified or is set to another value, debug logs are not recorded.

      No

      Toolkit

      source /usr/local/Ascend/cann/set_env.sh

      NOTE:

      Versions earlier than CANN 8.5.0:

      • Environment variable script of the toolkit: source /usr/local/Ascend/ascend-toolkit/set_env.sh
      • Environment variable script of the NNRT package: source /usr/local/Ascend/nnrt/set_env.sh
      • Environment variable script of the NNAE package: source /usr/local/Ascend/nnae/set_env.sh

      No

      You can also configure permanent environment variables by modifying the ~/.bashrc file. The procedure is as follows:

      1. Run the vi ~/.bashrc command in any directory as the running user to open the .bashrc file and append the preceding lines to the file. Ensure that the directory meets the security requirements of your organization.
      2. Run the :wq! command to save the file and exit.
      3. Run the source ~/.bashrc command for the modification to take effect immediately.