Installing CANN
In both PM and containerized deployment scenarios, you only need to install the NPU driver on the PM.
In VM deployment scenarios, 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, and 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 Open-Source Mirror Site).
openEuler, CentOS, Kylin, BC-Linux, UOS, AntOS, CTyunOS, CULinux, Tlinux, MTOS, vesselOS: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 Open-Source Mirror Site).
- Install dependencies.Debian, Ubuntu, and veLinux:
1apt-get install -y make dkms gcc linux-headers-$(uname -r) python3 python3-pip
openEuler, CentOS, Kylin, BC-Linux, UOS, AntOS, CTyunOS, CULinux, Tlinux, MTOS, vesselOS: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 the installation, ensure that the available space of the installation directory is greater than 10 GB. Otherwise, clear the space or change the installation 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 the 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 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.
The installation command supports parameters such as --install-path=<path>. For details, see Parameter Description.
Product Type |
Architecture |
Installation Command |
||
|---|---|---|---|---|
Atlas 350 Accelerator Card |
aarch |
|
||
x86_64 |
|
|||
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 products |
aarch |
|
||
x86_64 |
|
(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.
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.