Installing CANN
For both PM and containerized deployments, you only need to install the NPU driver on the PM.
For VM deployments, refer to this section to install the NPU driver on both the PM and the VM.
Preparing Users
The following describes how to create installation and running users. If the users already exist, skip this section.
Installation User |
Running User |
|---|---|
root |
|
The users used in the example steps in this document are as follows:
- Installation user: root (If you install the combined package as a non-root user, only the Toolkit package can be installed.)
- Running user: Non-root user HwHiAiUser (default running user for the driver and firmware)
1 2 | groupadd HwHiAiUser useradd -g HwHiAiUser -d /home/HwHiAiUser -m HwHiAiUser -s /bin/bash |
For the usage and configuration requirements of the default user HwHiAiUser, see Atlas Hardware Product Account List. You can create other non-root users on your own.
Installing Dependencies
- Check whether the source is available.Debian, Ubuntu, veLinux:
1apt-get updateIf the system reports an error or the waiting time becomes excessive, check whether the network is connected or modify the /etc/apt/sources.list file to configure an available repository. (For example, to configure the Huawei mirrored repository, you can see the configuration method of the mirrored repository in the Huawei Mirrors).
:1yum makecacheIf the system reports an error or the waiting time becomes excessive, check whether the network is connected or modify the /etc/yum.repos.d/xxxx.repo file to configure an available repository. (For example, to configure the Huawei mirrored repository, you can see the configuration method of the mirrored repository in the Huawei Mirrors).
- Run the following command to install dependencies.Debian, Ubuntu, veLinux:
1apt-get install -y make dkms gcc linux-headers-$(uname -r) python3 python3-pip
:1yum install -y make dkms gcc kernel-headers-$(uname -r) kernel-devel-$(uname -r) python3 python3-pip
If an error is reported or any dependency does not exist, rectify the fault by referring to Installing Dependencies Required for Compiling Driver Source Code. If the Python 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.
Installing the Combined Driver & Toolkit Package
The combined driver & Toolkit package supports one-click full installation or installation using the --whitelist parameter.
- Before installation, make sure the installation directory has more than 10 GB of free space. If not, clear some space or choose another directory.
- Both Toolkit and ops must be installed.
Architecture |
Installation Command |
||
|---|---|---|---|
aarch |
|
||
x86_64 |
|
The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description. 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.
1 | source /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 ops
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 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.
The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description.
Product Type |
Architecture |
Installation Command |
||
|---|---|---|---|---|
Ascend 950 products |
aarch |
|
||
x86_64 |
|
|||
Atlas A3 products |
aarch |
|
||
x86_64 |
|
|||
Atlas A2 products |
aarch |
|
||
x86_64 |
|
|||
Atlas training products |
aarch |
|
||
x86_64 |
|
|||
Atlas inference products |
aarch |
|
||
x86_64 |
|
|||
Atlas 200I/500 A2 inference products |
aarch |
|
||
x86_64 |
|
(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.
Architecture |
Installation Command |
||
|---|---|---|---|
aarch |
|
||
x86_64 |
|
The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description. 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.
- 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.