Installing the NPU Driver (Online Installation Using apt-get)

Preparing Users

This section describes how to create an installation and running user. If the user already exists, skip this section.

Table 1 User types

Component

Installation User

Running User

NPU driver

root

  • When the driver is installed, the running user and user group are specified as HwHiAiUser by default. Therefore, you need to create the running user and user group of HwHiAiUser before installing the software package.
  • If the created user and user group are not HwHiAiUser (including root), you must specify the running user when installing the driver.

The following users are used in the example steps:

  • The root user is used to install the driver.
  • The running user is the non-root user HwHiAiUser (default running user of the driver).
Run the following command to create the HwHiAiUser user and user group:
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 and Configuring the Ascend Repository

  1. Check whether the source is available.
    1
    apt-get update
    

    If 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).

  2. Install dependencies.
    1
    apt-get install -y make dkms gcc linux-headers-$(uname -r)
    
  3. 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 NPU Driver

Table 2 Installing the driver

Product Type

Installation Command

Atlas 350 Accelerator Card

1
apt-get install atlas-a5-hdk-npu-driver=25.7.rc1

Atlas A3 series

1
apt-get install atlas-a3-hdk-npu-driver=26.0.rc1

Atlas A2 series

1
apt-get install ascend910b-driver=26.0.rc1

Atlas training series

1
apt-get install ascend910-driver=26.0.rc1

Atlas inference series

1
apt-get install ascend310p-driver=26.0.rc1
After the installation is complete, determine whether to reboot the system based on the displayed information. If you need to reboot the system, run the reboot command. After the reboot, run the following command to check whether the driver is successfully loaded:
1
npu-smi info

If the driver information is displayed, the driver is successfully loaded. Otherwise, the loading fails. Visit the Support website to seek help in the forum or submit a technical service ticket.