Installing CANN

Prerequisites

  • You have logged in to the installation environment as the installation user and uploaded the software packages to any directory (for example, /home/package) in the installation environment. To obtain the required software packages, click here, confirm the version information, download the Toolkit package Ascend-cann-toolkit_<version>_linux-<arch>.run and binary operator package Ascend-cann-<chip_type>-ops_<version>_linux-<arch>.run.
  • The available space of the Toolkit installation directory is greater than 10 GB. If space is insufficient, clean up the disk or choose another directory.

Installing Dependencies

You can install a dependency as the root user or a non-root user (the non-root user must be the same user who installed the CANN software package). If a non-root user is used for installation, privilege escalation is required. Obtain the necessary sudo privileges in advance. To prevent security risks associated with sudo privilege escalation, make sure to cancel permissions for high-risk commands once finished.

Perform the following operations to install the dependencies. The following commands will install the latest version or a specified version of the dependencies. For details about the version requirements for Python third-party libraries and glibc, see Runtime Dependencies.

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

    CANN supports Python 3.7.x to 3.13.x. If the installation fails, the version does not meet the requirements, or the dynamic library libpython3.x.so is not included, see Compiling and Installing Python.

  2. Install a third-party Python library. (If you install it as the root user, delete --user from the command.)
    1
    pip3 install attrs cython numpy decorator sympy cffi pyyaml pathlib2 psutil protobuf==3.20.0 scipy requests absl-py --user
    

    The preceding command installs the dependency of the latest version or a specified version. The third-party Python libraries (such as NumPy and SciPy) must match the Python version. For details about the version requirements, see Runtime Dependencies.

    If the system displays a message indicating that the pip source is unavailable during the installation, configure the pip source by referring to Configuring the pip source. Then, run the installation command.

Installing Toolkit

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.

  1. Log in to the installation environment as the installation user of the software package. Upload the obtained Toolkit to any path (for example, /home/package) in the installation environment.
  2. Install the software package. (The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description.)
    1
    bash ./Ascend-cann-toolkit_9.0.0_linux-aarch64.run --install
    

    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.

  3. Configure environment variables. The following uses the default path of a non-root user as an example. Replace the example path with the actual path of set_env.sh:
    # Configure the following during Toolkit installation:
    source ${HOME}/Ascend/cann/set_env.sh
    #Replace <arch> with the actual architecture.
    export LD_LIBRARY_PATH=${HOME}/Ascend/cann/<arch>-linux/devlib/:$LD_LIBRARY_PATH

    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.

  4. Verifying the installation. Run the following command to query the CANN version. If the query result is the same as the version of the installation software package, the installation is successful.
    1. Go to the directory where the software package installation information file is stored.
      cd ${HOME}/Ascend/cann/<arch>-linux

      In the preceding command, ${HOME}/Ascend is the default installation path of a non-root user. Replace it with the actual installation path. <arch> indicates the CPU architecture type (aarch64 or x86_64).

    2. Run the following command to view the version information provided in the version field:
      cat ascend_toolkit_install.info

Installing 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.

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