NPU Driver and Firmware Installation
In PM and container deployment scenarios, you only need to install the NPU driver and firmware on PMs.
In VM deployment scenarios, you need to install the NPU driver and firmware on both PMs and VMs.
Installation Description
- Initial installation: In scenarios where no driver is installed on a hardware device before delivery, or the installed driver and firmware on the hardware device have been uninstalled, you need to install the driver and then firmware.
- Overwrite installation: In scenarios where the driver and firmware have been installed on a hardware device and you need to install them again, install the firmware and then driver.
Driver and Firmware Installation
- Log in to the installation environment as the root user and upload the driver and firmware packages to any directory on the server, for example, /home.
- Install the dependencies required by the driver.
- Run the following command to check whether the source is available.
If an error is reported during command execution or the waiting time is too long, check whether the network is connected or modify the /etc/apt/sources.list file to an available source. Take Huawei mirrored source as an example, for details, see Huawei Open-Source Mirror Site.
openEuler series (including openEuler, CentOS, Kylin, BCLinux, BC-Linux-for-Euler, UOS20 1050e, UOS20 1020e, UOSV20, AntOS, CTyunOS, CULinux, and Tlinux, Euler):1yum makecacheIf an error is reported during command execution or the waiting time is too long, check whether the network is connected or modify the /etc/yum.repos.d/xxxx.repo file to an available source. Take Huawei mirrored source as an example, for details, see Huawei Open-Source Mirror Site.
- Run the following command to install dependencies.
openEuler series:
1yum install -y make dkms gcc kernel-headers-$(uname -r) kernel-devel-$(uname -r)
If an error is reported or the dependency does not exist, see Installing Dependencies Required for Compiling Driver Source Code.
- Run the following command to check whether the source is available.
- Go to the directory where the software package is stored and run the following commands to add the execute permission and verify the consistency and integrity of the software package:
1 2 3 4
chmod +x Ascend-hdk-<chip_type>-npu-driver_<version>_linux-<arch>.run chmod +x Ascend-hdk-<chip_type>-npu-firmware_<version>.run ./Ascend-hdk-<chip_type>-npu-driver_<version>_linux-<arch>.run --check ./Ascend-hdk-<chip_type>-npu-firmware_<version>.run --check
If the following information is displayed, the software package verification is successful:
1Verifying archive integrity... 100% SHA256 checksums are OK. All good.
- Install the driver and firmware. The default installation path is /usr/local/Ascend.
- Run the following command to install the driver:
1./Ascend-hdk-<chip_type>-npu-driver_<version>_linux-<arch>.run --full --install-for-all
If the following information is displayed, the driver is successfully installed:1Driver package installed successfully!
If some Linux tools are missing after you run the preceding commands, install them based on the command output. If an error such as DKMS and lack of dependency is reported, rectify the fault by referring to An Error Is Reported During Driver Installation.
- Run the following commands to install the firmware.
1./Ascend-hdk-<chip_type>-npu-firmware_<version>.run --fullIf the following information is displayed, the firmware is successfully installed:
1Firmware package installed successfully! Reboot now or after driver installation for the installation/upgrade to take effect
If the driver and firmware running user and user group are not HwHiAiUser, you must specify the running user and user group when installing the driver and firmware packages. The following is an example command:
1./Ascend-hdk-<chip_type>-npu-driver_<version>_linux-<arch>.run --full --install-username=<username> --install-usergroup=<usergroup>
- Run the following command to install the driver:
- Determine whether to restart the system as prompted. If the system needs to be restarted, run the following command. Otherwise, skip this step.
1reboot
- Run the following command to check whether the driver is successfully loaded:
1npu-smi infoIf the driver information is displayed, the driver is successfully loaded. Otherwise, the loading fails. In this case, visit Support to seek help or submit a technical service ticket.
