Installing CANN

Prerequisites

Before installation, ensure that the Python environment and pip3 are available. CANN currently supports Python versions 3.7.x to 3.13.x. If this requirement is not met, run the following commands to install them:

Debian, Ubuntu, and veLinux:
1
sudo apt-get install -y python3 python3-pip
openEuler, CentOS, Kylin, BC-Linux, UOS V20, AntOS, AliOS, CTyunOS, CULinux, Tlinux, MTOS, vesselOS:
1
sudo yum install -y python3 python3-pip

If the installation fails, the version does not meet the requirements, or the dynamic library libpython3.x.so is not included, perform the operations in Compiling and Installing Python.

Installing the Toolkit

The CANN Toolkit is designed for training, inference, and development and debugging scenarios. It is mainly used for training and inference workloads, model conversion, as well as the development and compilation of operators, applications, and models.

Before installing Toolkit, ensure that the available space of the installation directory is greater than 10 GB. Otherwise, clear the space or change the installation directory.

Architecture

Installation Command

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-toolkit_9.0.0_linux-aarch64.run
bash ./Ascend-cann-toolkit_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-toolkit_9.0.0_linux-x86_64.run
bash ./Ascend-cann-toolkit_9.0.0_linux-x86_64.run --install

The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description. If you do not specify an installation path, the software is installed to the default path. For the root user, the default path is /usr/local/Ascend. For a non-root user, the default path is ${HOME}/Ascend, where ${HOME} indicates the current user directory.

After the installation is complete, configure environment variables. The following uses the default path of non-root users as an example. Replace the example path with the actual path of set_env.sh.
1
source ${HOME}/Ascend/cann/set_env.sh

The preceding environment variables take effect only in the current window. You can add the preceding command to the environment variable configuration file (for example, the .bashrc file) as required.

Installing the ops

The CANN ops package integrates a comprehensive suite of libraries, including the operator foundational framework, operator libraries (covering math, nn, cv, and transformer), TBE operators, HCCL, HIXL, and the DVPP library. Specifically, it provides dynamic and static library files for single-operator API execution (e.g., aclnn-class APIs), operator source code, and kernel binaries, ultimately optimizing overall execution performance in high-performance computing (HPC) scenarios.

Before installing the ops package, ensure that the Toolkit software package of a compatible version has been installed in the same path. Select the ops software package corresponding to the running device. Currently, installing ops packages for multiple chips under the same path is not supported. You can install the Toolkit and the corresponding ops packages for different chips in separate paths to meet development and deployment requirements in multi-chip environments.

Table 1 Installing the ops

Product Type

Architecture

Installation Command

Atlas 350 Accelerator Card

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-950-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-950-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-950-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-950-ops_9.0.0_linux-x86_64.run --install

Atlas A3 series

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-A3-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-A3-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-A3-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-A3-ops_9.0.0_linux-x86_64.run --install

Atlas A2 series

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-910b-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-910b-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-910b-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-910b-ops_9.0.0_linux-x86_64.run --install

Atlas training series

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-910-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-910-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-910-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-910-ops_9.0.0_linux-x86_64.run --install

Atlas inference series

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-310p-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-310p-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-310p-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-310p-ops_9.0.0_linux-x86_64.run --install

Atlas 200I/500 A2 inference products

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-310b-ops_9.0.0_linux-aarch64.run
bash ./Ascend-cann-310b-ops_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-310b-ops_9.0.0_linux-x86_64.run
bash ./Ascend-cann-310b-ops_9.0.0_linux-x86_64.run --install

(Optional) Installing the NNAL

The NNAL comprises the ATB and SiP libraries.

Before installing the ATB, install Toolkit of the matching version and configure environment variables. Use the same user to do these operations.

Architecture

Installation Command

aarch

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-nnal_9.0.0_linux-aarch64.run
bash ./Ascend-cann-nnal_9.0.0_linux-aarch64.run --install

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.0.0/Ascend-cann-nnal_9.0.0_linux-x86_64.run
bash ./Ascend-cann-nnal_9.0.0_linux-x86_64.run --install

The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description. If you do not specify an installation path, the software is installed to the default path. For the root user, the default path is /usr/local/Ascend. For a non-root user, the default path is ${HOME}/Ascend, where ${HOME} indicates the current user directory.

Configure environment variables. The following uses the default path of non-root users as an example. Replace the example path with the actual path of set_env.sh of the ATB.
  • ATB:
    1
    source ${HOME}/Ascend/nnal/atb/set_env.sh
    
  • SiP:
    1
    source ${HOME}/Ascend/nnal/asdsip/set_env.sh
    

The preceding environment variables take effect only in the current window. You can add the preceding command to the environment variable configuration file (for example, the .bashrc file) as required.