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.
- Install dependencies.Debian, Ubuntu, and veLinux:
1sudo apt-get install -y gcc g++ python3 python3-pip
openEuler, CentOS, Kylin, BC-Linux, UOS V20, AntOS, AliOS, CTyunOS, CULinux, Tlinux, MTOS, vesselOS:1sudo 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.
- Install a third-party Python library. (If you install it as the root user, delete --user from the command.)
1pip3 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.
- 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.
- Install the software package. (The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description.)
1bash ./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.
- 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_PATHThe 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.
- 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.
- Go to the directory where the software package installation information file is stored.
cd ${HOME}/Ascend/cann/<arch>-linuxIn 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).
- Run the following command to view the version information provided in the version field:
cat ascend_toolkit_install.info
- Go to the directory where the software package installation information file is stored.
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.
Product Type |
Architecture |
Installation Command |
||
|---|---|---|---|---|
Atlas 350 Accelerator Card |
aarch |
|
||
x86_64 |
|
|||
Atlas A3 series |
aarch |
|
||
x86_64 |
|
|||
Atlas A2 series |
aarch |
|
||
x86_64 |
|
|||
Atlas training series |
aarch |
|
||
x86_64 |
|
|||
Atlas inference series |
aarch |
|
||
x86_64 |
|
|||
Atlas 200I/500 A2 inference products |
aarch |
|
||
x86_64 |
|