Installing CANN (Non-Ascend Device)
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. Click here. In the Select Resource area on the left, filter the matching software packages and obtain the development kit package Ascend-cann-toolkit_<version>_linux-<arch>.run and operator package Ascend-cann-<chip_type>-ops_<version>_linux-<arch>.run.
- The available space of the kit installation directory is greater than 10 GB. If the space is insufficient, clear the space or change the installation directory.
Dependency Installation
You can install a dependency as the root user or a non-root user (the non-root user must be the same as the installation user of the CANN software package). If you install a dependency as a non-root user, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks may exist.
Perform the following operations to install the dependencies of the latest version or a specified version. For details about the requirements for the Python third-party library and glibc version, see Running Dependencies.
- Install the required dependencies.Debian/Ubuntu/veLinux:
1sudo apt-get install -y gcc g++ python3 python3-pip
openEuler, CentOS, Kylin, BCLinux, 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. For details, 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>=1.19.2,<2.0' decorator sympy cffi pyyaml pathlib2 psutil protobuf==3.20.0 scipy requests absl-py --user
Executing the preceding command will install the dependency of the latest version or a specified version. Third-party Python libraries, such as NumPy, must be used matching the Python version. If an error is reported, see Running Dependencies to check the version requirements.
If 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 the Toolkit
- Ensure that the available space of the installation directory is greater than 10 GB. If this requirement is not met, clear the space or change the installation directory.
- Both Toolkit and ops need to be installed.
- 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_8.5.0_linux-aarch64.run --install
If you do not specify an installation path, the software is installed in the default path. The default installation paths are as follows: 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 after installation as a non-root user as an example. Run the following command based on the actual path of set_env.sh:
# Configure environment variables when installing the Toolkit package. 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 commands to the environment variable configuration file (for example, the .bashrc file) as required.
ops Installation
The CANN operator package optimizes high-performance computing by integrating a comprehensive suite of libraries, including the basic operator framework, specialized libraries for Math, NN, CV, and Transformer, as well as the TBE operator, HCCL set communication library, HIXL unilateral communication library, and DVPP library. This package provides both dynamic and static library files for single-operator API execution (such as aclnn), alongside the source operator source code and kernel binary files. By bundling these diverse assets, CANN significantly enhances overall running capability and execution efficiency in intensive computing scenarios.
Before installing the ops operator package, install Toolkit of the matching version in the same path. Currently, the ops operator packages of multiple chips cannot be installed in the same path. You can install Toolkit and ops of different chips in different paths to meet the development and deployment requirements in a multi-chip environment.
Product Type |
Architecture |
Installation Command |
||
|---|---|---|---|---|
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 series |
aarch |
|
||
x86_64 |
|