Installing CANN

Prerequisites

  • Obtaining Software Packages
    • Use wget to download software packages in one-click mode. For details, see the installation procedure.
    • Click here to confirm the product and version information, obtain the packages, and upload them to any directory in the installation environment, for example, /home.
  • The kit needs over 10 GB of free space in the installation directory. If there is less than 10 GB free, free up space 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. Run the following command to install dependencies.
    Debian, Ubuntu, veLinux:
    1
    sudo apt-get install -y gcc g++ python3 python3-pip
    
    openEuler, CentOS, Kylin, BC-Linux, UOS, AntOS, AliOS, CTyunOS, CULinux, Tlinux, MTOS:
    1
    sudo yum install -y gcc gcc-c++ python3 python3-pip
    

    CANN supports Python 3.7.x to 3.14.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 scipy requests absl-py --user
    

    The preceding command installs the dependency of the latest version. 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 7. Then, run the installation command.

Installing Toolkit

Before installing the Toolkit, make sure the installation directory has more than 10 GB of free space. If not, clear some space or choose another 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.1.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 (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, transformer, and ras), 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) workloads.

Table 1 Installing ops

Product Type

Architecture

Installation Command

Ascend 950 products

aarch

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

x86_64

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

Atlas A3 products

aarch

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

x86_64

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

Atlas A2 products

aarch

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

x86_64

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

Atlas training products

aarch

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

x86_64

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

Atlas inference products

aarch

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

x86_64

1
2
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%209.1.0/Ascend-cann-310p-ops_9.1.0_linux-x86_64.run
bash ./Ascend-cann-310p-ops_9.1.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.1.0/Ascend-cann-310b-ops_9.1.0_linux-aarch64.run
bash ./Ascend-cann-310b-ops_9.1.0_linux-aarch64.run --install

x86_64

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