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.1.0
By default, the software package of the latest version is installed. Click here to check and install a software package of another version by running the corresponding command.
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-class 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 950 products |
|
||
Atlas A3 products |
|
||
Atlas A2 products |
|
||
Atlas training products |
|
||
Atlas inference products |
|
||
Atlas 200I/500 A2 inference products |
|
By default, the preceding commands install the software packages of the latest version. To install a specified version, add the version number to the end of the software package name. 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 the Toolkit of the matching version and configure environment variables.
- Run the installation command:
1conda install ascend::cann-nnal==9.1.0
By default, the software package of the latest version is installed. Click here to check and install a software package of another version by running the corresponding command.
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