Installing CANN (Online Installation Using Conda)
This section describes how to quickly install the CANN software using Conda. Click here to check the supported CANN software packages and versions.
Prerequisites
Ensure that the Conda virtual environment installation directory and all its parent directories are granted 755 permissions.
Configuring the Ascend Repository
1 | conda config --add channels https://repo.huaweicloud.com/ascend/repos/conda/ |
Installing the Toolkit
Install the CANN Toolkit for training, inference, and debugging. It supports training and inference services, model conversion, and developing and building operators, applications, and models.
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.
- Run the installation command:
1conda install ascend::cann-toolkit==9.2.0
Running the preceding command installs the software package of version 9.2.0. To install a software package of another version, run the corresponding command by referring to Software Package List.
The default installation path of the software package is the Ascend directory in the Conda virtual environment, for example, /home/miniconda3/Ascend.
- Configure environment variables. The following uses /home/miniconda3/Ascend as an example. Replace it with the actual path.
1source /home/miniconda3/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.
- Verify 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.
1conda list | grep cann
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 APIs), operator source code, and kernel binaries, ultimately optimizing overall execution performance in high-performance computing (HPC) workloads.
Before installing ops, ensure that the Toolkit of a compatible version has been installed in the same path. Select the ops software package corresponding to the running device. Installing ops for multiple chips in the same path is not supported. To work with different chips, install the Toolkit and the related ops in separate paths for multi-chip development and deployment.
Product Type |
Installation Command |
||
|---|---|---|---|
Ascend 950PR&950DT products |
|
||
Atlas A3 products |
|
||
Atlas A2 products |
|
||
Atlas training products |
|
||
Atlas inference products |
|
||
Atlas 200I/500 A2 inference products |
|
Running the preceding commands installs the software package of version 9.2.0. To install a software package of another version, replace the version number in the package name and click here to view the corresponding command.
(Optional) Installing the NNAL
The NNAL comprises the Ascend Transformer Boost (ATB) and AscendSiPBoost (SiP) libraries.
Before installing the ATB, install Toolkit of the matching version and configure environment variables.
- Run the installation command:
1conda install ascend::cann-nnal==9.2.0
Running the preceding command installs the software package of version 9.2.0. To install a software package of another version, run the corresponding command by referring to Software Package List.
The default installation path of the software package is the Ascend directory in the Conda virtual environment, for example, /home/miniconda3/Ascend.
- Configure environment variables. The following uses /home/miniconda3/Ascend as an example. Replace it with the actual path.
- ATB:
1source /home/miniconda3/Ascend/nnal/atb/set_env.sh
- SiP:
1source /home/miniconda3/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:
- Verify 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.
1conda list | grep cann