Installation Using the Repacked Driver Package
This section applies only to NPU 20.1.X or later.
Installing Dependencies
GCC and Kernel Source Code
Check whether the GCC and kernel source code corresponding to the target OS and kernel version exist. For details, see Installing Dependencies.
Makeself v2.4.0
Download the open-source tool Makeself v2.4.0 from https://github.com/megastep/makeself or https://github.com/megastep/makeself/releases/tag/release-2.4.0.
Pigz
- Ubuntu
dpkg-query -s pigz
- CentOS
rpm -qa |grep pigz
If Pigz has not been installed, use the software manager to install it. For example:
- Ubuntu
apt install pigz
- CentOS
yum install pigz
Repacking the Driver Package
Build a driver package that meets the requirements of the target OS version, kernel version, and GCC version.
Prerequisites
Before compilation, dependencies have been installed. For details, see Installing Dependencies.
Procedure
- Obtain the source driver package and repacking tool package. For details, see Obtaining Software Packages.
- Upload the source driver package, repacking tool package, and open-source software package makeself-release-2.4.0.zip to the same directory in the operating environment, for example, /opt.
- Run the following command to go to the directory where the software packages in 2 are stored, for example, /opt:
cd /opt
- Run the following command to add the execution permission for the source driver package:
chmod +x *.run
Example: chmod +x A300-3000-npu-driver_20.1.0_linux-aarch64.run
- Run the following command to decompress the source driver package to a specified directory:
./*.run --noexec --extract=Specified directory
Example: ./A300-3000-npu-driver_20.1.0_linux-aarch64.run --noexec --extract=./tmp
- Run the following command to decompress the repacking tool package to the current directory:
tar -xzvf Name of the repacking tool package --strip-components 1
Example: tar -xzvf A300-3000-npu-driver-repack-tools_20.1.0.tar.gz --strip-components 1
- Run the following command to decompress the software package makeself-release-2.4.0.zip:
unzip makeself-release-2.4.0.zip
- Run the following command to build a new driver package:
bash build.sh makeself.shPath Package decompression path Output package name
Example: bash build.sh ./makeself-release-2.4.0/makeself.sh tmp/ A300-3000-npu-driver-repack.run
- Install the driver. For details, see Installing the Driver (*.run).
Installing the Driver (*.run)
The .run installation packages of the Atlas 300I inference card (model 3000) are host installation packages. You need to download and decompress them on a host OS. The following describes how to install the packages on a host. For details about how to install the packages in a container, see Installation in a Container.
This section uses the A300-3000-npu-driver-repack.run package as an example to describe how to install the .run driver package. Replace the package name with the actual one.
Precautions
- The .run installation packages support one-click installation. You can select parameters as required to complete the installation. For details, see Parameter Description.
- If a driver package whose version is NPU 1.X.X is installed, uninstall it before installing the driver package of NPU 20.X.X or later.
- After the .run installation package is used, do not manually set the environment variable export LD_LIBRARY_PATH to the .so file of the original driver package. Otherwise, the tool in the .run installation package may connect to the dynamic library of the earlier version. The third-party library file path and non-run installation package release library file path are not affected.
- During the installation or upgrade of a software package, do not reset or power off the host or device. Otherwise, device boot or upgrade fails. If this problem occurs, resolve it by referring to Failed to Start the Device Due to Reset or Power-off.
Procedure
For initial installation, install the driver and then firmware; for overwrite installation or upgrade, install the firmware and then driver. For details about how to install the firmware, see Installing the Firmware (*.run).
To ensure that the driver version, firmware version, and MCU version match each other, upgrade the MCU. For details, see "Upgrading the MCU" in the Atlas 300I Inference Card NPU Driver and Firmware Upgrade Guide (Models 3000, 3010).
- Upload the driver package built in Repacking the Driver Package to any directory (for example, /opt) in Linux.
- Use PuTTY to log in to the OS CLI of the server where the Atlas 300I inference card (model 3000) is located. For details, see Logging In to the CLI Using PuTTY over a Network Port.
- Run the following command to switch to the root user:
su - root
- Run the following command to go to the directory where the software package is stored, for example, /opt:
cd /opt
- Run the following command to check the consistency and integrity of the .run installation package:
./A300-3000-npu-driver-repack.run --check
If the following information is displayed, the driver package verification is successful:Verifying archive integrity... 100% SHA256 checksums are OK. All good.
The SHA256 encryption mode is used for software package verification. If "./A300-3000-npu-driver-repack.run does not contain an embedded MD5 checksum" and "./A300-3000-npu-driver-repack.run does not contain a CRC checksum" are displayed during the verification, the MD5 and CRC encryption modes are not used and can be ignored.
- Run the installation command.
- If you specify an installation path, for example, /test/HiAI/,
run the ./A300-3000-npu-driver-repack.run --full --install-path= /test/HiAI/ command to complete the installation.
- If the installation path is not specified, run the ./A300-3000-npu-driver-repack.run --full command.
- During the driver installation, the dynamic library libdcmi.so and header file dcmi_interface_api.h are copied to the /usr/local/dcmi/ directory.
- For details about how to resolve problems that may occur during the installation of the .run installation package, see FAQs.
- If the created running user is not HwHiAiUser, you need to specify a running user (specified by the --install-username=username --install-usergroup=usergroup parameter) when installing the driver package.
- If an installation path is specified during the driver installation:
- In the scenario where the specified path does not exist, a directory is automatically created during the installation. If there are multiple levels of directories, the directory is automatically created only when the last level of directory does not exist.
- In the scenario where the specified path exists:
- If the owner of all levels of directories in the path is the root user, ensure that the permission on all levels of directories is at least 755.
- If the owner of a level-1 directory in the path is not the root user, change the owner to the root user and ensure that the permission on all levels of directories is 755.
- Default installation path: /usr/local/Ascend
- Installation log path: /var/log/ascend_seclog/ascend_install.log
- Path where the installation path, installation command, and user information of the software package after installation are stored: /etc/ascend_install.info
- If you install the driver using an NPU 20.0.X or NPU 20.1.X driver package as a non-HwHiAiUser user, uninstall it, and then reinstall it as the HwHiAiUser user, error message "/home/HwHiAiUser: Permission denied" may be reported. In this case, ignore the error.
- If an NPU 20.2.X or later software package is used for installation, the system logs on the device are transmitted to the host using the msnpureport tool for viewing. For details about the export operation and the storage path of the exported logs, see "msnpureport Instructions" in the Ascend 310 Black Box Log Reference.
In a container, system logs on the device cannot be viewed and cannot be exported using the msnpureport tool.
- If you specify an installation path, for example, /test/HiAI/,
- If the system displays a message indicating that the installation is successful, the driver is successfully installed. Determine whether to restart the system based on the displayed information. If the system needs to be restarted, perform the following operations. Otherwise, skip this step.
- After the installation is complete, run the reboot command on the host OS to reboot the host or power off and then power on the host.
- After the host is rebooted, the driver and services are automatically installed. The Ascend 310 automatically enters the OS.
- Run the npu-smi info command to check whether the driver is successfully loaded.If information similar to the following is displayed, the driver is successfully loaded. Otherwise, the installation fails. Contact Huawei technical support.
+------------------------------------------------------------------------------+ | npu-smi 20.0.1 Version: 1.73.5.10.050 | +-------------------+-----------------+----------------------------------------+ | NPU Name | Health | Power(W) Temp(C) | | Chip Device | Bus-Id | AICore(%) Memory-Usage(MB) | +===================+=================+========================================+ | 2049 310 | OK | 12.8 50 | | 0 0 | 0000:85:00.0 | 0 2621 / 8192 | +-------------------+-----------------+----------------------------------------+ | 2049 310 | OK | 12.8 51 | | 1 1 | 0000:86:00.0 | 0 2621 / 8192 | +-------------------+-----------------+----------------------------------------+ | 2049 310 | OK | 12.8 52 | | 2 2 | 0000:87:00.0 | 0 2621 / 8192 | +-------------------+-----------------+----------------------------------------+ | 2049 310 | OK | 12.8 55 | | 3 3 | 0000:88:00.0 | 0 2621 / 8192 | +===================+=================+========================================+
In the command output, the field following npu-smi indicates the npu-smi tool version, and the field following Version: indicates the driver version.
Follow-up Procedure
If an NPU 20.2.X or later package is used for installation, skip this step. If an NPU 20.0.X or NPU 20.1.X software package is used for installation, the ADA enables the listening port 22118 by default. To ensure system security, disable this port in a commercial environment.
/usr/local/Ascend/driver is the default installation path for installing the driver (add-ons is installed with the driver) as the root user. The following uses this path as an example to describe the operation procedure. Replace it with the actual path.
When you install the OS as the root user, the HwHiAiUser user is the default process running user in the OS. The following uses the HwHiAiUser user as an example to describe the operation procedure.
Run the su - HwHiAiUser command to switch to the running user, log in to the OS, and open the /home/HwHiAiUser/ide_daemon/ide_daemon.cfg file.
If the value of SOCK_SWITCH is 0, the ADA port is disabled.
If the value of SOCK_SWITCH is 1, the ADA port is enabled. You need to manually change the value of SOCK_SWITCH to 0.
Run the wq! command to save the settings and exit.
- Switch to the /usr/local/Ascend/driver/tools directory and run the following commands in sequence to set environment variables and restart the ada process or run the reboot command to restart the OS.
Set the environment variable.
export LD_LIBRARY_PATH=/usr/local/Ascend/add-ons:$LD_LIBRARY_PATH
Query the ID of the ada process.
ps -ef | grep ada
Stop the ada process.
kill -9 ada process ID
Start the ada process.
If the message "ada is exist, don't start again" is displayed when you run the following command, the system has automatically started the ada process.
/usr/local/Ascend/driver/tools/ada