MindStudio 3.0.2 Installation Guide

Issue 01 Date 2021-08-05

HUAWEI TECHNOLOGIES CO., LTD.

Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd.

Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders.

Notice The purchased products, services and features are stipulated by the contract made between Huawei and the customer. All or part of the products, services and features described in this document may not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information, and recommendations in this document are provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute a warranty of any kind, express or implied.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. i MindStudio Installation Guide Contents

Contents

1 Installation Introduction...... 1 1.1 Basic Information...... 1 1.2 Installation Scheme (Linux)...... 2 1.3 Installation Scheme (Windows)...... 3 2 Quick Installation Guide (Windows)...... 6 2.1 Description and Restrictions...... 6 2.2 Preparing Software Packages...... 7 2.3 Configuration Before Installation...... 7 2.4 Installation Process...... 8 2.5 Configuration after Installation...... 22 3 Quick Installation Guide (Linux)...... 23 3.1 Description and Restrictions...... 23 3.2 Preparing Software Packages...... 24 3.3 Configuration Before Installation...... 24 3.4 Installation Process...... 26 3.5 Configuration after Installation...... 36 4 Manual Installation Guide (Windows)...... 37 4.1 Installation Workflow...... 37 4.2 Obtaining Software Packages...... 38 4.3 Preparing for Installation...... 38 4.4 Installing MindStudio...... 39 5 Manual Installation Guide (Linux)...... 50 5.1 Installation workflow...... 50 5.2 Downloading Required Files...... 51 5.3 MindStudio Package Overview...... 51 5.4 Pre-installation Actions...... 52 5.4.1 Ubuntu 18.04 (x86_64)...... 52 5.4.2 Ubuntu 18.04 (AArch64)...... 55 5.4.3 EulerOS 2.8 (AArch64)...... 57 5.4.4 openEuler 20.03 (x86_64)...... 60 5.4.5 openEuler 20.03 (AArch64)...... 62 5.4.6 CentOS 7.6/8.2 (x86_64)...... 64

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. ii MindStudio Installation Guide Contents

5.4.7 CentOS 7.6/8.2 (AArch64)...... 66 5.4.8 Kylin OS V10 SP1 (AArch64)...... 69 5.4.9 NeoKylin OS 7.6-AArch64...... 71 5.5 Installing MindStudio...... 73 5.6 Configuring the Compilation Environment...... 80 6 Installing Dependencies...... 85 6.1 Ubuntu18.04 (x86_64)...... 85 6.2 Ubuntu18.04 (AArch64)...... 89 6.3 EulerOS 2.8 (AArch64)...... 94 6.4 openEuler 20.03 (x86_64)...... 98 6.5 openEuler20.03 (AArch64)...... 100 6.6 CentOS 7.6/8.2 (x86_64)...... 103 6.7 CentOS 7.6/8.2 (AArch64)...... 107 6.8 Kylin OS V10 SP1 (AArch64)...... 112 6.9 NeoKylin OS 7.6 (AArch64)...... 116 6.10 Windows 10...... 121 7 FAQs...... 134 7.1 Configuring a System Network Proxy...... 134 7.2 What Do I Do If the GUI Cannot Be Displayed When MindStudio Is Started?...... 135 7.3 How Do I Solve the Problem that Chinese Characters Are Displayed as Garbled Characters and the GUI Is Incompletely Displayed or Is Not Well-Organized?...... 136 7.4 What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio...... 137 7.5 How Do I Get Help and Provide Suggestions?...... 140 7.6 What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?...... 141 7.7 Python.h Is Not Installed or Cannot Be Found During Dependency Installation...... 142

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. iii MindStudio Installation Guide 1 Installation Introduction

1 Installation Introduction

1.1 Basic Information 1.2 Installation Scheme (Linux) 1.3 Installation Scheme (Windows)

1.1 Basic Information

Software Packages ● MindStudio is located in the development environment where you can manage projects, write and build code, and convert models. The built applications are executed on the operating environment powered by the Ascend AI Processor. To run a developed project on the Ascend AI Processor, connect MindStudio to the operating environment. Project execution, log diagnosis, and performance profiling require the collaboration between the host and the background service modules of the device powered by the Ascend AI Processor. ● Ascend-CANN-Toolkit: a toolkit for developers to efficiently develop models, algorithms, and applications based on the Ascend AI Processor. The developer toolkit can be installed only on the Linux server. After the developer toolkit is installed, developers can use the MindStudio development tool to perform quick development.

Application Scenarios ● Pure development scenario (separate deployment): Install MindStudio and Ascend-CANN-Toolkit on a server without Ascend AI Processors installed, and use the server as the development environment for code development and compilation, for example, ATC-based model conversion and pure code development for operators and inference applications. For details about how to install and deploy the pure development environment, see Quick Installation Guide (Linux) or Quick Installation Guide (Windows). If you want to run applications or perform model training, you need to remotely connect the server for pure development to the operating environment server with Ascend AI Processors installed. For details about how to install and

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 1 MindStudio Installation Guide 1 Installation Introduction

deploy the operating environment server with Ascend AI Processors installed, see the CANN Software Installation Guide (msInstaller). ● Development and operating scenario (co-deployment): Install the MindStudio, Ascend-CANN-Toolkit, npu-firmware, npu-driver, and AI framework on a server with Ascend AI Processors installed. The server can be used as the development environment and operating environment at the same time for you to run applications or perform training. For details about how to deploy the development and operating environments with Ascend AI Processors installed, see the CANN Software Installation Guide (msInstaller).

Restrictions

All installation operations in this document are used to guide the deployment of a pure development environment. For details about the installation and deployment involving Ascend AI Processors, see "Installation Scheme" in the CANN Software Installation Guide (msInstaller). Select a proper installation guide based on the hardware type.

1.2 Installation Scheme (Linux)

MindStudio and Ascend-CANN-Toolkit can be installed on a Linux server. You can use the GNOME Terminal provided by the Linux native desktop to install them. If you are using a Windows server, you can log in to a Linux server in SSH mode to perform the installation. Since MindStudio is a GUI-based integrated development environment (IDE), to install it using the later method, you need to prepare an SSH terminal (for example, MobaXterm v20.2 or later) integrated with the X server.

NO TE

The Linux server where MindStudio and Ascend-CANN-Toolkit are installed is a pure development environment, as shown in Figure 1-1. For details about how to install and deploy the pure development environment, see Quick Installation Guide (Linux). If you need an operating environment, select a scenario shown in Figure 1-1 or Figure 1-2 and deploy the Linux server with Ascend AI Processors installed by referring to the CANN Software Installation Guide (msInstaller).

Figure 1-1 Linux-based separate deployment

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 2 MindStudio Installation Guide 1 Installation Introduction

Figure 1-2 Linux-based co-deployment

1.3 Installation Scheme (Windows) MindStudio can be independently installed on Windows. Before the MindStudio installation, you need to install and deploy Ascend-CANN-Toolkit on a Linux server, and then install MindStudio on Windows. After the installation is complete, configure the remote connection mode to establish a connection between the Windows server where MindStudio is located and the Linux server where Ascend- CANN-Toolkit is located to implement full-pipeline development.

NO TE

● After the Windows server where MindStudio has been installed is connected to the Linux server where Ascend-CANN-Toolkit has been installed, a pure development environment is formed, as shown in Figure 1-4. For details about how to install and deploy the pure development environment, see Quick Installation Guide (Windows). If you need an operating environment, select a desired scenario and deploy the Linux server with Ascend AI Processors installed by referring to the CANN Software Installation Guide (msInstaller). ● The method for installing MindStudio on a Windows server is universal regardless of the installation scenario.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 3 MindStudio Installation Guide 1 Installation Introduction

Figure 1-3 Operating on a Linux server (recommended)

Figure 1-4 Operating on a Linux server (not recommended)

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 4 MindStudio Installation Guide 1 Installation Introduction

Figure 1-5 Operating on a Windows industrial computer

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 5 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

2 Quick Installation Guide (Windows)

2.1 Description and Restrictions 2.2 Preparing Software Packages 2.3 Configuration Before Installation 2.4 Installation Process 2.5 Configuration after Installation

2.1 Description and Restrictions This section uses Windows 10 x86_64 as an example to describe how to use msInstaller to deploy the MindStudio pure development environment. Figure 2-1 shows the installation architecture.

Figure 2-1 Windows-based pure development

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 6 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Compared with manual installation, msInstaller has the following advantages:

● Provides a GUI for selecting different development scenarios. ● On the Windows server where msInstaller is running, deploys the environments for the local Windows server and remote Linux server. ● You do not need to obtain the MindStudio and CANN software packages separately. ● Automatically installs OS dependencies, firmware and drivers, and CANN software packages.

For details about msInstaller and how to use the tool to install and deploy environments in other scenarios, see the CANN Software Installation Guide (msInstaller).

2.2 Preparing Software Packages

How to obtain:

Ascend-mindx-msinstaller_{version}.zip: Link

Decompress the Ascend-mindx-msinstaller_{version}.zip software package to obtain the msInstaller-{version}-py3-none-any.whl tool package.

{version} indicates the software version.

Application scenarios:

● On a PC (Windows), use msInstaller to MindStudio in the local environment. ● On a PC (Windows), use msInstaller to remotely install the development or operating environment for the Ascend AI device.

2.3 Configuration Before Installation

Basic System Configuration ● 1080 or greater resolution ● Use a non-administrator account to log in. For security purposes, you are advised to ensure that no other user logs in at the same time and disable remote login. ● Ensure that the local environment can connect to the network. ● Install the local Windows environment dependencies by referring to Windows 10. – JDK 11 – Python3.7.5 – MinGW – CMake – ACLlib (optional, for developing Windows applications in Windows industrial computer scenarios)

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 7 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

● The Windows OS is not preinstalled with the GnuPG verification software. Therefore, you need to install the GNU Privacy Guard for Windows (Gpg4Win) to verify OpenPGP signatures in the Windows OS. Download link: Gpg4win (for example, Gpg4win 3.1.15.) Complete the installation as prompted. After the installation is complete, input the gpg --version command in the CLI. If the version information is displayed, the installation is successful.

Checking the umask of the root User This operation is required when you use the msInstaller tool to remotely install the development or operating environment for the Ascend AI Processor.

1. Log in to the installation environment as the root user. 2. Check the umask value of the root user. umask 3. If the umask value is not 0022, append umask 0022 to the file and save the file. a. Run the following command in any directory to open the .bashrc file. vi ~/.bashrc Append umask 0022 to the end of the file. b. Run the :wq! command to save the file and exit. c. Run the source ~/.bashrc command for the modification to take effect immediately.

Preparing a Running User Before installing the driver or CANN software package on the remote device, you need to create the HwHiAiUser user. Perform the following operations in the environment where the driver or CANN software package is to be installed:

1. Create the running user HwHiAiUser. groupadd HwHiAiUser useradd -g HwHiAiUser -d /home/HwHiAiUser -m HwHiAiUser -s /bin/bash 2. Set the password of the HwHiAiUser user. passwd HwHiAiUser

NO TE

● After the HwHiAiUser user is created, do not disable the login authentication function of the user. ● The password validity period is 90 days. You can change the validity period in the /etc/ login.defs file or run the chage command to set the validity period. For details, see Setting the User Validity Period.

2.4 Installation Process

Prerequisites ● The preparations for the installation are complete. For details, see Configuration Before Installation.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 8 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

● Before remote installation, ensure that basic commands such as unzip have been installed in the environment.

Installing msInstaller 1. Copy the tool package msInstaller-{version}-py3-none-any.whl obtained in Preparing Software Packages to a private directory, for example, C:\Users \current user name. 2. Start the cmd program and go to the directory where the tool package is stored. 3. Set up and load the virtual Python environment. python -m venv env env\Scripts\activate.bat

NO TE

When you no longer need to use the msInstaller tool, run the following command to exit the virtual Python environment: deactivate 4. Run the following command to upgrade the pip: python -m pip install --upgrade pip 5. Create the .log directory in C:\Users\current user name. 6. Run the following command to install the msInstaller package (replace the current user name in the command with the actual user name). pip3 install msInstaller-{version}-py3-none-any.whl --log C:\Users\current user name\.log \msinstaller_install.log msinstaller_install.log is the msInstaller installation log file. 7. Run the following commands to start the tool: msinstaller 8. On the welcome page that appears, msInstaller automatically downloads the configuration file (containing the download address and detailed information about the software package) for software package installation and upgrade. See Figure 2-2.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 9 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Figure 2-2 msInstaller welcome page

Installing the CANN-Toolkit on the Remote Linux Server

Step 1 Click Install and click Next. The Set Development Environment page is displayed. See Figure 2-3.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 10 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Figure 2-3 Development environment configuration page

Step 2 To install a development or operating environment for the remote device, select Install Server. Step 3 Set the installation parameters, as shown in Table 2-1.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 11 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Table 2-1 Parameters Category Description

Install Server Installs the NPU driver and firmware, CANN software package, and AI framework (optional) on the remote Ascend device. 1. Connect to the remote device. – IP: device IP address and port number. – root: Only the root user can be used to log in to the remote device. – Password: password of the root user for logging in to the device. After setting the parameters, click Connect to connect to the remote device. If the remote server is not trusted, a window is displayed, showing the fingerprint of the remote server. If you trust the remote host, click Yes. You can run the ssh-keyscan {ip_address} command to confirm the fingerprint of the remote server. 2. After the connection is successful, check the parameters on the page. – IP: IP address of the device. – Port: port number. – OS: OS and version. – Architecture: architecture. – Source: Select online install. ▪ online install: msInstaller automatically downloads the (Ascend device) driver, firmware, and CANN software packages. – Model: Atlas product model. msInstaller automatically identifies the product model of the remote device. You can also select the product model.

Step 4 Click Next. The Install Options page is displayed. Step 5 Set installation parameters. ● Scenes: Select an installation scenario. Select Development Scene. ● Versions (displayed when online install is selected): Select a solution version. After you select this option, the CANN software package and NPU (Ascend device) of the matching version are displayed. Step 6 Select the software to be installed and related dependencies.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 12 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Figure 2-4 Install Options

Table 2-2 Overview of software packages Software Package Description

dependency Dependency of the CANN software package, which is selected by default.

python Dependency of the CANN software package, which is selected by default.

CANN toolkit Developer toolkit

● Download Folder Directory for storing software packages (such as driver, firmware, and CANN software packages) on the local host. The default value is ~/ msinstaller_download and cannot be changed. ● Device Folder Directory for storing software packages (such as driver, firmware, and CANN software packages) on the remote device. The default value is ~/ msinstaller_upload and cannot be changed. Step 7 Click Next. The Download and Installing window is displayed. The system starts to download and install the software packages. ● The Install Server tab page displays the download and installation progress of each software in real time. See Figure 2-5. The left column under Status indicates the software download progress, and the right column indicates the

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 13 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

software installation progress. The bar in the lower part of the window indicates the download and installation progress of all the software. If the progress bar is red, the download or installation fails. You can switch to the log tab page to view related logs. ● You can print logs on the log tab page.

Figure 2-5 Download and Installing

Step 8 When the progress bar reaches 100%, click Next. The Completing Setup page is displayed. Step 9 Click Finish to close msInstaller.

----End

Installing MindStudio on a Local Windows PC

Step 1 Click Install and click Next. The Set Development Environment page is displayed. See Figure 2-6.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 14 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Figure 2-6 Development environment configuration page

Step 2 To install MindStudio in the local environment, select Install Host. Step 3 Set the installation parameters, as shown in Table 2-3.

Table 2-3 Parameters Category Description

Install Host Installs MindStudio in the local environment. ● OS: operating system ● Source: Select online install. – online install: The msInstaller tool automatically downloads the MindStudio installation package.

Step 4 Click Next. The Install Options page is displayed. Step 5 Select mindstudio. ● Version indicates the MindStudio version. ● Download Folder: directory for storing the software package on the local host. The default value is -/msinstaller_download and cannot be changed.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 15 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Step 6 Click Next. The Download and Installing window is displayed. The system starts to install the MindStudio software package. See Figure 2-7.

Figure 2-7 Download and Installing

When the progress bar reaches 100%, click Next. The Completing Setup page is displayed. Step 7 Click Finish to close msInstaller.

----End

Launching MindStudio

Step 1 Open the Import MindStudio Settings dialog box, as shown in Figure 2-8.

Figure 2-8 Environment settings

● Config or installation folder: imports MindStudio settings from an existing directory. The directory is C:\Users\individual user\AppData\Roaming \MindStudioMS-{version}. The MindStudio settings include the personalized settings of the project UI such as the background color. ● Do not import settings (default): creates a configuration file.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 16 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Select an option and click OK.

NO TE

● If an earlier version of MindStudio has been installed, the Previous version parameter is displayed in the dialog box shown in Figure 2-8 when you are installing a later version. You can choose whether to import the settings from the earlier version as required. ● If MindStudio of the same version is detected and the C:\Users\individual user \AppData\Roaming\Huawei\MindStudioMS-{version} and C:\Users\individual user \.mindstudio directories are not deleted when you uninstall the previous version, the re- installation proceeds to Step 6 from Step Step 1. Step 2 If the dialog box shown in Figure 2-9 is displayed: NO TE

This dialog box is also displayed when you use MindStudio. You can determine whether to click Accept based on the site requirements. Choose File > Settings... > Tools > Server Certificates on the menu bar and select Accept non-trusted certificates automatically, the certificates will be automatically accepted and this dialog box will not be displayed when you use MindStudio.

Figure 2-9 Untrusted server certificate

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 17 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

● Click Accept to allow MindStudio to connect to the upgrade server. ● Click Reject to reject MindStudio to connect to the upgrade server. This dialog box is displayed when you restart MindStudio next time.

Step 3 On the page shown in Figure 2-10, click to connect the Windows environment where MindStudio is located to the remote development environment where the Ascend-CANN-Toolkit is located. Click next to Remote CANN location. In the dialog box displayed, select the installation path of the Ascend-CANN-Toolkit (including the version number).

Figure 2-10 Connecting to the remote CANN

Step 4 On the page for configuring the SSH connection, click to configure the SSH connection parameters. Click OK, as shown in Figure 2-11.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 18 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Figure 2-11 SSH configuration

Table 2-4 Parameters and icons Parameter/Icon Description

Host Destination address of the connection (IP address or domain name)

Port Port number of the destination address of the connection.

User name Username for logging in to the destination address.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 19 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Parameter/Icon Description

Authentication type Authentication method. Two methods are available: ● PASSWORD: Enter a password for authentication. ● KEY_PAIR: Use an SSH key for authentication. Prepare the key in advance by yourself. NOTE – In the EulerOS 2.8 AArch architecture, Kylin OS V10 SP1 AArch architecture, and CentOS 8.2, when KEY_PAIR is used for identity authentication, you need to run the ssh-keygen -m PEM or ssh-keygen -t rsa - m PEM command to apply for an SSH key. – When applying for an SSH key, you are advised to set Passphrase to a value that meets the following password complexity requirements:

▪ The password is at least 6 characters long.

▪ It must contain at least two types of the following characters: ○ At least one lowercase letter ○ At least one uppercase letter ○ At least one digit ○ Special characters: `~!@#$%^&*()-_=+\| [{}];:'",<.>/? and spaces

Password Available when Authentication type is set to Password. Enter the correct password. The password is saved by default.

Private key file Available when Authentication type is set to KEY_PAIR. Select a local private key file.

Passphrase Available when Authentication type is set to KEY_PAIR. Enter the correct passphrase. You can select Save passphrase to save the passphrase.

Test Connection Checks whether the connection is successful.

Adds a new SSH connection.

Deletes an SSH connection. Select an SSH connection to be deleted and click this icon.

OK Saves the SSH configuration. Click this icon to save and apply the current SSH connection configuration, and close the configuration window.

Cancel Cancels the current configuration. Click this icon to cancel the current configuration and close the configuration window.

Apply Applies the SSH configuration. Click this icon to save and apply the current configuration.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 20 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

Parameter/Icon Description

Lock the current The option is dimmed and cannot be operated. If the connection SSH connection is added to the cluster for management, this option is automatically selected. In this case, the SSH connection is locked and cannot be modified or deleted.

Step 5 Enter the installation path of the Ascend-CANN-Toolkit in the remote environment and click Finish, as shown in Figure 2-12.

Figure 2-12 Installation path of the Ascend-CANN-Toolkit

Step 6 If no error is reported and the welcome window is displayed, MindStudio is successfully installed. See Figure 2-13.

Figure 2-13 Welcome to MindStudio

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 21 MindStudio Installation Guide 2 Quick Installation Guide (Windows)

● New Project: creates a project. ● Open or Import: opens or imports a project. ● System Profiler: opens the System Profiling window. ● Get from Version Control: opens a project from version management. Step 7 Start MindStudio. Choose File > Settings... > Plugins to search for and install the following plugin tools: ● Grep Console ● Pylint ● Python Community Edition

NO TE

If the system displays a message indicating that the network is disconnected or the plugin does not exist when you search for a plugin tool, rectify the fault by referring to What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio.

----End

2.5 Configuration after Installation ● Before using Python 3.7.5, configure the following environment variables: # Install Python 3.7.5 as the root user. . /usr/local/ascendrc

# Install python 3.7.5 as a non-root user. . ~/.local/ascendrc ● The Toolkit and other software provide scripts for setting process-level environment variables. You can reference the scripts in processes to automatically set environment variables. The environment variables automatically become invalid after the processes end. The default installation path of the root user is used as an example. . /usr/local/Ascend/ascend-toolkit/set_env.sh

NO TE

You can also configure permanent environment variables by modifying the ~/.bashrc file. The procedure is as follows: 1. Run the vi ~/.bashrc command in any directory as the running user to open the .bashrc file and append the preceding lines to the file. 2. Run the :wq! command to save the file and exit. 3. Run the source ~/.bashrc command for the modification to take effect immediately.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 22 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

3 Quick Installation Guide (Linux)

3.1 Description and Restrictions 3.2 Preparing Software Packages 3.3 Configuration Before Installation 3.4 Installation Process 3.5 Configuration after Installation

3.1 Description and Restrictions

This section uses Ubuntu 18.04 x86_64 as an example to describe how to use msInstaller to deploy the MindStudio pure development environment on the local host as the root user. Figure 3-1 shows the installation architecture.

Figure 3-1 Linux-based pure development scenario

Compared with manual installation, msInstaller has the following advantages:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 23 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

● Provides a GUI for selecting different development scenarios. ● On the Linux server where msInstaller is running, deploys the environments for the local or remote device. ● You do not need to obtain the MindStudio and CANN software packages separately. ● Automatically installs OS dependencies, firmware and drivers, and CANN software packages.

For details about msInstaller and how to use the tool to install and deploy environments in other scenarios, see the CANN Software Installation Guide (msInstaller).

3.2 Preparing Software Packages

How to obtain:

Ascend-mindx-msinstaller_{version}.zip: Link

Application scenarios:

● On a Linux server, use msInstaller to install the development or operating environment locally. ● On a Linux server, use msInstaller to remotely install the development or operating environment for the Ascend AI device.

Software Package Integrity Verification

To prevent a software package from being maliciously tampered with during transfer or storage, download also the corresponding digital signature file for integrity verification while downloading the software package.

After the software package is downloaded, verify its PGP digital signature by referring to the OpenPGP Signature Verification Guide. If the verification fails, do not use the software package, and contact Huawei technical support engineers.

Before a software package is used in installation or update, its digital signature also needs to be verified according to the OpenPGP Signature Verification Guide to ensure that the software package is not tampered with.

3.3 Configuration Before Installation

Basic System Configuration ● The Python version in the environment where msInstaller is located is 3.6 or later. ● The environment where msInstaller is located can connect to the network. ● The system software source and pip source have been configured in the environment where msInstaller is located.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 24 MindStudio Installation Guide 3 Quick Installation Guide (Linux) msInstaller Dependency Installation

Run the following commands as the root user to install the dependencies required by msInstaller.

apt-get install -y libx11-xcb1 apt-get install -y libxcomposite1 apt-get install -y libatk1.0-0 apt-get install -y libatk-bridge2.0-0 apt-get install -y libgtk-3-0 apt-get install -y libnss3 apt-get install -y libgbm1 apt-get install -y libasound2 apt-get install -y libxcb-dri3-0 apt-get install -y libxss1 apt-get install -y fuse apt-get install -y zlib1g apt-get install -y zlib1g-dev apt-get install -y gpg apt-get install -y python3-dev

Checking the umask of the root User

Step 1 Log in to the installation environment as the root user.

Step 2 Check the umask value of the root user. umask

Step 3 If the umask value is not 0022, append umask 0022 to the file and save the file. 1. Run the following command in any directory to open the .bashrc file. vi ~/.bashrc Append umask NewValue to the file. 2. Run the :wq! command to save the file and exit. 3. Run the source ~/.bashrc command for the modification to take effect immediately.

----End

Preparing a Running User

Before installing the driver or CANN software package, you need to create the HwHiAiUser user. Perform the following operations in the environment where the driver or CANN software package is to be installed:

1. Create the running user HwHiAiUser. groupadd HwHiAiUser useradd -g HwHiAiUser -d /home/HwHiAiUser -m HwHiAiUser -s /bin/bash 2. Set the password of the HwHiAiUser user. passwd HwHiAiUser

NO TE

● After the HwHiAiUser user is created, do not disable the login authentication function of the user. ● The password validity period is 90 days. You can change the validity period in the /etc/ login.defs file or run the chage command to set the validity period. For details, see Setting the User Validity Period.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 25 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

3.4 Installation Process

Notes

Table 3-1 Software list

Software Installation User Installation Path

python3.7.5 Both root and non-root ● root user: /usr/local users are allowed. ● Non-root user: ● To perform the ~/.local installation as a non- Ascend-CANN-Toolkit root user, first install ● root user: /usr/local/ the dependencies as Ascend the root user and ● Non-root user: ~/ then install other Ascend software as the non- MindStudio root user. - ● To perform the installation as a non- root user, run the following command as the root user to add the installation user to the HwHiAiUser group (username indicates the non-root user name and needs to be replaced by the actual one). usermod -a -G HwHiAiUser username ● To perform the installation as a non- root user, first install MindStudio as the root user and then install MindStudio as the non-root user. ● The Toolkit software package of versions earlier than CANN 5.0.1 cannot be installed by a non- root user.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 26 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

Prerequisites ● The preparations for the installation are complete. For details, see Configuration Before Installation. ● Basic commands such as unzip have been installed in the environment.

NO TICE

If the msInstaller tool is used for installation, it is recommended that the available drive space be greater than 20 GB.

Installing msInstaller

Step 1 Log in as the installation user to the server where msInstaller is to be run. Step 2 Create an empty private (other users have no permissions to access) directory (for example, ~/MsInstaller). mkdir ~/MsInstaller Step 3 Obtain the msInstaller-{version}.tar.gz by referring to Preparing Software Packages and upload it to the new directory. Run the cd ~/MsInstaller command to go to the directory where the msInstaller package is stored, and run the following command: tar --no-same-owner -xvf msInstaller-{version}.tar.gz Step 4 Set up and load the virtual Python environment. (If the setup fails, install the required components as prompted.). python3 -m venv ~/MsInstaller/env source ~/MsInstaller/env/bin/activate

NO TE

If you do not need to use msInstaller, run the following command to exit the virtual Python environment: deactivate Step 5 Run the following command to upgrade pip (if pip3 does not exist in the environment, install it as prompted). pip3 install --upgrade pip Step 6 Run the following commands to create the msInstaller installation log file and install the msInstaller tool package: mkdir ~/.log -p chmod 700 ~/.log touch ~/.log/msinstaller_install.log chmod 600 ~/.log/msinstaller_install.log pip3 install msInstaller-{version}-py3-none-any.whl --log ~/.log/msinstaller_install.log

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 27 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

NO TE

● During the msInstaller installation, the default Python version is 3.7.5. Subsequent operations must be performed in the environment where Python 3.7.5 has been installed. If you want to select another Python version (you are not advised to change the default configuration), you can set the environment variable ASCEND_PYTHON_VERSION (for example, export ASCEND_PYTHON_VERSION=Python-3.7.0) to specify the Python version to be installed. The optional versions are 3.7.0 to 3.7.11 and 3.8.0 to 3.8.11. ● You are advised to run the following commands to harden the permission on related files after installing msInstaller. (Replace x in python3.x based on the site requirements.) chmod -R u-w,go-wrx ~/MsInstaller/env/lib/python3.x/site-packages/msinstaller/

Step 7 Start the msInstaller tool as the msInstaller running user. msinstaller

NO TE

● If the error message "The futex facility returned an unexpected error code.Aborted (core dumped)" or "Segmentation fault (core dumped)" is displayed when you run the preceding commands, run the following commands: ip_addr=$(echo $SSH_CLIENT |awk ' {print $1 }') export DISPLAY=$ip_addr:0.0

Step 8 After the command is run, msInstaller is started and the welcome page is displayed. See Figure 3-2. After the welcome page is displayed, msInstaller is used to download the configuration file (containing the download address and detailed information about the software package) for installing the software package.

Figure 3-2 msInstaller welcome page

----End

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 28 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

Development Environment Setup

Step 1 On the msInstaller welcome page, select Install and click Next. The Set Development Environment page is displayed. See Figure 3-3. The following figure shows the configuration page of the tool started by the root user. If the tool is started by a non-root user, the 200DK section is not displayed.

Figure 3-3 Development environment configuration page

Step 2 Select Install Host to install the development or operating environment on the local host. See Figure 3-4.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 29 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

Figure 3-4 Install Host

Step 3 Set the installation parameters, as shown in Table 3-2.

Table 3-2 Parameters

Field Description

OS OS and Version

Source Select online install. msInstaller automatically downloads MindStudio, the (Ascend device) driver, firmware, and CANN software packages.

Model -- You do not need to select a model for a pure development (not environment. displayed when a non-root user starts the system)

Step 4 Click Next. The Install Options page is displayed.

Step 5 Set installation parameters. ● Scenes: Select an installation scenario. Select Development Scene.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 30 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

● Versions (displayed when online install is selected): Select a solution version. After you select this option, the CANN software package and NPU (Ascend device) of the matching version are displayed. Step 6 Select the software to be installed and related dependencies.

Figure 3-5 Install Options

Table 3-3 Overview of software packages Software Package Description

dependency Dependency of the CANN software package, which is selected by default.

python Dependency of the CANN software package, which is selected by default.

CANN toolkit Developer toolkit

mindstudio MindStudio installation package

Download Folder: Directory for storing software packages (such as driver, firmware, and CANN software packages) on the local host. The default value is ~/ msinstaller_download and cannot be changed. Step 7 Click Next. The Download and Installing window is displayed. The system starts to download and install the software packages. See Figure 3-6.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 31 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

● The Install Server tab page displays the download and installation progress of each software in real time. See Figure 3-6. The left column under Status indicates the software download progress, and the right column indicates the software installation progress. The bar in the lower part of the window indicates the download and installation progress of all the software. If the progress bar is red, the download or installation fails. You can switch to the log tab page to view related logs. ● You can print logs on the log tab page.

Figure 3-6 Download and Installing

Step 8 When the progress bar reaches 100%, click Next. The Completing Setup page is displayed.

Step 9 Click Finish to close msInstaller.

----End

Launching MindStudio

Step 1 Before running MindStudio, run the following commands to configure related environment variables. # Install Python 3.7.5 as the root user. . /usr/local/ascendrc

# Install Python 3.7.5 as a non-root user. . ~/.local/ascendrc

Step 2 As the MindStudio installation user, run the following command in the ~/ MindStudio/bin directory generated after package installation:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 32 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

./MindStudio.sh Step 3 Open the Import MindStudio Settings dialog box, as shown in Figure 3-7.

Figure 3-7 Environment settings

● Config or installation folder: imports MindStudio settings from an existing directory. The directory is $HOME/.config/Huawei/MindStudioMS-x.x. The MindStudio settings include the personalized settings of the project UI such as the background color. ● Do not import settings (default): creates a configuration file. Select an option and click OK.

NO TE

● If an earlier version of MindStudio has been installed, the Previous version parameter is displayed in the dialog box shown in Figure 3-7 when you are installing a later version. You can choose whether to import the settings from the earlier version as required. ● If this version of MindStudio has been installed before, and the $HOME/.cache/ Huawei/MindStudioMS-x.x and $HOME/.config/Huawei/MindStudioMS-x.x directories have not been deleted during the uninstallation, you will go to 14 directly from 9 when installing this version again. (x.x indicates the version number.) Step 4 If the dialog box shown in Figure 3-8 is displayed:

NO TE

This dialog box is also displayed when you use MindStudio. You can determine whether to click Accept based on the site requirements. Choose File > Settings... > Tools > Server Certificates on the menu bar and select Accept non-trusted certificates automatically, the certificates will be automatically accepted and this dialog box will not be displayed when you use MindStudio.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 33 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

Figure 3-8 Untrusted server certificate

● Click Accept to allow MindStudio to connect to the upgrade server. ● Click Reject to reject MindStudio to connect to the upgrade server. This dialog box is displayed when you restart MindStudio next time. Step 5 The window shown in Figure 3-9 is displayed.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 34 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

Figure 3-9 Selecting the Toolkit installation path

Click next to CANN-Toolkit Path. In the displayed dialog box, select the Toolkit installation path (the version path must be selected). Click OK. The Toolkit version information is displayed in CANN-Toolkit Version and cannot be modified. Click Finish.

Step 6 If no error message is displayed and the welcome page is displayed, MindStudio has been installed.

The following describes the parameters in the dialog box. You can click Create new project to create a project. For details, see "Creating an Application Project" or "Project Creation" in the MindStudio User Guide.

● New project: creates a project and save it in $HOME/AscendProjects. ● Open or Import: opens or imports a project. ● System Profiler: opens the System Profiling window. ● Get from Version Control: opens a project from version management.

NO TE

After the installation is successful, the following directories are created in $HOME on the MindStudio installation server: ● .mindstudio: stores the MindStudio property file mindstudio.properties (recording the Toolkit installation path) and records of operations performed by users on the privacy statement window. ● .cache/Huawei/MindStudioMS-x.x: stores runtime logs (log/idea.log) generated after MindStudio installation and startup. ● .config/Huawei/MindStudioMS-x.x: stores user configuration, including personalized settings (such as the background color) of the project UI.

Step 7 Start MindStudio. Choose File > Settings... > Plugins to search for and install the following plugin tools:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 35 MindStudio Installation Guide 3 Quick Installation Guide (Linux)

● Grep Console ● Pylint ● Python Community Edition

NO TE

If the system displays a message indicating that the network is disconnected or the plugin does not exist when you search for a plugin tool, rectify the fault by referring to What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio.

----End

3.5 Configuration after Installation ● Before using Python 3.7.5, configure the following environment variables: # Install Python 3.7.5 as the root user. . /usr/local/ascendrc

# Install python 3.7.5 as a non-root user. . ~/.local/ascendrc ● The Toolkit and other software provide scripts for setting process-level environment variables. You can reference the scripts in processes to automatically set environment variables. The environment variables automatically become invalid after the processes end. The default installation path of the root user is used as an example. . /usr/local/Ascend/ascend-toolkit/set_env.sh

NO TE

You can also configure permanent environment variables by modifying the ~/.bashrc file. The procedure is as follows: 1. Run the vi ~/.bashrc command in any directory as the running user to open the .bashrc file and append the preceding lines to the file. 2. Run the :wq! command to save the file and exit. 3. Run the source ~/.bashrc command for the modification to take effect immediately.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 36 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

4 Manual Installation Guide (Windows)

4.1 Installation Workflow 4.2 Obtaining Software Packages 4.3 Preparing for Installation 4.4 Installing MindStudio

4.1 Installation Workflow

Figure 4-1 MindStudio installation workflow

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 37 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

4.2 Obtaining Software Packages

Table 4-1 Package description

Software Package Description How to Obtain

MindStudio_{version}_wi Installation-free Obtaining Software n.zip MindStudio package, Packages which contains a graphical IDE.

MindStudio_{version}.exe MindStudio installation Obtaining Software package, which contains Packages a graphical IDE.

Software Package Integrity Verification

To prevent a software package from being maliciously tampered with during transfer or storage, download also the corresponding digital signature file for integrity verification while downloading the software package.

After the software package is downloaded, verify its PGP digital signature by referring to the OpenPGP Signature Verification Guide. If the verification fails, do not use the software package, and contact Huawei technical support engineers.

Before a software package is used in installation or update, its digital signature also needs to be verified according to the OpenPGP Signature Verification Guide to ensure that the software package is not tampered with.

4.3 Preparing for Installation When MindStudio is installed on a Windows server, the Windows server is the local environment, while a Linux server is used as the remote environment.

Local Environment Requirements

Windows 10 x86_64

Installing Dependencies on a Local PC ● JDK 11 ● Python 3.7.5 ● MinGW ● CMake ● ACLlib (optional, for developing Windows applications on Windows industrial computers)

For details, see Windows 10.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 38 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Configuring the Remote Environment ● Remote co-deployment: Deploy a Linux server with Ascend AI devices installed by referring to the CANN Software Installation Guide (msInstaller). ● Pure development: a. Configure the MindStudio environment based on the version of the remote Linux server. For details, see Pre-installation Actions and Configuring the Compilation Environment.

NO TE

You do not need to install JDK 11 when installing remote environment dependencies. Install JDK 11 on the local Windows host by referring to Windows 10. b. Download the Ascend-CANN-Toolkit from the Ascend Community and run the following commands as the user created in a to install the toolkit: chmod +x *.run ./*.run --install In the preceding commands, *.run indicates Ascend-cann- toolkit_{version}_linux-{arch}.run. Replace it with the actual toolkit.

4.4 Installing MindStudio

Prerequisites Prepare for MindStudio installation. See Obtaining Software Packages and Preparing for Installation.

Procedure

Step 1 Double-click MindStudio_{version}.exe to install MindStudio. If you use MindStudio_{version}_win.zip to install MindStudio, skip Steps Step 1 to Step 9. Double-click MindStudio64.exe in the bin directory generated after the decompression, and start from Step Step 10 to configure MindStudio. Step 2 On the MindStudio Setup page, click Next, as shown in Figure 4-2.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 39 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-2 MindStudio Setup

Step 3 (Optional) If MindStudio is not installed for the first time, you can determine whether to uninstall the earlier version. ● If you do not uninstall the earlier version, click Next to go to Step 5. ● If you want to uninstall the earlier version, select the version, select Uninstall silently (or not), and click Next to go to Step 4.

Figure 4-3 Uninstalling the earlier version

Step 4 (Optional) Select the options to be uninstalled and click Uninstall. After the uninstallation is complete, click Close.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 40 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-4 Uninstalling MindStudio

Step 5 Select the MindStudio installation path and click Next. See Figure 4-5.

Figure 4-5 MindStudio installation path

NO TE

You are advised to install MindStudio in the C:\ProgramFiles directory. If you install MindStudio in another directory, cancel the modification permission of common users to prevent other users from modifying the running files.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 41 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Step 6 Select installation options as required and click Next. See Figure 4-6.

Figure 4-6 Selecting installation options

● Create Desktop Shortcut: creates a desktop shortcut. You can select 32-bit launcher or 64-bit launcher based on the system configuration. ● Update PATH variable(restart needed): adds the path of the MindStudio boot file to the environment variable PATH so that MindStudio can be started directly from the system command line. If this option is selected, you need to restart the OS after MindStudio has been installed and configured. ● Update context menu: Select Add "Open Folder as Project" and right-click the folder to open it as a MindStudio project. ● Create Associations: By default, this option is not selected. Step 7 Select or create the start menu folder in the MindStudio installation path, and click Install. See Figure 4-7.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 42 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-7 Start Menu Folder

Step 8 Start to install MindStudio. After the installation is complete, click Next. See Figure 4-8.

Figure 4-8 Installing

Step 9 If you want to run MindStudio directly after the installation, select Run MindStudio and click Finish. See Figure 4-9.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 43 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-9 Completing MindStudio Setup

Step 10 Open the Import MindStudio Settings dialog box, as shown in Figure 4-10.

Figure 4-10 Environment settings

● Config or installation folder: imports MindStudio settings from an existing directory. The directory is C:\Users\individual user\AppData\Roaming \MindStudioMS-{version}. The MindStudio settings include the personalized settings of the project UI such as the background color. ● Do not import settings (default): creates a configuration file.

Select an option and click OK.

NO TE

● If an earlier MindStudio installation is detected, the Previous version parameter is displayed in the dialog box shown in Figure 4-10 when you are installing a later version. You can choose whether to import the settings from the earlier version as required. ● If MindStudio of the same version is detected and the C:\Users\individual user \AppData\Roaming\Huawei\MindStudioMS-{version} and C:\Users\individual user \.mindstudio directories are not deleted when you uninstall the previous version, the re- installation proceeds to Step 15 from Step Step 10.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 44 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Step 11 If the dialog box shown in Figure 4-11 is displayed:

NO TE

This dialog box is also displayed when you use MindStudio. You can determine whether to click Accept based on the site requirements. Choose File > Settings... > Tools > Server Certificates on the menu bar and select Accept non-trusted certificates automatically, the certificates will be automatically accepted and this dialog box will not be displayed when you use MindStudio.

Figure 4-11 Untrusted server certificate

● Click Accept to allow MindStudio to connect to the upgrade server. ● Click Reject to reject MindStudio to connect to the upgrade server. This dialog box is displayed when you restart MindStudio next time.

Step 12 On the page shown in Figure 4-12, click to connect the Windows environment where MindStudio is located to the remote development environment where Ascend-CANN-Toolkit is located. Click next to Remote CANN location. In the dialog box displayed, select the installation path of the Ascend-CANN-Toolkit (including the version number).

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 45 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-12 Connecting to the remote CANN

Step 13 On the page for configuring the SSH connection, click to configure the SSH connection parameters. Click OK, as shown in Figure 4-13.

Figure 4-13 SSH configuration

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 46 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Table 4-2 Parameters and icons Parameter/Icon Description

Host Destination address of the connection (IP address or domain name)

Port Port number of the destination address of the connection.

User name Username for logging in to the destination address.

Authentication type Authentication method. Two methods are available: ● PASSWORD: Enter a password for authentication. ● KEY_PAIR: Use an SSH key for authentication. Prepare the key in advance by yourself. NOTE – In the EulerOS 2.8 AArch architecture, Kylin OS V10 SP1 AArch architecture, and CentOS 8.2, when KEY_PAIR is used for identity authentication, you need to run the ssh-keygen -m PEM or ssh-keygen -t rsa - m PEM command to apply for an SSH key. – When applying for an SSH key, you are advised to set Passphrase to a value that meets the following password complexity requirements:

▪ The password is at least 6 characters long.

▪ It must contain at least two types of the following characters: ○ At least one lowercase letter ○ At least one uppercase letter ○ At least one digit ○ Special characters: `~!@#$%^&*()-_=+\| [{}];:'",<.>/? and spaces

Password Available when Authentication type is set to Password. Enter the correct password. The password is saved by default.

Private key file Available when Authentication type is set to KEY_PAIR. Select a local private key file.

Passphrase Available when Authentication type is set to KEY_PAIR. Enter the correct passphrase. You can select Save passphrase to save the passphrase.

Test Connection Checks whether the connection is successful.

Adds a new SSH connection.

Deletes an SSH connection. Select an SSH connection to be deleted and click this icon.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 47 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Parameter/Icon Description

OK Saves the SSH configuration. Click this icon to save and apply the current SSH connection configuration, and close the configuration window.

Cancel Cancels the current configuration. Click this icon to cancel the current configuration and close the configuration window.

Apply Applies the SSH configuration. Click this icon to save and apply the current configuration.

Lock the current The option is dimmed and cannot be operated. If the connection SSH connection is added to cluster management, this option is automatically selected. In this case, the SSH connection is locked and cannot be modified or deleted.

Step 14 Enter the Ascend-CANN-Toolkit installation path in the remote environment and click Finish. See Figure 4-14.

Figure 4-14 Ascend-CANN-Toolkit installation path

Step 15 If no error is reported and the welcome window is displayed, MindStudio is successfully installed. See Figure 4-15.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 48 MindStudio Installation Guide 4 Manual Installation Guide (Windows)

Figure 4-15 Welcome to MindStudio

● New Project: creates a project. ● Open or Import: opens or imports a project. ● System Profiler: displays the System Profiling page. ● Get from Version Control: opens a project from version management. Step 16 Start MindStudio. Choose File > Settings... > Plugins to search for and install the following plugin tools: ● Grep Console ● Pylint ● Python Community Edition

NO TE

If the system displays a message indicating that the network is disconnected or the plugin does not exist when you search for a plugin tool, rectify the fault by referring to What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio.

----End

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 49 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

5 Manual Installation Guide (Linux)

5.1 Installation workflow 5.2 Downloading Required Files 5.3 MindStudio Package Overview 5.4 Pre-installation Actions 5.5 Installing MindStudio 5.6 Configuring the Compilation Environment

5.1 Installation workflow

Figure 5-1 MindStudio installation workflow

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 50 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

5.2 Downloading Required Files

Table 5-1 Required files File Description How to Obtain

MindStudio_{version}_lin MindStudio package, a Software package ux.tar.gz GUI-based IDE

Ascend-cann- Ascend-CANN-Toolkit, Software package toolkit_{version}_linux- including auxiliary toolkit {arch}.run and APIs. ● If an installation is available in your environment, do not install it repeatedly. ● If no installation is available in your environment, download its runfile and install it in the MindStudio installation process.

Software Package Integrity Verification To prevent a software package from being maliciously tampered with during transfer or storage, download also the corresponding digital signature file for integrity verification while downloading the software package. After the software package is downloaded, verify its PGP digital signature by referring to the OpenPGP Signature Verification Guide. If the verification fails, do not use the software package, and contact Huawei technical support engineers. Before a software package is used in installation or update, its digital signature also needs to be verified according to the OpenPGP Signature Verification Guide to ensure that the software package is not tampered with.

5.3 MindStudio Package Overview Table 5-2 describes the files extracted from the MindStudio tar.gz package.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 51 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Table 5-2 Description of the files extracted from the tar.gz package Package Description Purpose

MindStudio_{version}_lin MindStudio MindStudi ux.tar.gz ● bin: MindStudio execution directory, o storing dependent binary files installatio n ● build.txt: build information of the tar.gz package ● config: MindStudio configuration file ● Install-Linux-tar.txt: MindStudio installation description ● jbr: library and file dependencies of a 64-bit OS ● lib: Java library dependencies ● license: third-party license dependencies ● LICENSE.txt: Apache license description ● NOTICE.txt: considerations ● plugins: plug-in and Java library dependencies of MindStudio ● product-info.json: file storing the MindStudio version and executable file path ● redist: Java annotations ● samples: operator project samples and model files of typical network models ● tools: tools

5.4 Pre-installation Actions

5.4.1 Ubuntu 18.04 (x86_64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 52 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Table 5-3 Ubuntu OS mapping information

Item Restriction Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion with ATC.

OS Ubuntu 18.04 ● Available at http://releases.ubuntu.com/ (x86_64) releases/ ● During model conversion, if a custom TE plugin is loaded, the UI may be suspended. In this case, run the uname -r or cat /proc/ version command to check whether the Linux kernel version is earlier than 4.18. If yes, install the Linux kernel patch available at https://bugzilla.kernel.org/attachment.cgi? id=277305.

System en_US.UTF-8 ● Only English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows:

You can install MindStudio as any user (root or non-root).

● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 53 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command.

▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources

The installation requires the download of related dependencies. Ensure that the server can be connected to the network.

Run the following command as the root user to check whether the source is available:

apt-get update

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 54 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

If an error is reported during the command execution, check whether the network connection is normal or replace the source in the /etc/apt/sources.list file with a valid one.

Installing Dependencies For details, see Ubuntu18.04 (x86_64). 5.4.2 Ubuntu 18.04 (AArch64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-4 Ubuntu OS mapping information Item Restriction Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS Ubuntu 18.04 ● During model conversion, if a custom TE plug- (AArch64) in is loaded, the UI may be suspended. In this case, run the uname -r or cat /proc/version command to check whether the Linux kernel version is earlier than 4.18. If yes, install the Linux kernel patch available at https:// bugzilla.kernel.org/attachment.cgi? id=277305. ● For details about how to upgrade the Linux kernel, visit https://bbs.huaweicloud.com/ forum/thread-22441-1-1.html.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 55 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Item Restriction Description

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows: You can install MindStudio as any user (root or non-root). ● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027. ▪ You can view the umask value by running the umask command. ▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 56 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources The installation requires the download of related dependencies. Ensure that the server can be connected to the network. Run the following command as the root user to check whether the source is available:

apt-get update

NO TE

If an error is reported during the command execution, check whether the network connection is normal or replace the source in the /etc/apt/sources.list file with a valid one.

Installing Dependencies For details, see Ubuntu18.04 (AArch64). 5.4.3 EulerOS 2.8 (AArch64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 57 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Table 5-5 OS mapping information Item Restriction Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum disk unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS EulerOS 2.8 -- (AArch64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows: You can install MindStudio as any user (root or non-root). ● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 58 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command. ▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources

The installation requires the download of related dependencies. Ensure that the server can be connected to the network.

Run the following command as the root user to check whether the source is available:

yum repolist

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies

For details, see EulerOS 2.8 (AArch64).

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 59 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

5.4.4 openEuler 20.03 (x86_64)

Environment Requirements

The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-6 OS mapping information

Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS openEuler 20.03 -- (x86_64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows:

You can install MindStudio as any user (root or non-root).

● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 60 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command.

▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources

The installation requires the download of related dependencies. Ensure that the server can be connected to the network.

Run the following command as the root user to check whether the source is available:

yum repolist

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 61 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies

For details, see openEuler 20.03 (x86_64). 5.4.5 openEuler 20.03 (AArch64)

Environment Requirements

The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-7 OS mapping information

Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS openEuler 20.03 -- (AArch64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 62 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows:

You can install MindStudio as any user (root or non-root).

● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command.

▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 63 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Checking Sources The installation requires the download of related dependencies. Ensure that the server can be connected to the network. Run the following command as the root user to check whether the source is available:

yum repolist

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies For details, see openEuler20.03 (AArch64). 5.4.6 CentOS 7.6/8.2 (x86_64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-8 OS mapping information Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS CentOS 7.6/8.2 -- (x86_64)

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 64 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Item Version Description

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows: You can install MindStudio as any user (root or non-root). ● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027. ▪ You can view the umask value by running the umask command. ▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 65 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources The installation requires the download of related dependencies. Ensure that the server can be connected to the network. Run the following command as the root user to check whether the source is available: ● CentOS 7.6 yum repolist ● CentOS 8.2 dnf repolist

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies For details, see CentOS 7.6/8.2 (x86_64). 5.4.7 CentOS 7.6/8.2 (AArch64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 66 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Table 5-9 OS mapping information Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum drive unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS CentOS 7.6/8.2 -- (AArch64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows: You can install MindStudio as any user (root or non-root). ● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 67 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command.

▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources

The installation requires the download of related dependencies. Ensure that the server can be connected to the network.

Run the following command as the root user to check whether the source is available:

● CentOS 7.6 yum repolist ● CentOS 8.2 dnf repolist

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 68 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Installing Dependencies For details, see CentOS 7.6/8.2 (AArch64). 5.4.8 Kylin OS V10 SP1 (AArch64)

Environment Requirements The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-10 OS mapping information Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum disk unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS Kylin V10 -- (AArch_64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user. ● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows: You can install MindStudio as any user (root or non-root). ● To install MindStudio as the root user, skip this section.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 69 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027. ▪ You can view the umask value by running the umask command. ▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Checking Sources The installation requires the download of related dependencies. Ensure that the server can be connected to the network. Run the following command as the root user to check whether the source is available:

yum repolist

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 70 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies

For details, see Kylin OS V10 SP1 (AArch64). 5.4.9 NeoKylin OS 7.6-AArch64

Environment Requirements

The minimum hardware and OS requirements for installing MindStudio are as follows:

Table 5-11 OS mapping information

Item Version Description

Hardw ● Recommended ● If the memory size of the Linux host is 4 GB, are memory size: 8 the size of the model file should be less than GB (at least 4 or equal to 350 MB for model conversion on GB) MindStudio. Otherwise, the OS may be ● Minimum disk unstable. space: 6 GB ● If the configurations of the Linux host are upgraded, for example, the memory is expanded to 8 GB, the supported operation specifications should be increased proportionally. If the memory is expanded from 4 GB to 8 GB, keep the model file size within 700 MB for model conversion.

OS NeoKylin 7.6 -- (AArch_64)

System en_US.UTF-8 ● Only the English version is supported. langua ● Run the locale command as any user to query ge the encoding format in any directory. If the system displays LANG=en_US.UTF-8, the encoding format is correct. Otherwise, run the vim /etc/default/locale command as the root user to modify LANG=en_US.UTF-8 and reboot the system (using the reboot command) for the settings to take effect.

(Optional) Preparing the Installation User ● If an Ascend-CANN-Toolkit installation is available, install MindStudio as the Ascend-CANN-Toolkit installation user.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 71 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● If there is no Ascend-CANN-Toolkit installation, prepare an installation user as follows:

You can install MindStudio as any user (root or non-root).

● To install MindStudio as the root user, skip this section. ● To install MindStudio as an existing non-root user, ensure that the user has the read, write, and execute permissions on the $HOME directory. ● To install MindStudio as a new non-root user, perform the following steps as the root user. This document uses this scenario as an example to describe how to install MindStudio. a. Create a MindStudio installation user and set the $HOME directory of the user: useradd -g HwHiAiUser -d /home/username -m username -s /bin/bash

NO TE

The user must be at the same group as the Driver running user. Otherwise, add the user to the Driver running user group. Assume the user group is HwHiAiUser. You can run the useradd -g HwHiAiUser -d /home/username -m username - s /bin/bash command to create a MindStudio installation user and add it to the group. b. Run the following command to set the user password: passwd username username indicates the name of the MindStudio installation user. The umask value of the user is 0027.

▪ You can view the umask value by running the umask command.

▪ You can change the umask value by running the umask NewValue command. If the value of umask is changed using the preceding method, NewValue takes effect only in the current window. To set a permanent value of umask, modify the ~/.bashrc file as follows: 1) Run the following command in any directory to open the .bashrc file: vi ~/.bashrc Append umask NewValue to the file. 2) Run the :wq! command to save the file and exit. 3) Run the source ~/.bashrc command for the modification to take effect immediately.

(Optional) Configuring the Permission of the Installation User

If you install MindStudio as a non-root user, download related dependent software first. In this case, you may need to use the privilege escalation commands. In this case, obtain the required sudo permissions. After the installation is complete, cancel the permissions related to high-risk commands. Otherwise, sudo privilege escalation risks exist.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 72 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Checking Sources The installation requires the download of related dependencies. Ensure that the server can be connected to the network. Run the following command as the root user to check whether the source is available:

yum repolist NO TE

If an error is reported during the command execution, check the Internet access or replace the sources in the /etc/yum.repos.d/xxxx.repo file with valid ones.

Installing Dependencies For details, see NeoKylin OS 7.6 (AArch64).

5.5 Installing MindStudio

NO TICE

● Only one MindStudio installation is allowed in a single directory on a single server. Before installing MindStudio, uninstall any previous MindStudio installation. For details, see "MindStudio Management" in the MindStudio User Guide. ● Log in to the OS as the MindStudio installation user. It is not supported to switch to the MindStudio installation user after login as a different user.

Prerequisites Downloading Required Files and Pre-installation Actions have been completed.

Procedure Step 1 Upload the MindStudio package as the MindStudio installation user. ● If there is an Ascend-CANN-Toolkit installation, upload the MindStudio package to the MindStudio installation server. ● If there is no Ascend-CANN-Toolkit installation, upload the MindStudio package and Ascend-CANN-Toolkit runfile to the MindStudio installation server. Step 2 Extract the MindStudio tar.gz package. Run the following command as the MindStudio installation user to extract the MindStudio_{version}_linux.tar.gz package:

tar -zxvf MindStudio_{version}_linux.tar.gz For details about the content extracted from the package, see Table 5-2. Step 3 As the MindStudio installation user, run the following command in the MindStudio/bin directory generated after package extraction:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 73 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

cd MindStudio/bin ./MindStudio.sh

NO TE

If the error message "Failed to initialize graphics environment" or "Unable to detect graphics environment" is displayed when MindStudio is launched, rectify the fault by following the instructions in What Do I Do If the GUI Cannot Be Displayed When MindStudio Is Started?.

When MindStudio is launched for the first time, it will prompt you to install the necessary third-party dependencies. You are advised not to launch MindStudio in the background. The installation script automatically checks whether the path is valid. 1. If the path is valid, the dependencies are checked. If all the dependencies are installed, go to Step 4. Otherwise, install any missing dependency as prompted. After all dependencies are installed, run the installation script again. 2. If messages similar to the following are displayed: There is no python3.7.5 in path /usr/local/python3.7.5.Please enter your choice: 1.choose local python3.7.5 2.install python3.7.5 a. Enter 1. The system prompts "Enter local python path:". Enter the local path where Python 3.7.5 has been installed. The script checks whether the path is valid. i. If the path is valid, the dependencies are checked. If all the dependencies are installed, go to Step 4. Otherwise, install any missing dependency as prompted. ii. If the path check fails, return to the message prompt. Check whether the entered path is correct or enter 2 to go to b. b. Enter 2 and enter a new installation path to install Python 3.7.5 as prompted. You can also retain the default installation path /usr/local/ python3.7.5. Enter python install path.Default value is /usr/local/python3.7.5: /home/hisisoc/software/python3.7.5 Install Python 3.7.5 and related dependencies as prompted. After the installation is complete, run the installation script again.

Step 4 Open the Import MindStudio Settings dialog box, as shown in Figure 5-2.

Figure 5-2 Environment settings

● Config or installation folder: imports MindStudio settings from an existing directory.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 74 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

The directory is $HOME/.config/Huawei/MindStudioMS-{version}. The MindStudio settings include the personalized settings of the project UI such as the background color. ● Do not import settings (default): creates a configuration file. Select an option and click OK.

NO TE

● If an earlier MindStudio installation is detected, the Previous version parameter is displayed in the dialog box shown in Figure 5-2 when you are installing a later version. You can choose whether to import the settings from the earlier version as required. ● If this version of MindStudio has been installed on the server earlier, and the $HOME/.cache/Huawei/MindStudioMS-{version} and $HOME/.config/Huawei/ MindStudioMS-{version} directories have not been deleted during the uninstallation, you will be directed to Step 9 from Step 3 when you try to install this version again.

Step 5 The dialog box shown in Figure 5-3 is displayed.

NO TE

This dialog box is also displayed when you use MindStudio. You can determine whether to click Accept based on the site requirements. If you choose File > Settings... > Tools > Server Certificates on the menu bar and select Accept non-trusted certificates automatically, the certificates will be automatically accepted and this dialog box will not be displayed when you use MindStudio.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 75 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Figure 5-3 Untrusted server certificate

● Click Accept to allow MindStudio to connect to the upgrade server. ● Click Reject to reject MindStudio to connect to the upgrade server. This dialog box is displayed when you restart MindStudio next time. Step 6 The window shown in Figure 5-4 is displayed.

NO TE

● If the page is not completely displayed, rectify the fault by following the instructions in How Do I Solve the Problem that Chinese Characters Are Displayed as Garbled Characters and the GUI Is Incompletely Displayed or Is Not Well-Organized?. ● When selecting the installation path for Ascend-CANN-Toolkit, do not select the soft link path that is automatically created by the system when the toolkit is installed.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 76 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Figure 5-4 Selecting the Ascend-CANN-Toolkit path

● If there is an installed Ascend-CANN-Toolkit: Click next to CANN-Toolkit Path. In the dialog box that is displayed, select the Ascend-CANN-Toolkit installation path (including the version number). Click OK. The Ascend-CANN- Toolkit version information is displayed in the CANN-Toolkit Version text box, which is not configurable. See Figure 5-5. Click Finish and move on to Step 9.

Figure 5-5 Selecting the Ascend-CANN-Toolkit installation path

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 77 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● If there is no installed Ascend-CANN-Toolkit: Click next to CANN-Toolkit Path. In the dialog box that is displayed, select the Ascend-CANN-Toolkit runfile uploaded in Pre-installation Actions and select its path, as shown in Figure 5-6. Click Next and move on to Step 7.

Figure 5-6 Selecting the Ascend-CANN-Toolkit path

Step 7 Verify the current settings.

Figure 5-7 Current settings

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 78 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Step 8 Click Next, as shown in Figure 5-8.

Figure 5-8 Installing Ascend Toolkit

Click Show Details to check the Ascend-CANN-Toolkit installation details or click Hide Details to hide the details. If the following message is displayed, the installation is successful. In this case, the Finish button becomes available and other buttons are unavailable.

Installation succeeded. Please click "Finish". Click Finish. A dialog box is displayed, prompting you to restart MindStudio, as shown in Figure 5-9.

Figure 5-9 Restarting MindStudio

Click OK to restart MindStudio. Step 9 If no error is reported and the welcome window is displayed, MindStudio is successfully installed. Find the following new directories in $HOME on the MindStudio installation server: ● $HOME/.mindstudio: stores the MindStudio property file mindstudio.properties (recording the Toolkit installation path) and records of operations performed by users on the privacy statement window.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 79 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

● $HOME/.cache/Huawei/MindStudioMS-{version}: stores runtime logs (log/ idea.log) generated after MindStudio is installed and launched. ● $HOME/.config/Huawei/MindStudioMS-{version}: stores user configuration, including personalized settings (such as the background color) of the project UI.

The parameters in the welcome window are described as follows:

● New project: creates a project and save it in $HOME/AscendProjects. ● Open or Import: opens or imports a project. ● System Profiler: opens the System Profiling window. ● Get from Version Control: opens a project from version management.

Step 10 Lauch MindStudio and choose File > Settings > Plugins from the main menu to install the following plugin tools: ● Grep Console ● Pylint ● Python Community Edition

NO TE

If the system displays a message indicating that the network is disconnected or the plugin does not exist when you search for a plugin tool, rectify the fault by referring to What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio.

----End

5.6 Configuring the Compilation Environment

If you have developed a program using an operator or application project, you need to configure the compilation environment to build and run the project.

Prerequisites ● The version of the Ascend-CANN-Toolkit on the MindStudio installation server must be the same as that of the CANN software package in the operating environment. ● The Ascend-CANN-Toolkit must be installed on the MindStudio installation server, with the corresponding CANN software package in the operating environment. ● The GCC version in the MindStudio installation server environment cannot be later than that in the operating environment. Otherwise, the functions may be affected.

Installing the Compiler

Install different compilers based on the product form, and the OS and architecture of the operating environment.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 80 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

NO TE

After the compilation environment is configured, restart MindStudio for the configuration to take effect. ● Form Ascend EP

Table 5-12 Compiler commands

MindStu OS and Compiler dio Architectu Installat re of the ion Operating Server Environme OS and nt Architec ture

Ubuntu1 CentOS7.6/ Run the g++ --version command on the 8.04+x86 8.2+x86 MindStudio installation server as the MindStudio installation user to check whether the compiler has been installed. If not, run the following installation command to install the compiler: sudo apt-get install -y g++ If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

Ubuntu18. Run the aarch64-linux--g++ --version 04/ command on the MindStudio installation server as CentOS7.6/ the MindStudio installation user to check whether EulerOS2.8 the compiler has been installed. If not, run the +aarch64 following command to install the compiler: sudo apt-get install -y g++-aarch64-linux-gnu If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

CentOS7. Ubuntu18. Run the gcc --version command on the 6+x86 04+x86 MindStudio installation server as the MindStudio installation user to check whether the compiler has been installed. If not, install the compiler as follows: 1. Install gcc-7.3.0. For details, see Installing GCC 7.3.0. 2. Configure environment variables. $ {install_path} indicates the GCC 7.3.0 installation path. export LD_LIBRARY_PATH=${install_path}/lib64:$ {LD_LIBRARY_PATH} export PATH=${install_path}/bin:${PATH}

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 81 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

MindStu OS and Compiler dio Architectu Installat re of the ion Operating Server Environme OS and nt Architec ture

Ubuntu18. Run the aarch64-linux-gnu-gcc --version 04/ command on the MindStudio installation server as CentOS7.6/ the MindStudio installation user to check whether EulerOS2.8 the compiler has been installed. If not, install the +aarch64 compiler as follows: 1. Obtain the installation package. wget --no-check-certificate https://releases.linaro.org/ components/toolchain/binaries/latest-7/aarch64-linux- gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux- gnu.tar.xz 2. Decompress the installation package. tar -xvJf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux- gnu.tar.xz 3. Set the environment variables. vi ~/.bashrc export PATH=$HOME/gcc-linaro-7.5.0-2019.12- x86_64_aarch64-linux-gnu/bin:$PATH 4. Press Esc and run the :wq! command to save the configurations and exit. 5. Run the source ~/.bashrc command for the modifications to take effect. If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 82 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

MindStu OS and Compiler dio Architectu Installat re of the ion Operating Server Environme OS and nt Architec ture

CentOS8. CentOS8.2 Run the aarch64-linux-gnu-gcc --version 2+x86 +aarch64 command on the MindStudio installation server as the MindStudio installation user to check whether the compiler has been installed. If not, install the compiler as follows: 1. Obtain the installation package. wget --no-check-certificate https://releases.linaro.org/ components/toolchain/binaries/latest-7/aarch64-linux- gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux- gnu.tar.xz 2. Decompress the installation package. tar -xvJf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux- gnu.tar.xz 3. Set the environment variables. vi ~/.bashrc export PATH=$HOME/gcc-linaro-7.5.0-2019.12- x86_64_aarch64-linux-gnu/bin:$PATH 4. Press Esc and run the :wq! command to save the configurations and exit. 5. Run the source ~/.bashrc command for the modifications to take effect. If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

● Form Ascend RC

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 83 MindStudio Installation Guide 5 Manual Installation Guide (Linux)

Table 5-13 Compiler commands MindStu OS and Compiler dio Architectu Installat re of the ion Operating Server Environm OS and ent Architec ture

Ubuntu1 Ubuntu18. Run the aarch64-linux-gnu-gcc --version 8.04+x86 04+aarch6 command on the MindStudio installation server as 4 the MindStudio installation user to check whether the compiler has been installed. If not, run the following command to install the compiler: sudo apt-get install g++-aarch64-linux-gnu If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

CentOS7 CentOS7.6 Run the aarch64-linux-gnu-g++ --version .6+x86 +aarch64 command on the MindStudio installation server as the MindStudio installation user to check whether the compiler has been installed. If not, install the compiler as follows: 1. Obtain the installation package. wget --no-check-certificate https://releases.linaro.org/ components/toolchain/binaries/latest-7/aarch64-linux-gnu/ gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz 2. Decompress the installation package. tar -zxvf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux- gnu.tar.xz 3. Set the environment variables. sudo vi /etc/profile export PATH=/root/gcc-linaro-7.5.0-2019.12-x86_64_aarch64- linux-gnu/bin:$PATH 4. Press Esc and run the :wq! command to save the configurations and exit. 5. Run the source /etc/profile command. If there are multiple cross compilers on the MindStudio installation server, create a soft link between the used cross compiler and the required cross compiler version. The command is as follows: sudo ln -s Cross compiler of another version Required version

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 84 MindStudio Installation Guide 6 Installing Dependencies

6 Installing Dependencies

6.1 Ubuntu18.04 (x86_64) 6.2 Ubuntu18.04 (AArch64) 6.3 EulerOS 2.8 (AArch64) 6.4 openEuler 20.03 (x86_64) 6.5 openEuler20.03 (AArch64) 6.6 CentOS 7.6/8.2 (x86_64) 6.7 CentOS 7.6/8.2 (AArch64) 6.8 Kylin OS V10 SP1 (AArch64) 6.9 NeoKylin OS 7.6 (AArch64) 6.10 Windows 10

6.1 Ubuntu18.04 (x86_64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required software is installed. 1. Check whether the Python dependencies and GCC software are installed. Check whether software including GCC, g++, Make, and Python is installed: gcc --version g++ --version make --version cmake --version unzip --version dpkg -l zlib1g| grep zlib1g| grep ii dpkg -l zlib1g-dev| grep zlib1g-dev| grep ii dpkg -l libbz2-dev| grep libbz2-dev| grep ii dpkg -l libsqlite3-dev| grep libsqlite3-dev| grep ii dpkg -l | grep openssl| grep ii

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 85 MindStudio Installation Guide 6 Installing Dependencies

dpkg -l libssl-dev| grep libssl-dev| grep ii dpkg -l libxslt1-dev| grep libxslt1-dev| grep ii dpkg -l libffi-dev| grep libffi-dev| grep ii dpkg -l libncurses5-dev| grep libncurses5-dev| grep ii dpkg -l libncursesw5-dev| grep libncursesw5-dev| grep ii dpkg -l gnome-keyring| grep gnome-keyring| grep ii dpkg -l pciutils| grep pciutils| grep ii dpkg -l net-tools| grep net-tools| grep ii If the following information is displayed, the software has been installed: g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 GNU Make 4.1 cmake version 3.10.2 UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP. zlib1g:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - runtime zlib1g-dev:amd64 1:1.2.8.dfsg-2ubuntu4.1 amd64 compression library - development libbz2-dev:amd64 1.0.6-8ubuntu0.2 amd64 high-quality block-sorting file compressor library - development libsqlite3-dev:amd64 3.11.0-1ubuntu1.2 amd64 SQLite 3 development files openssl 1.1.1-1ubuntu2.1~18.04.5 amd64 Secure Sockets Layer toolkit - cryptographic utility libssl-dev:amd64 1.0.2g-1ubuntu4.15 amd64 Secure Sockets Layer toolkit - development files libxslt1-dev:amd64 1.1.28-2.1ubuntu0.3 amd64 XSLT 1.0 processing library - development kit libffi-dev:amd64 3.2.1-4 amd64 Foreign Function Interface library (development files) libncurses5-dev:amd64 6.1-1ubuntu1.18.04 amd64 developer's libraries for ncurses libncursesw5-dev:amd64 gnome-keyring 3.28.0.2-1ubuntu1.18.04.1 amd64 GNOME keyring services (daemon and tools) pciutils 1:3.5.2-1ubuntu1.1 amd64 Linux PCI Utilities net-tools 1.60+git20161116.90da8a0-1ubuntu1 amd64 NET-3 networking toolkit Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y gcc g++ make cmake unzip zlib1g zlib1g-dev libbz2-dev libsqlite3-dev openssl libssl-dev libxslt1-dev libffi-dev libncurses5-dev libncursesw5-dev gnome-keyring pciutils net-tools 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 86 MindStudio Installation Guide 6 Installing Dependencies

i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version 3. Check that the library files that MindStudio depends on have been installed. xterm is required for MindStudio to display the dependent library files. Run the dpkg -l xterm| grep xterm| grep ii command to check whether the library files have been installed. If the following information is displayed, the library files have been installed. xterm 322-1ubuntu1 amd64 X terminal emulator Otherwise, run the following command. sudo apt-get install -y xterm 4. Check whether the software for displaying HTML reports is installed for MindStudio. Use the firefox --version and dpkg -l xdg-utils| grep xdg-utils| grep ii commands to check whether dependencies Firefox and xdg-utils for displaying HTML reports are installed. If the following information is displayed, the dependencies have been installed. Mozilla Firefox 71.0 xdg-utils 1.1.1-1ubuntu1.16.04.3 all desktop integration utilities from freedesktop.org Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y firefox xdg-utils 5. Check whether the font software is installed.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 87 MindStudio Installation Guide 6 Installing Dependencies

Viewing the online help in MindStudio requires the font software. Run the following commands to check whether the font software is installed: dpkg -l fonts-droid-fallback| grep fonts-droid-fallback| grep ii dpkg -l fonts-wqy-zenhei| grep fonts-wqy-zenhei| grep ii dpkg -l fonts-wqy-microhei| grep fonts-wqy-microhei| grep ii dpkg -l fonts-arphic-ukai| grep fonts-arphic-ukai| grep ii dpkg -l fonts-arphic-uming| grep fonts-arphic-uming| grep ii If the following information is displayed, the software has been installed: fonts-droid-fallback 1:6.0.1r16-1 all handheld device font with extensive style and language support (fallback) fonts-wqy-zenhei 0.9.45-6ubuntu1 all "WenQuanYi Zen Hei" A Hei-Ti Style (sans-serif) Chinese font fonts-wqy-microhei 0.2.0-beta-2 all Sans-serif style CJK font derived from Droid fonts-arphic-ukai 0.2.20080216.2-4ubuntu2 all "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style fonts-arphic-uming 0.2.20080216.2-7ubuntu2 all "AR PL UMing" Chinese Unicode TrueType font collection Mingti style Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y fonts-droid-fallback fonts-wqy-zenhei fonts-wqy-microhei fonts-arphic-ukai fonts-arphic-uming Step 2 Install the Python 3 dependencies. TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow. Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install sympy --user pip3.7 install cffi --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install matplotlib --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pandas --user pip3.7 install tensorflow==1.15.0 --user pip3.7 install pytest --user During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?. If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 88 MindStudio Installation Guide 6 Installing Dependencies

referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation. Step 3 Install the JDK. Before installing the JDK, run the following command to check whether Java exists in the system:

which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: sudo apt-get install -y openjdk-11-jdk 1. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME

----End

6.2 Ubuntu18.04 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required software is installed. 1. Check whether the Python dependencies and GCC software are installed. Check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version unzip --version dpkg -l zlib1g| grep zlib1g| grep ii dpkg -l zlib1g-dev| grep zlib1g-dev| grep ii

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 89 MindStudio Installation Guide 6 Installing Dependencies

dpkg -l libbz2-dev| grep libbz2-dev| grep ii dpkg -l libsqlite3-dev| grep libsqlite3-dev| grep ii dpkg -l openssl| grep openssl| grep ii dpkg -l libssl-dev| grep libssl-dev| grep ii dpkg -l libxslt1-dev| grep libxslt1-dev| grep ii dpkg -l libffi-dev| grep libffi-dev| grep ii dpkg -l libncurses5-dev| grep libncurses5-dev| grep ii dpkg -l gnome-keyring| grep gnome-keyring| grep ii dpkg -l pciutils| grep pciutils| grep ii dpkg -l net-tools| grep net-tools| grep ii dpkg -l libblas-dev| grep libblas-dev| grep ii dpkg -l gfortran| grep gfortran| grep ii dpkg -l libblas3| grep libblas3| grep ii dpkg -l libopenblas-dev| grep libopenblas-dev| grep ii dpkg -l build-essential | grep build-essential | grep ii dpkg -l libgdbm-dev | grep libgdbm-dev | grep ii dpkg -l libncursesw5-dev | grep libncursesw5-dev | grep ii dpkg -l pkg-config | grep pkg-config | grep ii dpkg -l libglib2.0-dev | grep libglib2.0-dev | grep ii dpkg -l libdbus-glib-1-dev | grep libdbus-glib-1-dev | grep ii dpkg -l gdb | grep gdb | grep ii dpkg -l liblapack-dev | grep liblapack-dev | grep ii dpkg -l m4 | grep m4 | grep ii dpkg -l openjfx | grep openjfx | grep ii dpkg -l libfreetype6-dev | grep libfreetype6-dev | grep ii dpkg -l libqhull-dev | grep libqhull-dev | grep ii dpkg -l -server| grep openssh-server| grep ii dpkg -l libjpeg8| grep libjpeg8| grep ii If the following information is displayed, the software has been installed: gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 g++ (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 GNU Make 4.1 cmake version 3.10.2 UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP. ii zlib1g:arm64 1:1.2.11.dfsg-0ubuntu2 arm64 compression library - runtime ii zlib1g-dev:arm64 1:1.2.11.dfsg-0ubuntu2 arm64 compression library - development ii libbz2-dev:arm64 1.0.6-8.1ubuntu0.2 arm64 high-quality block-sorting file compressor library - development ii libsqlite3-dev:arm64 3.22.0-1ubuntu0.4 arm64 SQLite 3 development files ii openssl 1.1.1-1ubuntu2.1~18.04.7 arm64 Secure Sockets Layer toolkit - cryptographic utility ii libssl-dev:arm64 1.1.1-1ubuntu2.1~18.04.7 arm64 Secure Sockets Layer toolkit - development files dpkg-query: no packages found matching libxslt1-dev ii libffi-dev:arm64 3.2.1-8 arm64 Foreign Function Interface library (development files) ii libncurses5-dev:arm64 6.1-1ubuntu1.18.04 arm64 developer's libraries for ncurses ii gnome-keyring 3.28.0.2-1ubuntu1.18.04.1 arm64 GNOME keyring services (daemon and tools) dpkg-query: no packages found matching pciutils dpkg-query: no packages found matching net-tools ii gfortran 4:7.4.0-1ubuntu2.3 arm64 GNU Fortran 95 compiler ii libopenblas-dev:arm64 0.2.20+ds-4 arm64 Optimized BLAS (linear algebra) library (development files) ii build-essential 12.4ubuntu1 arm64 Informational list of build-essential packages ii libgdbm-dev:arm64 1.14.1-6 arm64 GNU dbm database routines (development files) ii libncursesw5-dev:arm64 6.1-1ubuntu1.18.04 arm64 developer's libraries for ncursesw ii pkg-config 0.29.1-0ubuntu2 arm64 manage compile and link flags for libraries ii libglib2.0-dev:arm64 2.56.4-0ubuntu0.18.04.6 arm64 Development files for the GLib library ii libdbus-glib-1-dev 0.110-2 arm64 deprecated library for D-Bus IPC (development files) ii gdb 8.1.1-0ubuntu1 arm64 GNU Debugger ii liblapack-dev:arm64 3.7.1-4ubuntu1 arm64 Library of linear algebra routines 3 - static version ii m4 1.4.18-1 arm64 macro processing language ii openjfx 11.0.2+1-1~18.04.2 arm64 JavaFX/OpenJFX - Rich client application platform for Java ii libfreetype6-dev:arm64 2.8.1-2ubuntu2.1 arm64 FreeType 2 font engine, development files ii libqhull-dev:arm64 2015.2-4 arm64 calculate convex hulls and related structures (development files) ii openssh-server 1:7.6p1-4ubuntu0.3 arm64 secure shell (SSH) server, for secure access from remote machines

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 90 MindStudio Installation Guide 6 Installing Dependencies

Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y gcc g++ make cmake unzip zlib1g zlib1g-dev libbz2-dev libsqlite3-dev openssl libssl-dev libxslt1-dev libffi-dev libncurses5-dev gnome-keyring pciutils net-tools libblas-dev gfortran libblas3 libopenblas-dev build-essential libgdbm-dev libncursesw5-dev pkg-config libglib2.0-dev libdbus-glib-1-dev gdb liblapack-dev m4 openjfx libfreetype6-dev libqhull-dev openssh-server libjpeg8 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 91 MindStudio Installation Guide 6 Installing Dependencies

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version 3. Check that the library files that MindStudio depends on have been installed. xterm is required for MindStudio to display the dependent library files. Run the dpkg -l xterm| grep xterm| grep ii command to check whether the library files have been installed. If the following information is displayed, the library files have been installed. xterm 322-1ubuntu1 amd64 X terminal emulator Otherwise, run the following command. sudo apt-get install -y xterm 4. Check whether the software for displaying HTML reports is installed for MindStudio. Use the firefox --version and dpkg -l xdg-utils| grep xdg-utils| grep ii commands to check whether dependencies Firefox and xdg-utils for displaying HTML reports are installed. If the following information is displayed, the dependencies have been installed. Mozilla Firefox 71.0 xdg-utils 1.1.1-1ubuntu1.16.04.3 all desktop integration utilities from freedesktop.org Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y firefox xdg-utils 5. Check whether the font software is installed. Viewing the online help in MindStudio requires the font software. Run the following commands to check whether the font software is installed: dpkg -l fonts-droid-fallback| grep fonts-droid-fallback| grep ii dpkg -l fonts-wqy-zenhei| grep fonts-wqy-zenhei| grep ii dpkg -l fonts-wqy-microhei| grep fonts-wqy-microhei| grep ii dpkg -l fonts-arphic-ukai| grep fonts-arphic-ukai| grep ii dpkg -l fonts-arphic-uming| grep fonts-arphic-uming| grep ii If the following information is displayed, the software has been installed: fonts-droid-fallback 1:6.0.1r16-1 all handheld device font with extensive style and language support (fallback) fonts-wqy-zenhei 0.9.45-6ubuntu1 all "WenQuanYi Zen Hei" A Hei-Ti Style (sans-serif) Chinese font

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 92 MindStudio Installation Guide 6 Installing Dependencies

fonts-wqy-microhei 0.2.0-beta-2 all Sans-serif style CJK font derived from Droid fonts-arphic-ukai 0.2.20080216.2-4ubuntu2 all "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style fonts-arphic-uming 0.2.20080216.2-7ubuntu2 all "AR PL UMing" Chinese Unicode TrueType font collection Mingti style Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo apt-get install -y fonts-droid-fallback fonts-wqy-zenhei fonts-wqy-microhei fonts-arphic-ukai fonts-arphic-uming Step 2 Install the Python 3 dependencies. TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow. Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install sympy --user pip3.7 install cffi --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pandas --user pip3.7 install pytest --user pip3.7 install pillow --user pip3.7 install cycler --user pip3.7 install matplotlib --user During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?. If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation. Step 3 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 93 MindStudio Installation Guide 6 Installing Dependencies

sudo apt-get install -y openjdk-11-jdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME Step 4 (Optional) Install TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

6.3 EulerOS 2.8 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required software is installed. 1. Check whether the Python dependencies and GCC software are installed. Check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep openssh-clients rpm -qa | grep openssh-server

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 94 MindStudio Installation Guide 6 Installing Dependencies

rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-deve rpm -qa | grep xdg-utils If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 4.2.1 cmake version 3.12.1 automake-1.16.1-5.eulerosv2r8.noarch kernel-devel-4.19.36-vhulk1907.1.0.h821.eulerosv2r8.aarch64 zlib-devel-1.2.11-14.h1.eulerosv2r8.aarch64 bzip2-devel-1.0.6-29.h2.eulerosv2r8.aarch64 sqlite-devel-3.24.0-2.h19.eulerosv2r8.aarch64 openssl-devel-1.1.1-3.h11.eulerosv2r8.aarch64 libxslt-devel-1.1.32-3.h6.eulerosv2r8.aarch64 libffi-devel-3.1-18.h3.eulerosv2r8.aarch64 gnome-keyring-3.28.2-2.eulerosv2r8.aarch64 glib2-devel-2.58.1-1.h4.eulerosv2r8.aarch64 glib2-2.58.1-1.h4.eulerosv2r8.aarch64 dbus-glib-devel-0.110-3.h3.eulerosv2r8.aarch64 xterm-334-1.eulerosv2r8.aarch64 xterm-resize-334-1.eulerosv2r8.aarch64 openssh-clients-7.8p1-3.h39.eulerosv2r8.aarch64 openssh-server-7.8p1-3.h39.eulerosv2r8.aarch64 ncurses-devel-6.1-8.20180923.h1.eulerosv2r8.aarch64 readline-devel-7.0-12.eulerosv2r8.aarch64 gdb-gdbserver-8.2-3.h5.eulerosv2r8.aarch64 atlas-devel-3.10.3-6.h8.eulerosv2r8.aarch64 atlas-3.10.3-6.h8.eulerosv2r8.aarch64 atlas-devel-3.10.3-6.h8.eulerosv2r8.aarch64 lapack-devel-3.8.0-10.eulerosv2r8.aarch64 lapack-3.8.0-10.eulerosv2r8.aarch64 lapack-devel-3.8.0-10.eulerosv2r8.aarch64 gcc-gfortran-7.3.0-20190804.h24.eulerosv2r8.aarch64 initscripts-10.01-1.h17.eulerosv2r8.aarch64 freetype-devel-2.9.1-2.eulerosv2r8.aarch64 libpng-devel-1.6.34-6.h3.eulerosv2r8.aarch64 xdg-utils-1.1.3-3.eulerosv2r8.noarch Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh- clients openssh-server ncurses-devel readline-devel gdb-gdbserver atlas atlas-devel lapack lapack- devel gcc-gfortran initscripts freetype-devel libpng-devel xdg-utils 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 95 MindStudio Installation Guide 6 Installing Dependencies

make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version

Step 2 Install the Python 3 dependencies.

TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 96 MindStudio Installation Guide 6 Installing Dependencies

Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install sympy --user pip3.7 install cffi --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pandas --user pip3.7 install pytest --user

During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?.

If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation.

Step 3 Compile and install Matplotlib as the root user. Common installation users can directly use Matplotlib. 1. Run the wget command to download the source code package of matplotlib-3.3.3 to any directory of the MindStudio installation server: wget https://files.pythonhosted.org/packages/7b/ b3/7c48f648bf83f39d4385e0169d1b68218b838e185047f7f613b1cfc57947/matplotlib-3.3.3.tar.gz 2. Go to the download directory and decompress the source code package: tar -zxvf matplotlib-3.3.3.tar.gz 3. Go to the decompressed folder and run the following commands: cd matplotlib-3.3.3 python3.7.5 setup.py build python3.7.5 setup.py install

NO TE

If the python3.7.5 setup.py build command fails, perform the following steps: 1. Check whether the build directory exists. If the directory does not exist, run the mkdir build command to create the directory. 2. Run the cd build command to open the build directory. 3. Run the wget –no-check-certificate https://downloads.sourceforge.net/project/ freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz command to download the installation package. 4. Run the tar -zxvf freetype-2.6.1.tar.gz command to decompress the installation package. 5. Perform Step 3.3 again.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 97 MindStudio Installation Guide 6 Installing Dependencies

Step 4 Install jbr. 1. Log in to https://jetbrains.bintray.com/intellij-jbr/ to download the jbr-11_0_9- linux-aarch64-b944.49.tar.gz package. 2. Install jbr. Decompress the jbr package to the root directory of MindStudio. Step 5 (Optional) Install TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

6.4 openEuler 20.03 (x86_64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required dependent software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep openssh-clients rpm -qa | grep openssh-server rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-deve rpm -qa | grep xdg-utils If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 4.3 cmake version 3.16.5 automake-1.16.2-1.oe1.noarch kernel-devel-4.19.90-2012.5.0.0054.oe1.x86_64 zlib-devel-1.2.11-17.oe1.x86_64 bzip2-devel-1.0.8-3.oe1.x86_64

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 98 MindStudio Installation Guide 6 Installing Dependencies

sqlite-devel-3.32.3-2.oe1.x86_64 openssl-devel-1.1.1f-1.oe1.x86_64 libxslt-devel-1.1.34-3.oe1.x86_64 libffi-devel-3.3-7.oe1.x86_64 gnome-keyring-3.28.2-3.oe1.x86_64 glib2-2.62.5-2.oe1.x86_64 glib2-devel-2.62.5-2.oe1.x86_64 glib2-help-2.62.5-2.oe1.noarch dbus-glib-devel-0.110-5.oe1.x86_64 xterm-334-4.oe1.x86_64 ncurses-devel-6.2-1.oe1.x86_64 readline-devel-8.0-3.oe1.x86_64 lapack-devel-3.9.0-2.oe1.x86_64 lapack-3.9.0-2.oe1.x86_64 lapack-devel-3.9.0-2.oe1.x86_64 gcc-gfortran-7.3.0-20190804.35.oe1.x86_64 initscripts-10.04-1.oe1.x86_64 freetype-devel-2.10.2-2.oe1.x86_64 Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh- clients openssh-server ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel libjpeg-devel xdg-utils Step 2 Install the Python 3 dependencies. TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow. Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install sympy --user pip3.7 install cffi --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pandas --user pip3.7 install pytest --user pip3.7 install matplotlib --user During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?. If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 99 MindStudio Installation Guide 6 Installing Dependencies

referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation. Step 3 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: sudo yum install -y java-11-openjdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME

----End

6.5 openEuler20.03 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required dependent software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2-devel

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 100 MindStudio Installation Guide 6 Installing Dependencies

rpm -qa | grep sqlite-devel rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep openssh-clients rpm -qa | grep openssh-server rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-deve rpm -qa | grep libjpeg-devel rpm -qa | grep xdg-utils If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 4.3 cmake version 3.16.5 automake-1.16.2-1.oe1.noarch kernel-devel-4.19.90-2012.5.0.0054.oe1.aarch64 zlib-devel-1.2.11-17.oe1.aarch64 bzip2-devel-1.0.8-3.oe1.aarch64 sqlite-devel-3.32.3-2.oe1.aarch64 openssl-devel-1.1.1f-1.oe1.aarch64 libxslt-devel-1.1.34-3.oe1.aarch64 libffi-devel-3.3-7.oe1.aarch64 gnome-keyring-3.28.2-3.oe1.aarch64 glib2-2.62.5-2.oe1.aarch64 glib2-devel-2.62.5-2.oe1.aarch64 glib2-help-2.62.5-2.oe1.noarch dbus-glib-devel-0.110-5.oe1.aarch64 xterm-334-4.oe1.aarch64 ncurses-devel-6.2-1.oe1.aarch64 readline-devel-8.0-3.oe1.aarch64 lapack-devel-3.9.0-2.oe1.aarch64 lapack-3.9.0-2.oe1.aarch64 lapack-devel-3.9.0-2.oe1.aarch64 gcc-gfortran-7.3.0-20190804.35.oe1.aarch64 initscripts-10.04-1.oe1.aarch64 freetype-devel-2.10.2-2.oe1.aarch64 Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel libjpeg-devel xdg-utils

Step 2 Install the Python 3 dependencies.

TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow.

Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 101 MindStudio Installation Guide 6 Installing Dependencies

them. You can modify the following command to install only some of them as required. pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install sympy --user pip3.7 install cffi --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pandas --user pip3.7 install pytest --user pip3.7 install matplotlib --user During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?. If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation. Step 3 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: sudo yum install -y java-11-openjdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 102 MindStudio Installation Guide 6 Installing Dependencies

echo $JAVA_HOME

Step 4 (Optional) Install TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

6.6 CentOS 7.6/8.2 (x86_64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required dependent software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2 rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep openssh-clients rpm -qa | grep openssh-server rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-devel rpm -qa | grep xdg-utils rpm -qa | grep firefox rpm -qa | grep unzip rpm -qa | grep pciutils rpm -qa | grep net-tools rpm -qa | grep blas rpm -qa | grep blas-devel rpm -qa | grep openssh-askpass rpm -qa | grep texinfo If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 3.82

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 103 MindStudio Installation Guide 6 Installing Dependencies

cmake version 3.6.2 automake-1.13.4-3.el7.noarch kernel-devel-3.10.0-1160.11.1.el7.x86_64 zlib-devel-1.2.7-18.el7.x86_64 bzip2-1.0.6-13.el7.x86_64 bzip2-libs-1.0.6-13.el7.x86_64 bzip2-devel-1.0.6-13.el7.x86_64 bzip2-devel-1.0.6-13.el7.x86_64 sqlite-devel-3.7.17-8.el7_7.1.x86_64 openssl-devel-1.0.2k-21.el7_9.x86_64 openssl-1.0.2k-21.el7_9.x86_64 openssl-libs-1.0.2k-21.el7_9.x86_64 openssl-devel-1.0.2k-21.el7_9.x86_64 libxslt-devel-1.1.28-6.el7.x86_64 libffi-devel-3.0.13-19.el7.x86_64 gnome-keyring-3.28.2-1.el7.x86_64 glib2-devel-2.56.1-8.el7.x86_64 glib2-2.56.1-8.el7.x86_64 dbus-glib-devel-0.100-7.el7.x86_64 xterm-295-3.el7.x86_64 openssh-clients-7.4p1-21.el7.x86_64 openssh-server-7.4p1-21.el7.x86_64 ncurses-devel-5.9-14.20130511.el7_4.x86_64 readline-devel-6.2-11.el7.x86_64 lapack-devel-3.4.2-8.el7.x86_64 lapack-3.4.2-8.el7.x86_64 lapack-devel-3.4.2-8.el7.x86_64 gcc-gfortran-4.8.5-44.el7.x86_64 initscripts-9.49.53-1.el7_9.1.x86_64 freetype-devel-2.8-14.el7_9.1.x86_64 libpng-devel-1.5.13-8.el7.x86_64 xdg-utils-1.1.0-0.17.20120809git.el7.noarch firefox-78.6.1-1.el7.centos.x86_64 unzip-6.0-21.el7.x86_64 pciutils-libs-3.5.1-3.el7.x86_64 pciutils-3.5.1-3.el7.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 blas-devel-3.4.2-8.el7.x86_64 blas-3.4.2-8.el7.x86_64 blas-devel-3.4.2-8.el7.x86_64 openssh-askpass-7.4p1-21.el7.x86_64 texinfo-5.1-5.el7.x86_64 Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. – For CentOS 7.6, run the following command: sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite-devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh-clients openssh-server ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas-devel openssh-askpass texinfo – For CentOS 8.2, run the following command: sudo dnf install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh- clients openssh-server ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas- devel openssh-askpass texinfo 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 104 MindStudio Installation Guide 6 Installing Dependencies

b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version Step 2 Install the Python 3 dependencies. TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 105 MindStudio Installation Guide 6 Installing Dependencies

Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow.

Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install --upgrade pip --user pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pytest --user pip3.7 install wheel --user pip3.7 install pyyaml --user pip3.7 install pathlib2 --user pip3.7 install sympy==1.4.0 --user pip3.7 install pandas==1.1.5 --user pip3.7 install pillow==8.0.1 --user pip3.7 install cffi==1.12.3 --user pip3.7 install pyparsing>=2.0.3 --user pip3.7 install matplotlib --user pip3.7 install xlwt --user pip3.7 install xlutils --user pip3.7 install Cython --user pip3.7 install tensorflow==1.15.0 --user

During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?.

If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation.

Step 3 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: – For CentOS 7.6, run the following command: sudo yum install -y java-11-openjdk – For CentOS 8.2, run the following command: sudo dnf install -y java-11-openjdk

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 106 MindStudio Installation Guide 6 Installing Dependencies

2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME

----End

6.7 CentOS 7.6/8.2 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2 rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep openssh-clients rpm -qa | grep openssh-server rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 107 MindStudio Installation Guide 6 Installing Dependencies

rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-devel rpm -qa | grep libjpeg-devel rpm -qa | grep xdg-utils rpm -qa | grep firefox rpm -qa | grep unzip rpm -qa | grep pciutils rpm -qa | grep net-tools rpm -qa | grep blas rpm -qa | grep blas-devel rpm -qa | grep openssh-askpass rpm -qa | grep texinfo If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 3.82 cmake version 3.6.2 automake-1.13.4-3.el7.noarch kernel-devel-4.18.0-193.28.1.el7.aarch64 zlib-devel-1.2.7-18.el7.aarch64 bzip2-1.0.6-13.el7.aarch64 bzip2-libs-1.0.6-13.el7.aarch64 bzip2-devel-1.0.6-13.el7.aarch64 bzip2-devel-1.0.6-13.el7.aarch64 sqlite-devel-3.7.17-8.el7_7.1.aarch64 openssl-devel-1.0.2k-21.el7_9.aarch64 openssl-1.0.2k-21.el7_9.aarch64 openssl-libs-1.0.2k-21.el7_9.aarch64 openssl-devel-1.0.2k-21.el7_9.aarch64 libxslt-devel-1.1.28-6.el7.aarch64 libffi-devel-3.0.13-19.el7.aarch64 gnome-keyring-3.28.2-1.el7.aarch64 glib2-devel-2.56.1-8.el7.aarch64 glib2-2.56.1-8.el7.aarch64 dbus-glib-devel-0.100-7.el7.aarch64 xterm-295-3.el7.aarch64 openssh-clients-7.4p1-21.el7.aarch64 openssh-server-7.4p1-21.el7.aarch64 ncurses-devel-5.9-14.20130511.el7_4.aarch64 readline-devel-6.2-11.el7.aarch64 lapack-devel-3.4.2-8.el7.aarch64 lapack-3.4.2-8.el7.aarch64 lapack-devel-3.4.2-8.el7.aarch64 gcc-gfortran-4.8.5-44.el7.aarch64 initscripts-9.49.53-1.el7_9.1.aarch64 freetype-devel-2.8-14.el7_9.1.aarch64 libpng-devel-1.5.13-8.el7.aarch64 xdg-utils-1.1.0-0.17.20120809git.el7.noarch firefox-78.6.1-1.el7.centos.aarch64 unzip-6.0-21.el7.aarch64 pciutils-libs-3.5.1-3.el7.aarch64 pciutils-3.5.1-3.el7.aarch64 net-tools-2.0-0.25.20131004git.el7.aarch64 blas-devel-3.4.2-8.el7.aarch64 blas-3.4.2-8.el7.aarch64 blas-devel-3.4.2-8.el7.aarch64 openssh-askpass-7.4p1-21.el7.aarch64 texinfo-5.1-5.el7.aarch64 Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. – For CentOS 7.6, run the following command: sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite-devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 108 MindStudio Installation Guide 6 Installing Dependencies

openssh-clients openssh-server ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel libjpeg-devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas-devel openssh-askpass texinfo – For CentOS 8.2, run the following command: sudo dnf install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm openssh- clients openssh-server ncurses-devel readline-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng-devel libjpeg-devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas-devel openssh-askpass texinfo 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 109 MindStudio Installation Guide 6 Installing Dependencies

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version

Step 2 Install the Python 3 dependencies.

TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow.

Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install --upgrade pip --user pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pytest --user pip3.7 install wheel --user pip3.7 install pyyaml --user pip3.7 install pathlib2 --user pip3.7 install sympy==1.4.0 --user pip3.7 install pandas==1.1.5 --user pip3.7 install pillow==8.0.1 --user pip3.7 install cffi==1.12.3 --user pip3.7 install pyparsing>=2.0.3 --user pip3.7 install xlwt --user pip3.7 install xlutils --user

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 110 MindStudio Installation Guide 6 Installing Dependencies

pip3.7 install Cython --user pip3.7 install matplotlib --user During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?. If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation. Step 3 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: – For CentOS 7.6, run the following command: sudo yum install -y java-11-openjdk – For CentOS 8.2, run the following command: sudo dnf install -y java-11-openjdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME Step 4 (Optional) Install TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 111 MindStudio Installation Guide 6 Installing Dependencies

6.8 Kylin OS V10 SP1 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required dependent software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2 rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep gdb-gdbserve rpm -qa | grep atlas rpm -qa | grep atlas-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-devel rpm -qa | grep xdg-utils rpm -qa | grep firefox rpm -qa | grep unzip rpm -qa | grep pciutils rpm -qa | grep net-tools rpm -qa | grep blas rpm -qa | grep blas-devel rpm -qa | grep texinfo If the following information is displayed, the software has been installed: gcc (GCC) 7.3.0 g++ (GCC) 7.3.0 GNU Make 4.2.1 cmake version 3.12.1 automake-1.16.1-6.ky10.noarch kernel-devel-4.19.90-17.ky10.aarch64 zlib-devel-1.2.11-17.1.ky10.aarch64 bzip2-1.0.8-3.ky10.aarch64 bzip2-devel-1.0.8-3.ky10.aarch64 bzip2-devel-1.0.8-3.ky10.aarch64 sqlite-devel-3.24.0-9.ky10.aarch64

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 112 MindStudio Installation Guide 6 Installing Dependencies

openssl-libs-1.1.1d-9.ky10.aarch64 openssl-devel-1.1.1d-9.ky10.aarch64 openssl-1.1.1d-9.ky10.aarch64 openssl-pkcs11-0.4.10-1.ky10.aarch64 openssl-devel-1.1.1d-9.ky10.aarch64 libxslt-devel-1.1.32-7.ky10.aarch64 libffi-devel-3.3-7.ky10.aarch64 gnome-keyring-3.28.2-3.ky10.aarch64 glib2-2.62.1-1.ky10.aarch64 glib2-devel-2.62.1-1.ky10.aarch64 dbus-glib-devel-0.110-5.ky10.aarch64 xterm-334-4.ky10.aarch64 ncurses-devel-6.1-14.ky10.aarch64 readline-devel-7.0-13.ky10.aarch64 gdb-gdbserver-8.3.1-11.ky10.aarch64 atlas-devel-3.10.3-9.ky10.aarch64 atlas-3.10.3-9.ky10.aarch64 atlas-devel-3.10.3-9.ky10.aarch64 lapack-3.8.0-16.ky10.aarch64 lapack-devel-3.8.0-16.ky10.aarch64 lapack-devel-3.8.0-16.ky10.aarch64 gcc-gfortran-7.3.0-20190804.h30.ky10.aarch64 initscripts-10.01-6.ky10.aarch64 freetype-devel-2.9.1-5.ky10.aarch64 libpng-devel-1.6.36-4.ky10.aarch64 xdg-utils-1.1.3-4.ky10.noarch firefox-60.7.0-1.p05.ky10.aarch64 unzip-6.0-45.ky10.aarch64 pciutils-3.6.2-5.ky10.aarch64 net-tools-2.0-0.54.ky10.aarch64 openblas-devel-0.3.3-3.ky10.aarch64 openblas-0.3.3-3.ky10.aarch64 openblas-devel-0.3.3-3.ky10.aarch64 texinfo-6.6-2.ky10.aarch64 Otherwise, run the following command to install the software. You can modify the following command to install only some of them as required. sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm readline-devel gdb-gdbserver atlas atlas-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng- devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas-devel texinfo 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 113 MindStudio Installation Guide 6 Installing Dependencies

This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version Step 2 Install the Python 3 dependencies. TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow. Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install --upgrade pip --user pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 114 MindStudio Installation Guide 6 Installing Dependencies

pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pytest --user pip3.7 install wheel --user pip3.7 install pyyaml --user pip3.7 install pathlib2 --user pip3.7 install sympy==1.4.0 --user pip3.7 install pandas==1.1.5 --user pip3.7 install pillow==8.0.1 --user pip3.7 install cffi==1.12.3 --user pip3.7 install pyparsing>=2.0.3 --user pip3.7 install xlwt --user pip3.7 install xlutils --user pip3.7 install Cython --user pip3.7 install matplotlib --user

During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?.

If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation.

Step 3 Install Matplotlib in the user directory. pip3.7.5 install matplotlib -i https://mirrors.aliyun.com/pypi/simple/ --user

Step 4 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: sudo yum install -y java-11-openjdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq!

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 115 MindStudio Installation Guide 6 Installing Dependencies

d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME Step 5 (Optional) Install TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

6.9 NeoKylin OS 7.6 (AArch64)

NO TE

● If you install the following dependencies as the root user, delete sudo or --user from the commands. ● If you install the following dependencies as a non-root user, run the su - username command to switch to the MindStudio installation user.

Step 1 Check whether the required dependent software is installed. 1. Check whether the Python dependencies and GCC software are installed. Run the following commands to check whether software including GCC, g++, and Make are installed: gcc --version g++ --version make --version cmake --version rpm -qa | grep automake rpm -qa | grep kernel-devel rpm -qa | grep zlib-devel rpm -qa | grep bzip2 rpm -qa | grep bzip2-devel rpm -qa | grep sqlite-devel rpm -qa | grep openssl rpm -qa | grep openssl-devel rpm -qa | grep libxslt-devel rpm -qa | grep libffi-devel rpm -qa | grep gnome-keyring rpm -qa | grep glib2 rpm -qa | grep dbus-glib-devel rpm -qa | grep xterm rpm -qa | grep ncurses-devel rpm -qa | grep readline-devel rpm -qa | grep gdb-gdbserve rpm -qa | grep atlas rpm -qa | grep atlas-devel rpm -qa | grep lapack rpm -qa | grep lapack-devel rpm -qa | grep gcc-gfortran rpm -qa | grep initscripts rpm -qa | grep freetype-devel rpm -qa | grep libpng-devel rpm -qa | grep xdg-utils rpm -qa | grep firefox rpm -qa | grep unzip rpm -qa | grep pciutils rpm -qa | grep net-tools rpm -qa | grep blas rpm -qa | grep blas-devel rpm -qa | grep texinfo

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 116 MindStudio Installation Guide 6 Installing Dependencies

If the following information is displayed, the software has been installed: gcc (GCC) 4.8.5 20150623 (NeoKylin 4.8.5-39) g++ (GCC) 4.8.5 20150623 (NeoKylin 4.8.5-39) GNU Make 3.82 cmake version 2.8.12.2 automake-1.13.4-3.el7.noarch kernel-devel-4.14.0-115.26.1.el7a.02.aarch64 zlib-devel-1.2.7-18.el7.aarch64 bzip2-devel-1.0.6-13.el7.aarch64 bzip2-1.0.6-13.el7.aarch64 bzip2-libs-1.0.6-13.el7.aarch64 bzip2-devel-1.0.6-13.el7.aarch64 sqlite-devel-3.7.17-8.el7_7.1.aarch64 openssl-libs-1.0.2k-21.el7_9.ns7.01.aarch64 openssl-devel-1.0.2k-21.el7_9.ns7.01.aarch64 openssl-1.0.2k-21.el7_9.ns7.01.aarch64 openssl-devel-1.0.2k-21.el7_9.ns7.01.aarch64 libxslt-devel-1.1.28-5.el7.aarch64 libffi-devel-3.0.13-18.el7.aarch64 gnome-keyring-3.28.2-1.el7.aarch64 glib2-2.56.1-4.el7_6.aarch64 glib2-devel-2.56.1-4.el7_6.aarch64 dbus-glib-devel-0.100-7.el7.aarch64 xterm-295-3.el7.aarch64 ncurses-devel-6.1-13.ft.aarch64 readline-devel-6.2-10.el7.aarch64 gdb-gdbserver-7.6.1-114.el7.aarch64 atlas-devel-3.10.1-12.el7.aarch64 atlas-3.10.1-12.el7.aarch64 atlas-devel-3.10.1-12.el7.aarch64 lapack-devel-3.4.2-8.el7.aarch64 lapack-3.4.2-8.el7.aarch64 lapack-devel-3.4.2-8.el7.aarch64 gcc-gfortran-4.8.5-39.el7.ns7.01.aarch64 initscripts-9.49.46-1.el7.aarch64 freetype-devel-2.8-12.el7.aarch64 libpng-devel-1.5.13-7.el7_2.aarch64 firefox-52.7.2-1.el7_4.ns7.02.aarch64 unzip-6.0-19.el7.aarch64 pciutils-libs-3.5.1-3.el7.aarch64 pciutils-3.5.1-3.el7.aarch64 net-tools-2.0-0.24.20131004git.el7.ns7.01.aarch64 openblas-threads64-0.3.3-2.el7.aarch64 openblas-threads64_-0.3.3-2.el7.aarch64 blas-3.4.2-8.el7.aarch64 openblas-openmp-0.3.3-2.el7.aarch64 openblas-serial64-0.3.3-2.el7.aarch64 openblas-openmp64-0.3.3-2.el7.aarch64 openblas-openmp64_-0.3.3-2.el7.aarch64 openblas-serial64_-0.3.3-2.el7.aarch64 openblas-devel-0.3.3-2.el7.aarch64 openblas-serial-0.3.3-2.el7.aarch64 openblas-0.3.3-2.el7.aarch64 openblas-devel-0.3.3-2.el7.aarch64 blas-devel-3.4.2-8.el7.aarch64 blas-devel-3.4.2-8.el7.aarch64 texinfo-5.1-5.el7.aarch64 Otherwise, run the following command to install the software. You can change the following command to install only some of them as required. sudo yum install -y gcc gcc-c++ make cmake automake kernel-devel zlib-devel bzip2-devel sqlite- devel openssl-devel libxslt-devel libffi-devel gnome-keyring glib2 dbus-glib-devel xterm readline-devel gdb-gdbserver atlas atlas-devel lapack lapack-devel gcc-gfortran initscripts freetype-devel libpng- devel xdg-utils bzip2 openssl firefox unzip pciutils net-tools blas blas-devel texinfo

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 117 MindStudio Installation Guide 6 Installing Dependencies

NO TE

The operator UT and the installation of some dependencies depend on GCC 7.3.0. Therefore, upgrade the GCC to 7.3.0 to ensure a successful UT and dependency installation. 2. Check whether the Python development environment is installed. Run the python3.7 --version command. If the returned information meets the Python version requirements (3.7.0 to 3.7.9), go to the next step. Otherwise, use the following procedure to install Python 3.7.5: a. Run the wget command to download the source code package of Python 3.7.5 to any directory of the MindStudio installation server: wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz b. Go to the download directory and decompress the source code package: tar -zxvf Python-3.7.5.tgz c. Go to the new folder and run the following configuration, compilation, and installation commands: cd Python-3.7.5 ./configure --prefix=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make sudo make install The --prefix parameter specifies the Python installation path. You can change it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. This document uses --prefix=/usr/local/python3.7.5 as an example. After the configuration, build, and installation commands are executed, the installation package is output to the /usr/local/python3.7.5 directory, and the libpython3.7m.so.1.0 dynamic library is output to the /usr/ local/python3.7.5/lib/libpython3.7m.so.1.0 directory. d. Set the Python 3.7.5 environment variables. i. Run the vi ~/.bashrc command in any directory as the installation user to open the .bashrc file and append the following line to the file: # Set the Python 3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ii. Run the :wq! command to save the file and exit. iii. Run the source ~/.bashrc command for the modification to take effect immediately.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 118 MindStudio Installation Guide 6 Installing Dependencies

NO TE

To ensure that the python 3.7.5 environment variables can be automatically configured when you install the CANN software package and run related services, create the use_private_python.info file in advance. The following is an example: 1. Run the following command to create the file: ○ User root: vi /etc/use_private_python.info ○ Non-root user. The HwHiAiUser user is used as an example. vi /home/HwHiAiUser/use_private_python.info 2. Add the following content to the file: python37_install_path=/usr/local/python3.7.5 In the preceding command, /usr/local/python3.7.5 indicates the Python 3.7.5 installation path. Replace it as required. 3. Run the :wq! command to save the file and exit. e. After the installation is complete, run the following commands to check the installed version. If the required version information is displayed, the installation is successful. python3.7 --version pip3.7 --version

Step 2 Install the Python 3 dependencies.

TBE depends on NumPy and decorator. TIK depends on SymPy, CFFI, and GNU readline. The uTST tool depends on the coverage software. Model Accuracy Analyzer depends on protobuf and SciPy. Profiling depends on protobuf, grpcio, grpcio-tools, and requests. If you want to use the operator ST cases to obtain the operator shape and more from the model, you need to install TensorFlow. Otherwise, you do not need to install TensorFlow.

Before the installation, run the pip3.7.5 list command to check whether dependencies have been installed. If not, run the following command to install them. You can modify the following command to install only some of them as required. pip3.7 install --upgrade pip --user pip3.7 install attrs --user pip3.7 install psutil --user pip3.7 install decorator --user pip3.7 install numpy --user pip3.7 install protobuf==3.13.0 --user pip3.7 install scipy --user pip3.7 install gnureadline --user pip3.7 install coverage --user pip3.7 install pylint --user pip3.7 install grpcio --user pip3.7 install grpcio-tools --user pip3.7 install requests --user pip3.7 install xlrd==1.2.0 --user pip3.7 install absl-py --user pip3.7 install pytest --user pip3.7 install wheel --user pip3.7 install pyyaml --user pip3.7 install pathlib2 --user pip3.7 install sympy==1.4.0 --user pip3.7 install pandas==1.1.5 --user pip3.7 install pillow==8.0.1 --user pip3.7 install cffi==1.12.3 --user pip3.7 install pyparsing>=2.0.3 --user pip3.7 install xlwt --user pip3.7 install xlutils --user

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 119 MindStudio Installation Guide 6 Installing Dependencies

pip3.7 install Cython --user pip3.7 install matplotlib --user

During command execution, if the network connection fails and the message "Could not find a version that satisfies the requirement xxx" is displayed, rectify the fault by referring to What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?.

If the message "Could not find " or "fatal error:Python.h:No such file or directory" is displayed when you run the preceding commands, rectify the fault by referring to Python.h Is Not Installed or Cannot Be Found During Dependency Installation.

Step 3 Install Matplotlib in the user directory. 1. Go to the user's home directory and run the mkdir .pip command to create a .pip directory. 2. Run the cd .pip command to open the .pip directory. 3. Run the vi pip.conf command to edit the configuration file and add the following content. Then, save the modifications and exit. [global] index-url=http://mirrors.aliyun.com/pypi/simple/ trusted-host=mirrors.aliyun.com 4. Run the pip3.7.5 install matplotlib --user command to install Matplotlib.

Step 4 Install the JDK. 1. Before installing the JDK, run the following command to check whether Java exists in the system: which java If the related path is returned, Java exists. Run the java -version command to check whether the Java version is 11. If no, run the following command to install the JDK: sudo yum install -y java-11-openjdk 2. The installation of MindStudio depends on the JAVA_HOME environment variable. Configure this variable as follows: a. Run the following command in any directory to open the .bashrc file: vi ~/.bashrc b. Append the following lines to the file: export JAVA_HOME=/usr/lib/jvm/java-11-openjdk export PATH=$JAVA_HOME/bin:$PATH

NO TE

JAVA_HOME indicates the JDK installation path. If the JDK has been installed, modify JAVA_HOME as required. If the JDK has been installed according to the preceding steps, skip this modification. c. Save the file and exit. :wq! d. Make the configuration take effect. source ~/.bashrc e. Run the following command to check the environment variable settings. If the returned version number is 11, the installation is successful. echo $JAVA_HOME

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 120 MindStudio Installation Guide 6 Installing Dependencies

Step 5 (Optional) Installing TensorFlow 1.15.0. TensorFlow 1.15.0 is necessary to develop and verify operators and develop training services. For details, see "Installing the Deep Learning Framework" in the CANN 5.0.2 Software Installation Guide.

----End

6.10 Windows 10

Installing the JDK 11 Dependency

Step 1 Download the Java installation package to a local Windows PC. Step 2 In the Windows 10 OS, choose Control Panel > System and Security > System > Advanced system settings. See Figure 6-1.

Figure 6-1 Advance system settings

Step 3 In the System Properties dialog box displayed, click Environment Variables. See Figure 6-2.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 121 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-2 Environment variables

Step 4 In the Environment Variables > User variables dialog box, click New. In the displayed New User Variable dialog box, enter the new environment variable and click OK. See Figure 6-3. ● Variable name: JAVA_HOME ● Variable value: path for installing the Java package

Figure 6-3 New User Variable

Step 5 In the Environment Variables > User variables dialog box, select the Path variable and click Edit. See Figure 6-4.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 122 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-4 Editing the Path environment variable

Step 6 In the Edit environment variable dialog box, click New, enter the path of the bin directory in the Java installation package, and click OK. See Figure 6-5.

Figure 6-5 Creating an environment variable

Step 7 Click OK.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 123 MindStudio Installation Guide 6 Installing Dependencies

Step 8 Open the CLI and run the java -version command to check the Java version.

----End

Installing the Python 3.7.5 Dependency Install this dependency if you want to use the image input function during operator creation and sample project conversion.

Step 1 Download the Python 3.7.5 installation package from the Python official website to a local Windows OS. Step 2 Install Python 3.7.5. Step 3 In the Windows 10 OS, choose Control Panel > System and Security > System > Advanced system settings. See Figure 6-6.

Figure 6-6 Advance system settings

Step 4 In the System Properties dialog box displayed, click Environment Variables. See Figure 6-7.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 124 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-7 Environment variables

Step 5 In the Environment Variables > User variables dialog box, select the Path variable and click Edit. See Figure 6-8.

Figure 6-8 Editing the Path environment variable

Step 6 In the Edit environment variable dialog box, click New, enter the paths of the Python 3.7.5 installation package directory and script directory, for example, D: \python and D:\python\Scripts, and click OK. See Figure 6-9.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 125 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-9 Creating an environment variable

Step 7 Click OK. Step 8 Open the CLI and enter the python -V command to check whether the Python version is 3.7.5. Step 9 Install the Python 3 dependencies. pip install xlrd==1.2.0 pip install absl-py pip install numpy If the following information is displayed, the installation is successful:

Successfully installed xlrd-1.2.0 Successfully installed absl-py-0.12.0 six-1.15.0 Successfully installed numpy-1.20.1

----End

Installing MinGW Dependency Step 1 Download the latest MinGW installation package from https://sourceforge.net/ projects/mingw-w64/files/. Select a version based on the OS. For example, select x86_64-posix-seh for a 64-bit OS.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 126 MindStudio Installation Guide 6 Installing Dependencies

Step 2 Decompress the MinGW installation package to a custom directory.

Step 3 In the Windows 10 OS, choose Control Panel > System and Security > System > Advanced system settings. See Figure 6-10.

Figure 6-10 Advance system settings

Step 4 In the System Properties dialog box displayed, click Environment Variables. See Figure 6-11.

Figure 6-11 Environment variables

Step 5 In the Environment Variables > System variables dialog box, select the Path variable and click Edit. See Figure 6-12.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 127 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-12 Editing the Path environment variable

Step 6 In the Edit environment variable dialog box, click New, enter the path of the bin directory generated after the MinGW installation package is decompressed, for example, D:\mingw64\bin, and click OK. See Figure 6-13.

Figure 6-13 Creating an environment variable

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 128 MindStudio Installation Guide 6 Installing Dependencies

Step 7 Open the CLI and enter the gcc -v command. If message "gcc version x.x.x (x86_64-posix-sjlj-rev0, Built by MinGW-W64 project)" is displayed, the installation is successful.

----End

Installing the ACLlib Package If you need to develop a Windows application and compile or run the application on the local host (only the Windows server with the Atlas accelerator card installed can run the application), install this package and its dependencies. For details, see sections "ACLlib Installation and Uninstallation" and "Development Environment Setup" in the CANN 5.0.1 Windows User Guide.

Installing CMake

Table 6-1 Dependencies Name Version Description How to Obtain

CMake 3.16.5-win64- CMake is a cross-platform Download it from the x64 free and open-source CMake website. (recommended) software tool for managing the build process of software using a compiler- independent method. It supports directory hierarchies and apps that depend on multiple libraries.

You can log in to the CMake official website to download CMake. perform the following steps to install it. An example of MSI package is provided.

Step 1 Press win+R to open the Run box. Type cmd and press Ctrl+Shift+Enter to enter the Command Prompt with administrative privileges. If the User Account Control window is displayed, click Yes. Step 2 Run the installation command: msiexec /package {path}\{name}.msi See the following example: msiexec /package D:\cmake-3.16.5-win64-x64.msi Step 3 In the window shown in Figure 6-14, click Next.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 129 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-14 CMake Setup

Step 4 Enter the End-User License Agreement window, click Next.

Figure 6-15 End-User License Agreement

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 130 MindStudio Installation Guide 6 Installing Dependencies

Step 5 Enter the Install Options window, select Add CMake to the system PATH for all users and click Next.

Figure 6-16 Install Options

Step 6 Enter the Destination Folder window, select a folder, and then click Next.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 131 MindStudio Installation Guide 6 Installing Dependencies

Figure 6-17 Destination Folder

Step 7 Enter the Ready to install CMake, click Install, and wait until the installation is complete.

Figure 6-18 Ready to install CMake

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 132 MindStudio Installation Guide 6 Installing Dependencies

Step 8 Enter the Completed the CMake Setup Wizard window, and click Finish to end the installation.

Figure 6-19 Completed the CMake Setup Wizard

----End

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 133 MindStudio Installation Guide 7 FAQs

7 FAQs

7.1 Configuring a System Network Proxy 7.2 What Do I Do If the GUI Cannot Be Displayed When MindStudio Is Started? 7.3 How Do I Solve the Problem that Chinese Characters Are Displayed as Garbled Characters and the GUI Is Incompletely Displayed or Is Not Well-Organized? 7.4 What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio 7.5 How Do I Get Help and Provide Suggestions? 7.6 What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run? 7.7 Python.h Is Not Installed or Cannot Be Found During Dependency Installation

7.1 Configuring a System Network Proxy

The following procedure is a general method for configuring a network proxy. It may not be applicable to all network environments. The method of configuring the network proxy depends on the actual network environment.

Prerequisites ● The network cable of the server has been connected and the proxy server can connect to the external network. ● The server is located on an intranet and cannot be directly connected to the external network.

Proxy Configuration

Step 1 Log in to the user environment as the root user.

Step 2 Edit the /etc/profile file: vi /etc/profile

Append the following lines to the file, save the file, and exit:

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 134 MindStudio Installation Guide 7 FAQs

export http_proxy="http://user:password@proxyserverip:port" export https_proxy="http://user:password@proxyserverip:port" In the preceding commands, user indicates the username on the intranet, password indicates the user password, proxyserverip indicates the IP address of the proxy server, and port indicates the port number. Step 3 Make the configuration take effect: source /etc/profile Step 4 Check the Internet connectivity: wget www.google.com If the HTML file can be downloaded, the server is connected to the external network successfully.

----End

7.2 What Do I Do If the GUI Cannot Be Displayed When MindStudio Is Started?

Symptom Error message "Failed to initialize graphics environment" or "Unable to detect graphics environment" is displayed when MindStudio is started. See Figure 7-1 or Figure 7-2.

Figure 7-1 Failure to display the GUI 1

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 135 MindStudio Installation Guide 7 FAQs

Figure 7-2 Failure to display the GUI 2

Cause ● If Ubuntu Server is installed, after a user logs in to MobaXterm, the graphical environment has been occupied by the user group to which the user belongs. After the user changes, the graphical environment becomes unavailable. ● If Ubuntu Desktop is installed, the user for logging in to the Ubuntu system is different from that for launching MindStudio.

Solution ● If Ubuntu Server is installed, perform the following operations: – Add the new user to the user group of the original user. – Log in to MobaXterm as the user who launches MindStudio. – Set the DISPLAY environment variable as the user who launches MindStudio. export DISPLAY=host IP that displays the GUI:0 – Open the .bashrc file as the user who launches MindStudio, add "export DISPLAY=host IP that displays the GUI:0" to the file, save the file, and exit. Then, run the source ~/.bashrc command. ● If Ubuntu Desktop is installed, perform the following operations: – Log in to the Ubuntu system as the user who launches MindStudio.

7.3 How Do I Solve the Problem that Chinese Characters Are Displayed as Garbled Characters and the GUI Is Incompletely Displayed or Is Not Well- Organized?

Symptom ● When an app project is created, Chinese characters are displayed as garbled characters in, for example, the README_CN.md file. See Figure 7-3.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 136 MindStudio Installation Guide 7 FAQs

Figure 7-3 Garbled Chinese characters

● The GUI is incompletely displayed or is not well-organized. For example, the title cannot be completely displayed, as shown in Figure 7-4.

Figure 7-4 Incompletely displayed title

Solution Install the Microsoft YaHei font (msyh.ttc).

7.4 What Do I Do If a Message Is Displayed Indicating that the Network Is Disconnected or the Plugin Does Not Exist When I Install a Plugin on MindStudio

Symptom Start MindStudio. When you choose File > Settings... > Plugins to search for and install a plugin, the system displays a message indicating that the network is disconnected or the plugin does not exist, as shown in Figure 7-5 and Figure 7-6.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 137 MindStudio Installation Guide 7 FAQs

Figure 7-5 Network not connected

Figure 7-6 No plugin found

Solution

Step 1 Start MindStudio. Choose File > Settings... > Appearance & Behavior > System Settings > HTTP Proxy or enter Proxy in the search box. The proxy configuration page is displayed, as shown in Figure 7-7.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 138 MindStudio Installation Guide 7 FAQs

Figure 7-7 Configuring the proxy

Step 2 Choose Manual proxy configuration > HTTP and set the following parameters. ● Host name: IP address of the proxy server. ● Port number: port number of the proxy server.

Step 3 Select Proxy authentication and set the following parameters. ● Login: user name on the intranet. ● Password: password corresponding to the user name on the intranet.

Step 4 You can select Remember and click Check connection. The dialog box shown in Figure 7-8 is displayed.

Figure 7-8 Checking whether the connection is successful

Step 5 Enter a URL, for example, www.baidu.com, in the dialog box displayed to check whether the connection is successful, and click OK.

If the message "Connection successful" is displayed, the proxy is configured successfully.

Step 6 Choose File > Settings... > Plugins on the main menu to search for and install the plugin. See Figure 7-9.

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 139 MindStudio Installation Guide 7 FAQs

Figure 7-9 Searching for the plugin

----End

7.5 How Do I Get Help and Provide Suggestions?

If you want to view more information about MindStudio, choose Help > MindStudio Help from the main menu of MindStudio. This operation will connect you to the network and jump to the MindStudio page in the Ascend community.

If you have any questions or suggestions, choose Help > Ascend Developer Zone on the menu bar of MindStudio. This operation will connect you to the network and switch to the Ascend forum for feedback.

NO TE

To use the MindStudio Help and Ascend Developer Zone functions, you need to use a browser to log in to the web page. If the browser is not installed, install it.

Figure 7-10 More information and help

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 140 MindStudio Installation Guide 7 FAQs

7.6 What Do I Do If "Could not find a version that satisfies the requirement xxx" Is Displayed When "pip3 install" Is Run?

Symptom During the installation of dependencies, a message is displayed indicating that the network connection fails when the command of pip3 install xxx is run, and Could not find a version that satisfies the requirement xxx is displayed. Run the apt- get update command to check whether the sources are available. The displayed message is as follows.

Figure 7-11 Message displayed upon pip3 install

Possible Cause The pip source is not configured.

Solution Configure the pip source as follows:

Step 1 Run the following command as the MindStudio installation user: cd ~/.pip If a message indicating that the directory does not exist is displayed, run the following commands to create a directory.

mkdir ~/.pip cd ~/.pip Create a pip.conf file in the .pip directory:

touch pip.conf Step 2 Edit the pip.conf file. Run the vi pip.conf command to open the pip.conf file and add the following content to the file.

[install] #Configure the trusted host as required. trusted-host=repo.huaweicloud.com [global] #Configure the source as required. index-url=https://repo.huaweicloud.com/repository/pypi/simple Step 3 Run the :wq! command to save the file.

----End

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 141 MindStudio Installation Guide 7 FAQs

7.7 Python.h Is Not Installed or Cannot Be Found During Dependency Installation

Symptom During dependency installation, the message "fatal error:Python.h:No such file or directory" or "Could not find " is displayed, as shown in Figure 7-12 and Figure 7-13.

Figure 7-12 Prompt message 1 (example)

Figure 7-13 Prompt message 2 (example)

Solution Run the following commands to install the dependency based on the actual system: ● apt-get install python3-dev ● yum install python3-devel ● dnf install python3-devel

Issue 01 (2021-08-05) Copyright © Huawei Technologies Co., Ltd. 142