Ascend NPU Driver & Firmware Auto-Install
This skill provides end-to-end automated NPU driver and firmware installation capabilities, covering the entire process from installation package verification to driver validity verification. No manual step-by-step operations are required, as it strictly follows Ascend's official installation specifications and is compatible with mainstream Linux distributions.
Core Capabilities
- Automatically extract driver/firmware packages from the specified folder based on official regular expressions, with mandatory verification of package quantity uniqueness—only 1 driver package + 1 firmware package is allowed;
- Grant executable permissions to installation packages on demand. If there are no permissions, automatically execute and verify the permission assignment result a second time to avoid installation failures caused by permission issues;
- Dual package verification via Python+Shell, which verifies package format, path, and file validity in advance to block invalid installation packages;
- Pre-check system dependencies before installation
- Strictly follow Ascend's official driver-first then firmware installation order. After installation, an interactive restart option is provided along with the official native command to verify driver status.
Preparations
- This version does not require kernel verification; you can directly proceed with deployment
1. Script File Preparation
Place the core scripts
(Python package verification) and
(main Shell installation script) in the
same directory. It is recommended to name the root directory of this skill
ascend-npu-driver-install
, which should be consistent with the name field.
2. Installation Package Requirements
The specified installation package folder should only contain 1 driver .run package and 1 firmware .run package that comply with Ascend's official naming format, with no other irrelevant files. The package name format must strictly follow:
- Driver package:
Ascend-hdk-<chip_type>-npu-driver_<version>_linux-<arch>.run
- Firmware package:
Ascend-hdk-<chip_type>-npu-firmware_<version>.run
3. System Environment Requirements
- Permissions: Must have ROOT administrator privileges, which can be switched via the command;
- System: Compatible with CentOS/RHEL, Ubuntu/Debian series Linux distributions, supporting yum/apt package managers;
- Basic Environment: Python3 is pre-installed on the system. For offline environments without network access, manually install in advance the core dependencies gcc, make, and dkms;
- Hardware: Compatible with Ascend 310P, Ascend 910A, Ascend 910B series NPU chips.
Quick Usage Steps
Restrictions
- The installation package only supports parameters --full, --install, --install-for-all
Step 1: Add Executable Permissions to Scripts
Navigate to the root directory of the skill where the scripts are located, and execute the following command to grant executable permissions to the two core scripts:
chmod +x ./scripts/install_npu_driver.sh ./scripts/check_package.py
Step 2: Execute the Automated Installation Script
Command Format:
./scripts/install_npu_driver.sh <full path of NPU package folder> <driver running user>
Recommended Example (install using the root user):
bash
./scripts/install_npu_driver.sh /opt/ascend/npu_pkgs root
Step 3: System Restart (Mandatory for Driver to Take Effect)
After installation is complete, the script will display an interactive restart prompt. A system restart is mandatory for the NPU driver and firmware to take effect; without a restart, the driver cannot be loaded:
- Enter : The system restarts immediately to complete the NPU driver kernel loading;
- Enter : Skip the immediate restart; you need to manually execute the command later to restart the system.
Step 4: Verify Installation Result
After the system restarts, execute Ascend's official native command to verify the NPU driver loading status:
Installation Success Indicator: The command output includes the NPU chip model, Driver Version, Firmware Version, with no error messages.
Core Scripts Description
check_package.py (Python Package Verification Script)
Automatically called by the main Shell script, no manual execution required. It mainly completes the following package verification tasks:
Check if the folder containing installation packages exists;
Match driver/firmware packages using Ascend's official regular expressions and verify the uniqueness of package quantity;
Verify that the packages are valid files (not directories);
Detect the executable permissions of the packages and issue a warning if there are no permissions;
Output the full absolute paths of the verified driver/firmware packages for the Shell script to call.
install_npu_driver.sh (Main Shell Installation Script)
The core execution script of the skill, which runs automatically according to a fixed process without manual intervention throughout. The execution process is: ROOT/Python3 environment check → regular expression-based package path extraction → on-demand assignment of package executable permissions → secondary Python package verification → automatic creation of running user/group → pre-check and installation of system dependencies → NPU driver installation → NPU firmware installation → interactive restart confirmation → native npu-smi verification",