Running the Installation Command
Notes
- For batch installation, start from 3 after completing related configurations based on Configuring Batch Installation.
- If the obtained driver and firmware packages is an Ascend-hdk package (for example, Ascend-hdk-*-npu_*- {arch}.zip), you do not need to set the cus_npu_info parameter. If not, for the Atlas 300I Pro, Atlas 300V Pro, Atlas 300V, Atlas 300T (model 9000), and Atlas 300T Pro, you must configure cus_npu_info in inventory_file in advance when installing the driver and firmware. For the aforementioned products, set cus_npu_info to 300i-pro, 300v-pro, 300v, 300t, and 300t-pro, respectively. The following is an example:
[ascend] localhost ansible_connection='local' cus_npu_info='300i-pro'
Procedure
- Log in to the target device as the installation user of the software package.
- Upload the entire ascend-deployer directory to the home directory on the target device (for example, $HOME). Skip this step if you use the download function of ascend-deployer on the target device.
- To use the offline deployment tool as a non-root user, you must have the operation permission on the ascend-deployer directory.
- If the installation is performed as the root user and other users need to use the Python installed by the root user, set umask to 022 in advance. Before the setting, ensure that the umask permission meets the security requirements of your organization.
- (Optional) When installing the driver and CANN software package as the root user, you can specify the running user, user group (HwHiAiUser by default. For details, see Preparing Installation and Running Users.), and installation paths (/usr/local/Ascend by default) for the CANN and toolbox software packages. To specify the information, modify the ascend-deployer/inventory_file file. (The following parameters are valid only when the installation is performed by the root user.) The file content is as follows:If the global configuration files /etc/Ascend/ascend_cann_install.info and /etc/Ascend/ascend_toolbox_install.info exist in the installation environment, the install_path parameter is invalid. Use the installation paths specified in the global configuration files.
[ascend:vars] user=HwHiAiUser group=HwHiAiUser install_path=/usr/local/Ascend
The installation paths of NPU and edge components (AtlasEdge and HA) cannot be specified. The default installation path of NPU is /usr/local/Ascend, and that of edge components (AtlasEdge and HA) is /usr/local.
- Go to the ascend-deployer directory and run the installation script. (The installation user must have the execute permission on the install.sh script.) You can select the installation mode (scenario-specific installation or software-specific installation) based on the site requirements.If you use pip to install ascend-deployer on the local target device, run the ascend-deployer command in any path on the local target device to install ascend-deployer. The difference between using pip and installation script is that ./install.sh in the following command can be replaced with ascend-deployer, for example, ascend-deployer --install-scene=auto.
- Scenario-specific installation (Only for the root user)
Docker is automatically installed in all scenarios to facilitate container deployment. During the installation, the corresponding Docker group is created. Before installing the dependency, check whether Docker has been installed in the system. If Docker has been installed, uninstall it and then install the system dependency.
./install.sh --install-scene=<scene_name>
ascend-deployer provides several basic installation scenarios. For details, see Optional Installation Scenarios. Example command:
./install.sh --install-scene=auto // Automatic installation of all software packages that can be found
- Software-specific installationThe root user can install all the software downloaded using ascend-deployer tool. The non-root user can only install the software listed in Table 1. Install sys_pkg (system component) and NPU (driver and firmware, for Ascend devices) as the root user, and then install the software listed in Table 1 as the non-root user.
Table 1 Software list Software
Description
Python, GCC
Python 3.x.x and GCC 7.3.0 are installed in the $HOME/.local/ directory.
Framework
It contains TensorFlow, PyTorch, and MindSpore.
CANN software
It includes NNAE, NNRT, TFPlugin, Toolkit, and kernels that are installed in the $HOME/Ascend directory.
toolbox
- It is installed in the $HOME/Ascend directory.
- If the toolbox of a version earlier than MindX DL 3.0.0 is installed by a non-root user, Ascend Docker Runtime will not be installed. If you need to use Ascend Docker Runtime, install the toolbox as the root user.
MindStudio
It is installed in the $HOME directory.
If a non-root user needs to install MindStudio, install MindStudio as the root user (some dependencies need to be installed by the root user) and then install MindStudio as the non-root user.
./install.sh --install=<package_name_1>,<package_name_2>
You can run the ./install.sh --help command to view the options of <package_name_x>. Example commands:
./install.sh --install=sys_pkg,python,npu // Install system components, Python 3.7.5, drivers, and firmware. ./install.sh --install=toolkit // Install Toolkit. ./install.sh --install=tfplugin // Install TFPlugin. ./install.sh --install=tensorflow // Install TensorFlow. ./install.sh --install=ief // Install the IEF agent. ./install.sh --install=mindstudio // Install MindStudio.
After the IEF agent has been installed, log in to the IEF console and choose Edge Resources > Edge Nodes in the navigation pane to view the status of managed edge nodes in the edge node list. If the node status is Running, the management is successful.
- Install the software packages in the sequence of sys_pkg > Python > NPU > CANN (including the Toolkit and NNRT) > AI framework (TensorFlow, MindSpore, or PyTorch). During the installation, ensure that the CANN package in the resources directory matches the NPU version.
- During the installation of TensorFlow, if --tensorflow_version is set to 1.15.0 or 2.6.5, the TensorFlow of a required version is automatically installed. If the version is not specified, the TensorFlow 1.15.0 is installed by default.
- TensorFlow 2.6.5 has vulnerabilities. For details about how to handle the vulnerabilities, see the Vulnerabilities and Fixing Solutions.
- Before installing kernels, you need to install NNAE or Toolkit. During the installation, you need to specify the --kernels_type parameter.
- If the ascend-deployer tool cannot run due to environment variables, you need to configure ASCENDPATH as required.
- If the GCC version is earlier than 7.3.0, ascend-deployer will be automatically installed, which takes a long time. You can manually upgrade GCC and configure environment variables in advance. After GCC 7.3.0 is installed, you need to create a soft link before using it. For example, if GCC 7.3.0 is installed by the root user, run the ln -sf /usr/local/gcc7.3.0/bin/gcc /usr/bin/gcc command.
- The device health status is obtained before the NPU is installed. If the device is faulty, the installation stops.
- After the NPU is installed, determine whether to reboot the system based on the system prompts. If you need to reboot the system, run the reboot command.
- Some components involve runtime dependencies. For example, PyTorch requires Toolkit or NNAE to provide runtime dependencies, TensorFlow depends on the runtime dependencies provided by TFPlugin + Toolkit or TFPlugin + NNAE when invoking NPU resources, and MindSpore requires the driver and Toolkit to provide runtime dependencies.
- Ensure that Python has been installed before installing Python libraries, such as TensorFlow, MindSpore, and PyTorch.
- During the installation, run the date -s command to calibrate the time in the operating environment to the correct UTC time.
- If --install= is set to mindspore, the MindSpore package downloaded in Downloading Packages will be installed. You can also install it by following the instructions on the MindSpore official website. Pay attention to the version mapping between MindSpore, drivers, firmware, and CANN software.
- Scenario-specific installation (Only for the root user)
- Run the following command to check whether the specified component works properly:
./install.sh --test=<target>
You can run the ./install.sh --help command to view the options of <target>. Example command:
./install.sh --test=toolbox // Test whether the toolbox is normal.