Installing CANN (Online Installation Using apt-get)
This section describes how to quickly install the CANN software using apt-get.
Installing Dependencies
1 | sudo apt-get 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.
Configuring the Ascend Repository
Configure the Ascend repository. Otherwise, the installation will fail.
wget https://ascend.devcloud.huaweicloud.com/cann/debian/cann-keyring_1.0.0_all.deb sudo dpkg -i cann-keyring_1.0.0_all.deb sudo apt-get update
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.
- Run the installation command:
1sudo apt-get install ascend-cann-toolkit=9.0.0
For online installation using apt-get, software can only be installed in the default directory path /usr/local/Ascend.
- Configure environment variables.
1source /usr/local/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.
Product Type |
Installation Command |
||
|---|---|---|---|
Atlas 350 Accelerator Card |
|
||
Atlas A3 series |
|
||
Atlas A2 series |
|
||
Atlas training series |
|
||
Atlas inference series |
|
||
Atlas 200I/500 A2 inference products |
|
(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.
- Run the installation command:
1sudo apt-get install ascend-cann-nnal=9.0.0
For online installation using apt-get, software can only be installed in the default directory path /usr/local/Ascend.
- Configure environment variables.
- ATB:
1source /usr/local/Ascend/nnal/atb/set_env.sh
- SiP:
1source /usr/local/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.
- ATB: