Huawei V100R020C00 Installation Manual

Atlas Data Center V100R020C00
CANN Software Installation Guide (Inference)
Issue 01
Date 2021-03-02
HUAWEI TECHNOLOGIES CO., LTD.
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 specied 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 eort 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-03-02) Copyright © Huawei Technologies Co., Ltd. i
Atlas Data Center CANN Software Installation Guide (Inference) Contents

Contents

1 Installation Precautions......................................................................................................... 1
2 Hardware Requirements........................................................................................................ 2
2.1 Atlas 300I Inference Card (Model 3010).........................................................................................................................2
2.2 Atlas 800 Inference Server (Model 3000).......................................................................................................................3
2.3 Atlas 800 Inference Server (Model 3010).......................................................................................................................4
3 Installing the Development Environment......................................................................... 5
3.1 Before You Start....................................................................................................................................................................... 5
3.2 Obtaining Software Packages............................................................................................................................................. 6
3.3 Preparations for Installation................................................................................................................................................8
3.3.1 CentOS (ARM)...................................................................................................................................................................... 8
3.3.2 Ubuntu (ARM).................................................................................................................................................................... 14
3.3.3 EulerOS (ARM)................................................................................................................................................................... 20
3.3.4 CentOS (x86 OS)............................................................................................................................................................... 26
3.3.5 Ubuntu (x86)...................................................................................................................................................................... 32
3.3.6 BClinux (x86)...................................................................................................................................................................... 38
3.4 Pure Development................................................................................................................................................................ 44
3.4.1 Installing the Development Kit..................................................................................................................................... 44
3.5 Development + Commissioning....................................................................................................................................... 46
3.5.1 Installing the Ascend AI Device Driver and Firmware.......................................................................................... 46
3.5.2 Installing the Development Kit..................................................................................................................................... 47
3.6 Performing Post-installation Operations...................................................................................................................... 50
4 Installing the Operating Environment............................................................................. 53
4.1 Obtaining Software Packages...........................................................................................................................................53
4.2 Installation on a Physical Machine................................................................................................................................. 56
4.2.1 Preparations for Installation.......................................................................................................................................... 56
4.2.2 Installing the Ascend AI Device Driver and Firmware.......................................................................................... 57
4.2.3 Installing the Inference Software.................................................................................................................................58
4.2.4 Performing Post-installation Operations...................................................................................................................61
4.3 Installation in a Container................................................................................................................................................. 63
4.3.1 Installing the Inference Card Driver and Firmware and Upgrading the MCU on the Host.....................63
4.3.2 Installing the Toolbox on the Host.............................................................................................................................. 64
4.3.3 Installing Ascend Docker on the Host........................................................................................................................ 64
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. ii
Atlas Data Center CANN Software Installation Guide (Inference) Contents
4.3.4 Creating an Inference Container Image.................................................................................................................... 65
4.3.5 Starting and Verifying a Container Image................................................................................................................71
5 Common Operations............................................................................................................ 74
Conguring the NIC IP Address....................................................................................................................................... 74
5.1
5.2 Conguring a System Network Proxy............................................................................................................................77
5.3 Installing CMake 3.5.2......................................................................................................................................................... 77
5.4 Uninstalling the CANN Software.....................................................................................................................................78
5.5 Setting User Account Validity Period............................................................................................................................. 79
5.6 Performing Fault Diagnostics........................................................................................................................................... 80
5.7 Performing a Software and Hardware Compatibility Test......................................................................................83
6 FAQs..........................................................................................................................................87
6.1 What Do I Do If the "Software Has Been Installed" During RUN Package Installation?............................ 87
6.2 pip3.7.5 install numpy Error.............................................................................................................................................. 87
6.3 The error message "subprocess.CalledProcessError: Command '('lsb_release', '-a')' return non-zero exit
status 1 " is displayed during pip3.7.5 installation...........................................................................................................88
6.4 What Do I Do If "Could not
pip3.7.5 install Is Run?................................................................................................................................................................89
nd a version that satises the requirement xxx" Is Displayed When
7 Reference.................................................................................................................................91
7.1 Parameters.............................................................................................................................................................................. 91
7.2 Default Mounted Contents of Ascend Docker Runtime.......................................................................................... 93
7.3 About CCEC Compiler.......................................................................................................................................................... 94
7.4 HCC Overview........................................................................................................................................................................ 95
A Change History...................................................................................................................... 96
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. iii
Atlas Data Center CANN Software Installation Guide (Inference) 1 Installation Precautions

1 Installation Precautions

Development Environment
The development environment is used to convert model applications, and develop operators.
If you need to debug an application (for example, an image classication application) in the development environment in addition to developing and compiling the application, you need to inference cards) in the development environment.
The pure development environment requires only the development kit to be installed.
In the development + commissioning scenario, you also need to install the driver
rmware corresponding to the inference card.
and
Operating Environment
The operating environment is an environment for running applications developed by users. The operating environment must be congured with Ascend AI devices (such as inference cards). Applications depend on the package, Toolbox, driver, and rmware to perform oine accelerated inference.
The operating environment includes the following two scenarios:
Physical machine scenario: The inference card driver, inference engine package, and Toolbox are installed on a physical machine. Applications developed by users run on the physical machine.
In the container scenario, you need to install Docker.
les, develop and compile
congure Ascend AI devices (such as
oine inference engine
rmware, oine
a. The inference card driver,
b. The oine inference engine package, user-developed applications, and
basic container images are encapsulated into a service inference image.
c. In the operating environment, the image is used to start the containers.
The applications then run as containers.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 1
rmware, and Toolbox are installed on a host.
Atlas Data Center CANN Software Installation Guide (Inference) 2 Hardware Requirements

2 Hardware Requirements

2.1 Atlas 300I Inference Card (Model 3010)

2.2 Atlas 800 Inference Server (Model 3000)
2.3 Atlas 800 Inference Server (Model 3010)
2.1 Atlas 300I Inference Card (Model 3010)
Before installing the development and operating environments, you need to prepare the hardware environment based on the scenario.
Scenario
Development environment
Development and commissioning environment
Operating environment
Table 2-1 Supported OSs
OS
Ubuntu OS version: Ubuntu
Version How to Obtain
18.04.1
OS architecture: x86
Hardware
General-purpose server
Inference server with Atlas 300I inference card (model 3010)
Ocial Ubuntu website
Download the recommended version ubuntu-18.04.1-server-
amd64.iso from http://old-
releases.ubuntu.com/releases/
18.04.1/.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 2
Atlas Data Center CANN Software Installation Guide (Inference) 2 Hardware Requirements
OS Version How to Obtain
CentOS OS version: CentOS 7.6
OS architecture: x86
BClinux OS version: BClinux 7.6
OS architecture: x86
Ocial CentOS website
Download the required version from
http://vault.centos.org/7.6.1810/ isos/x86_64/. The recommended
version is CentOS-7-x86_64­DVD-1810.iso.
Ocial BClinux website

2.2 Atlas 800 Inference Server (Model 3000)

Before installing the development and operating environments, you need to prepare the hardware environment based on the scenario.
Scenario Hardware Description
Development environment
Development and commissionin g environment
Operating environment
General-purpose server
Atlas 800 inference server (model 3000)
-
For details about how to install the server, set basic server parameters, and install the OS, see the
Inference Server User Guide (Model
3000)
. After the OS is installed, congure an IP address for the service network port. For details, see 5.1
Conguring the NIC IP Address.
Atlas 800 AI
Table 2-2 Supported OSs
OS
Ubuntu OS version: Ubuntu
CentOS OS version: CentOS 7.6
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 3
Version How to Obtain
Ocial Ubuntu website
18.04.1
OS architecture: ARM
OS architecture: ARM
Download the recommended version ubuntu-18.04.1-server-
arm64.iso from http://old-
releases.ubuntu.com/releases/
18.04.1/.
Ocial CentOS website
Download the recommended version CentOS-7-aarch64-
Everything-1810.iso from https://
archive.kernel.org/centos-vault/ altarch/7.6.1810/isos/aarch64/.
Atlas Data Center CANN Software Installation Guide (Inference) 2 Hardware Requirements
OS Version How to Obtain
EulerOS OS version: EulerOS 2.8
OS architecture: ARM
Ocial EulerOS website

2.3 Atlas 800 Inference Server (Model 3010)

Before installing the development and operating environments, you need to prepare the hardware environment based on the scenario.
Scenario Hardware Description
Development environment
Development and commissioning environment
Operating environment
General-purpose server
Atlas 800 inference server (model
3010)
-
For details about how to install the server, set basic server parameters, and install the OS, see the
Inference Server User Guide (Model
3010)
. After the OS is installed, congure an IP address for the service network port. For details, see 5.1
Conguring the NIC IP Address.
Atlas 800 AI
Table 2-3 Supported OSs
OS
Ubuntu OS version: Ubuntu
CentOS OS version: CentOS 7.6
BClinux OS version: BClinux 7.6
Version How to Obtain
18.04.1
OS architecture: x86
OS architecture: x86
OS architecture: x86
Ocial Ubuntu website
Download the recommended version ubuntu-18.04.1-server-
amd64.iso from http://old-
releases.ubuntu.com/releases/
18.04.1/.
Ocial CentOS website
Download the required version from
http://vault.centos.org/7.6.1810/ isos/x86_64/. The recommended
version is CentOS-7-x86_64­DVD-1810.iso.
Ocial BClinux website
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 4
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment

3 Installing the Development Environment

3.1 Before You Start

3.2 Obtaining Software Packages
3.3 Preparations for Installation
3.4 Pure Development
3.5 Development + Commissioning
3.6 Performing Post-installation Operations
3.1 Before You Start
If the development environment is used only for model application development and compilation, and operator development, the development environment can be a general-purpose server or a PC. In this case, you do not need to install the development kit Ascend-cann-toolkit_
{arch}_{gcc_version}
a. 3.2 Obtaining Software Packages
b. 3.3 Preparations for Installation
c. 3.4 Pure Development
In addition to converting model and developing operators, you need to debug applications in the development environment (for example, debugging image classication applications in the development environment). In this case, you need to device in the development environment and install the driver and rmware of the Ascend AI device, and development kit (Ascend-cann-
toolkit_
following sections:
{version}
le conversion,
congure the Ascend AI device, and only need to
{version}
.run). For details, see the following sections:
les, developing and compiling applications,
congure the Ascend AI
_linux-
{arch}_{gcc_version}
.run). For details, see the
_linux-
a. 3.2 Obtaining Software Packages
b. 3.3 Preparations for Installation
c. 3.5 Development + Commissioning
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 5
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment

3.2 Obtaining Software Packages

Downloading Software Packages
Before installing the software, obtain software packages and digital signature based on the actual scenario. The versions of the software packages must be consistent.
In the pure development scenario, only the development kit needs to be installed. For details, see Table 3-1.
In the development + commissioning scenario, you need to install the driver rmware and development kit of the Ascend AI device. You can obtain the required software packages according to the following table.
Hardware Ascend AI Device How to Obtain
Atlas 800 inference server (model 3000)
Atlas 800 inference server (model 3010)
Inference server with Atlas 300I inference card (model 3010)
Atlas 300I inference card (model 3000)
Atlas 300I inference card (model 3010)
For details, see Table 3-1 and Table 3-2.
For details, see Table 3-1 and Table 3-3.
les
Table 3-1 CANN software packages
Packa ge Type
Devel opme nt kit
Package Name Description How to
Ascend-cann­toolkit_
{arch}_{gcc_version}
{version}
_linux-
.run
It is used for application development, operator customization, and model conversion. The development kit contains the library for developing applications and development auxiliary tools such as the Ascend Tensor Compiler (ATC) for model conversion.
les required
Obtain
Link
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 6
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Table 3-2 Atlas 300I inference card (model 3000) software packages
Packag e Type
Driver packag e
Firmwa re packag e
MCU packag e
Package Name Description How to
Obtain
A300-3000-npu­driver_
{version}_{os}
aarch64.run
A300-3000-npu­rmware_
{version}
● A300-3000­mcu_
{version}
● A300-3000­mcu_
{version}
-
.run
.bin
.hpm
Inference card driver installation package
NOTE
The npu-smi tool package is integrated in the driver package. The npu-smi tool is automatically installed during the driver installation.
Ascend rmware installation package
The MCU is an out-of-band management module of the Atlas 300 AI inference card to provide functions
Link
such as card monitoring and fault reporting.
● To upgrade the MCU using the npu-smi tool, obtain the .bin MCU package.
● To upgrade the MCU using the iBMC, obtain the .hpm MCU package.
Table 3-3 Atlas 300I inference card (model 3010) software packages
Package
Package Name Description How to
Type
Driver package
Firmware package
A300-3010-npu­driver_
{version}_{os}
X86_64.run
A300-3010-npu­rmware_
{version}
-
.run
Inference card driver installation package
NOTE
The npu-smi tool package is integrated in the driver package. The npu-smi tool is automatically installed during the driver installation.
Ascend rmware installation package
Obtain
Link
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 7
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Package Type
MCU package
Package Name Description How to
Obtain
● A300-3010­mcu_
{version}
● A300-3010­mcu_
{version}
.bin
.hpm
The MCU is an out-of-band management module of the Atlas 300 AI inference card to provide functions such as card monitoring and fault reporting.
● To upgrade the MCU using the npu-smi tool, obtain the .bin MCU package.
● To upgrade the MCU using the iBMC, obtain the .hpm MCU package.
{version}
indicates the OS version. Obtain the software package based on the GCC version planned or deployed onsite. You can run the gcc --version command on the OS to query the GCC version. If the GCC version is earlier than 7.3.0, obtain the GCC 4.8.5 software package, if the GCC version is 7.3.0 or later, obtain the GCC 7.3.0 software package. The GCC versions of the software packages installed in the development environment and operating environment must be the same. Otherwise, the applications compiled in the development environment fail to run in the operating environment.
indicates the software version,
{arch}
indicates the processor architecture, and
{os}

3.3 Preparations for Installation

3.3.1 CentOS (ARM)

Environment Requirements
The following software or dependencies need to be installed for the development kit, Python, auxiliary development tools, and application compilation.
Table 3-4 Dependency information
Parameter
Python 3.7.5
cmake 3.5.1+
protobuf 3.11.3+
numpy 1.13.3+
Version
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 8
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Parameter Version
gcc You can run the gcc --version command on the OS to
query the GCC version. If the GCC version is earlier
gcc-c++
than 7.3.0, you can obtain the GCC 4.8.5 development kit. If the GCC version is 7.3.0 or later, you can obtain the GCC 7.3.0 development kit. The GCC versions of the software packages installed in the development environment and operating environment must be the same. Otherwise, the applications compiled in the development environment fail to run in the operating environment.
make
unzip
zlib-devel
lib-devel
openssl-devel
sqlite-devel
blas-devel
lapack-devel
openblas-devel
pciutils
net-tools
attrs
psutil
decorator
scipy
sympy
c
grpcio
grpcio-tools
requests
There is no version requirement. The version to be installed is subject to the source provided by the OS.
Check the umask of the root user.
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 le and save the
le:
vi ~/.bashrc source ~/.bashrc
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 9
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Creating Installation and Running Users
Table 3-5 lists the users for installing and running the driver, rmware, and CANN
software.
Table 3-5 Installation and running user list
Package
Installation User Running User
Type
Driver and
The user must be root. The user must be a non-root user.
rmware
installation package
CANN software package
The user can be root or non-root. For details, see the content below the table.
For installation as the root user:
After installation as the root user, you must switch to a non-root user for execution (the running user must not belong to the root user group). Therefore, you need to create a running user before the installation.
If the created user is HwHiAiUser, you can directly install the software
packages as the HwHiAiUser user. The default installation user is HwHiAiUser.
If the created user is not HwHiAiUser, you need to specify the running
user (by using the --install-username=
usergroup=
user group
parameter) when installing the software package.
user name
--install-
Perform the following operations to create a user.
For installation as a non-root user:
In this scenario, the installation and running users must be the same.
If a non-root user exists, you do not need to create one.
If you want to use a new non-root user, you need to create the user
rst.
To create a non-root user, run the following commands as the root user:
1. Create a non-root user.
groupadd useradd -g
usergroup
usergroup
-d /home/
username
-m
username
2. Set the password of the non-root user.
passwd
username
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 10
NO TE
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
● If the CANN software package is installed by a non-root user, the owner group of the user must be the same as that of the driver running user. If they are dierent, add them to the Driver running user group.
● The created running user cannot belong to the root user group.
● 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
Validity Period.
le or using the chage command. For details, see 5.5 Setting User Account
(Optional)
Conguring the Permission of the Installation User
Skip the following part if you install as the root user.
Before installing the development kit, you need to download the dependencies, which require sudo yum permission. Run the following commands as the root user:
1. Open the /etc/sudoers
chmod u+w /etc/sudoers vi /etc/sudoers
2. Under root ALL=(ALL) ALL in the le, add the following content:
username
rm, /bin/sh, /bin/cp, /bin/bash, /usr/bin/make install, /bin/ln -s /usr/local/python3.7.5/bin/ python3 /usr/bin/python3.7, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7, /bin/ln -s /usr/ local/python3.7.5/bin/python3 /usr/bin/python3.7.5, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/ pip3.7.5
ALL=(ALL:ALL) NOPASSWD:SETENV:/usr/bin/yum, /usr/bin/pip, /bin/tar, /bin/mkdir, /bin/
Replace username with the name of the common user who executes the installation script.
Ensure that the last line of the /etc/sudoers le is #includedir /etc/sudoers.d. Otherwise, add it manually.
3. Run :wq! to save the
le:
le.
4. Run the following command to revoke the write permission on the /etc/ sudoers le:
chmod u-w /etc/sudoers
Setting the Source
Development kit installation requires the download of related dependencies. Ensure that the installation environment can be connected to the network. Run the following command as the root user to check whether the source is valid:
yum makecache
If an error is reported during command execution or dependency installation, check whether the network connection is normal, or replace the source in the /etc/yum.repos.d/CentOS-Base.repo le with an available source or use an image source. For details about how to
Conguring a System Network Proxy.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 11
congure a network proxy, see 5.2
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Installing Dependencies
● If you install Python and its dependencies as the root user, perform Step 1 to Step 3. Note that the sudo keywords in the commands need to be deleted if any.
● If you install Python and its dependencies as a non-root user, run the su - username command to switch to the non-root user and perform Step 1 to Step 3.
Step 1 Check whether the Python dependencies and GCC software are installed.
Run the following commands to check whether the dependencies such as GCC, Make, and Python are installed:
gcc --version gcc-c++ --version make --version cmake --version rpm -qa|grep gcc-c++ rpm -qa |grep unzip rpm -qa |grep zlib-devel rpm -qa |grep rpm -qa |grep openssl-devel rpm -qa |grep sqlite-devel rpm -qa |grep blas-devel rpm -qa |grep lapack-devel rpm -qa |grep openblas-devel rpm -qa |grep pciutils rpm -qa |grep net-tools
lib-devel
If information similar to the following is displayed (the version number varies according to the actual OS), the tool has been installed. Go to the next step.
gcc (GCC) gcc-c++-4.8.5 GNU Make cmake version unzip-6.0-21.el7.aarch64 zlib-devel-
lib-devel-
openssl-devel­sqlite-devel­blas-devel-3.4.2-8.el7.aarch64 lapack-devel­openblas-devel­pciutils-3.5.1-3.el7.aarch64 net-tools-2.0-0.24.20131004git.el7.aarch64
4.8.5
20150623 (Red Hat 4.8.5-39)
4.1
3.5.1
1.2.7-18.el7
3.0.13-18.el7
3.7.17-8.el7_7.1
3.4.2-8.el7
.aarch64
.aarch64
1.0.2k-19.el7
.aarch64
0.3.3-2.el7.
.aarch64
.aarch64
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 unzip zlib-devel lib-devel openssl-devel sqlite-devel blas­devel lapack-devel openblas-devel pciutils net-tools
In the preceding steps, if the error message "No package libopenblas available" is displayed during the installation of openblas-devel, you need to install the extension package of the Linux enterprise edition and then install openblas-devel again. Run the following command to install the extension package:
sudo yum install epel-release
If the CMake version installed using the preceding method is earlier than 3.5.1, see
5.3 Installing CMake 3.5.2.
Step 2 Check whether the Python development environment is installed.
The development kit depends on the Python environment. Run the python3.7.5 -­version and pip3.7.5 --version commands to check whether Python has been
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 12
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
installed. If the following information is displayed, Python has been installed. Go to the next step.
Python 3.7.5 pip
19.2.3
from /usr/local/python3.7.5/lib/python3.7/site-packages/pip (python 3.7)
Otherwise, use the following procedure to install Python 3.7.5:
1. Run the wget command to download the source code package of Python
3.7.5 to any directory of the installation environment. The command is as follows:
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
2. Run the following command to go to the download directory and decompress the source code package:
tar -zxvf Python-3.7.5.tgz
3. Go to the decompressed folder and run the following conguration, build, and installation commands:
cd Python-3.7.5 ./congure --prex=/usr/local/python3.7.5 --enable-shared make sudo make install
--prex parameter species the Python installation path. You can change
The it based on the site requirements. The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library.
This document uses
--prex=/usr/local/python3.7.5 as an example. After the conguration, compilation, 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.
4. Check whether libpython3.7m.so.1.0 exists in /usr/lib64 or /usr/lib. If yes, skip this step or back up the libpython3.7m.so.1.0
le provided by the system
and run the following command:
Copy the compiled le libpython3.7m.so.1.0 to /usr/lib64:
sudo cp /usr/local/
python3.7.5/lib/
libpython3.7m.so.1.0 /usr/lib64
When the following information is displayed, enter y to overwrite the libpython3.7m.so.1.0 le provided by the system.
cp: overwrite 'libpython3.7m.so.1.0'?y
If the /usr/lib64 directory does not exist in the environment, copy the
le to
the /usr/lib directory.
sudo cp /usr/local
Replace the path of the libpython3.7m.so.1.0
/python3.7.5/lib
/libpython3.7m.so.1.0 /usr/lib
le as required.
5. Run the following commands to set the soft link:
sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7 sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7.5 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7.5
If a message indicating that the link already exists is displayed during the command execution, run the following command to delete the existing link and run the command again:
sudo rm -rf /usr/bin/python3.7.5 sudo rm -rf /usr/bin/pip3.7.5 sudo rm -rf /usr/bin/python3.7 sudo rm -rf /usr/bin/pip3.7
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 13
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
6. After the installation is complete, run the following commands to check the installation version. If the required version information is displayed, the installation is successful.
python3.7.5 --version pip3.7.5 --version
Step 3 Install the Python 3 development environment.
Before the installation, run the pip3.7.5 list command to check whether the dependencies have been installed. If yes, skip this step. If not, run the following command to install the dependencies: (If only some of the software is not installed, modify the following command to install selected software only.)
If you install Python and its dependencies as a non-root user, add --user at the end of each command in this step to ensure that the installation is successful. Example command: pip3.7.5 install attrs --user
pip3.7.5 install attrs pip3.7.5 install psutil pip3.7.5 install decorator pip3.7.5 install numpy==1.17.2 pip3.7.5 install protobuf==3.11.3 pip3.7.5 install scipy pip3.7.5 install sympy pip3.7.5 install pip3.7.5 install grpcio==1.32.0 pip3.7.5 install grpcio-tools==1.32.0 pip3.7.5 install requests
c
During the command execution, if the network connection fails and the message "Could not
nd a version that satises the requirement
the fault by referring to 6.4 What Do I Do If "Could not
satises the requirement xxx" Is Displayed When pip3.7.5 install Is Run?.
If an error is reported during the NumPy installation, rectify the fault by referring to 6.2 pip3.7.5 install numpy Error.
----End

3.3.2 Ubuntu (ARM)

Environment Requirements
The following software or dependencies need to be installed for the development kit, Python, auxiliary development tools, and application compilation.
Table 3-6 Dependency information
Parameter
Python 3.7.5
cmake 3.5.1+
Version
xxx
" is displayed, rectify
nd a version that
protobuf 3.11.3+
g++ 7.3.0 or later
gcc 7.3.0 or later
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 14
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Parameter Version
make
zlib1g
zlib1g-dev
libsqlite3-dev
openssl
libssl-dev
lib-dev
unzip
pciutils
net-tools
libblas-dev
gfortran
libblas3
libopenblas-dev
attrs
psutil
decorator
numpy
scipy
sympy
c
grpcio
grpcio-tools
requests
There is no version requirement. The version to be installed is subject to the source provided by the OS.
Check the umask of the root user.
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 le and save the
le:
vi ~/.bashrc source ~/.bashrc
Creating Installation and Running Users
Table 3-7 lists the users for installing and running the driver,
software.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 15
rmware, and CANN
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Table 3-7 Installation and running user list
Package
Installation User Running User
Type
Driver and
The user must be root. The user must be a non-root user.
rmware
installation package
CANN software package
The user can be root or non-root. For details, see the content below the table.
For installation as the root user:
After installation as the root user, you must switch to a non-root user for execution (the running user must not belong to the root user group). Therefore, you need to create a running user before the installation.
If the created user is HwHiAiUser, you can directly install the software
packages as the HwHiAiUser user. The default installation user is HwHiAiUser.
If the created user is not HwHiAiUser, you need to specify the running
user (by using the --install-username=
usergroup=
user group
parameter) when installing the software package.
user name
--install-
Perform the following operations to create a user.
For installation as a non-root user:
In this scenario, the installation and running users must be the same.
If a non-root user exists, you do not need to create one.
If you want to use a new non-root user, you need to create the user
To create a non-root user, run the following commands as the root user:
1. Create a non-root user.
groupadd useradd -g
usergroup
usergroup
-d /home/
username
-m
username
2. Set the password of the non-root user.
passwd
username
● If the CANN software package is installed by a non-root user, the owner group of the user must be the same as that of the driver running user. If they are dierent, add them to the Driver running user group.
● The created running user cannot belong to the root user group.
● 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 le or using the chage command. For details, see 5.5 Setting User Account
Validity Period.
rst.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 16
NO TE
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
(Optional) Conguring the Permission of the Installation User
Skip the following part if you install as the root user.
Before installing the development kit, you need to download the dependencies, which require sudo apt-get permission. Run the following commands as the root user:
1. Open the /etc/sudoers le:
chmod u+w /etc/sudoers vi /etc/sudoers
2. Add the following content below # User privilege
username
mkdir, /bin/rm, /bin/sh, /bin/cp, /bin/bash, /usr/bin/make install, /bin/ln -s /usr/local/python3.7.5/bin/ python3 /usr/bin/python3.7, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7, /bin/ln -s /usr/ local/python3.7.5/bin/python3 /usr/bin/python3.7.5, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/ pip3.7.5, /usr/bin/unzip
ALL=(ALL:ALL) NOPASSWD:SETENV:/usr/bin/apt-get, /usr/bin/pip, /bin/tar, /bin/
Replace username with the name of the common user who executes the installation script.
Ensure that the last line of the /etc/sudoers le is #includedir /etc/sudoers.d. Otherwise, add it manually.
3. Run :wq! to save the
le.
4. Run the following command to revoke the write permission on the /etc/ sudoers
chmod u-w /etc/sudoers
le:
specication of the le:
Checking the Source Validity
Development kit installation requires the download of related dependencies. Ensure that the installation environment can be connected to the network.
Run the following command as the root user to check whether the source is valid:
apt-get update
If an error is reported during command execution or dependency installation, check whether the network connection is normal, or replace the source in the /etc/apt/sources.list details about how to congure a network proxy, see 5.2 Conguring a System
Network Proxy.
Installing Dependencies
● If you install Python and its dependencies as the root user, perform Step 1 to Step 3. Note that the sudo keywords in the commands need to be deleted if any.
● If you install Python and its dependencies as a non-root user, run the su - username command to switch to the non-root user and perform Step 1 to Step 3.
Step 1 Check whether the Python dependencies and GCC software are installed.
le with an available source or use an image source. For
Run the following commands to check whether the dependencies such as GCC, Make, and Python are installed:
gcc --version g++ --version
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 17
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
make --version cmake --version dpkg -l zlib1g| grep zlib1g| grep ii dpkg -l zlib1g-dev| grep zlib1g-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
lib-dev| grep lib-dev| grep ii
dpkg -l dpkg -l unzip| grep unzip| 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
If the following information is displayed, the installation is complete. Go to the next step.
gcc (Ubuntu 7.3.0-3ubuntu1~18.04) 7.3.0 g++ (Ubuntu 7.3.0-3ubuntu1~18.04) 7.3.0 GNU Make 4.1 cmake version 3.10.2 zlib1g:arm64 1:1.2.11.dfsg-0ubuntu2 arm64 compression library - runtime zlib1g-dev:arm64 1:1.2.11.dfsg-0ubuntu2 arm64 compression library - development libsqlite3-dev:arm64 3.22.0-1ubuntu0.3 arm64 SQLite 3 development openssl 1.1.1-1ubuntu2.1~18.04.6 arm64 Secure Sockets Layer toolkit - cryptographic utility libssl-dev:arm64 1.1.1-1ubuntu2.1~18.04.6 arm64 Secure Sockets Layer toolkit - development les
lib-dev:arm64
unzip 6.0-21ubuntu1 amd64 De-archiver for .zip les pciutils 1:3.5.2-1ubuntu1 arm64 Linux PCI Utilities net-tools 1.60+git20161116.90da8a0-1ubuntu1 arm64 NET-3 networking toolkit libblas-dev:arm64 3.7.1-4ubuntu1 arm64 Basic Linear Algebra Subroutines 3, static library gfortran 4:7.4.0-1ubuntu2.3 arm64 GNU Fortran 95 compiler libblas3:arm64 3.7.1-4ubuntu1 arm64 Basic Linear Algebra Reference implementations, shared library libopenblas-dev:arm64 0.2.20+ds-4 arm64 Optimized BLAS (linear algebra) library (development
3.2.1-8 arm64 Foreign Function Interface library (development les)
les
les)
Otherwise, run the following command to install the software. You can change the following command to install only some of them as required.
sudo apt-get install -y gcc g++ make cmake zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev lib-dev unzip pciutils net-tools libblas-dev gfortran libblas3 libopenblas-dev
Step 2 Check whether the Python development environment is installed.
The development kit depends on the Python environment. Run the python3.7.5 -- version and pip3.7.5 --version commands to check whether Python has been installed. If the following information is displayed, Python has been installed. Go to the next step.
Python 3.7.5 pip
19.2.3
from /usr/local/python3.7.5/lib/python3.7/site-packages/pip (python 3.7)
Otherwise, use the following procedure to install Python 3.7.5:
1. Run the wget command to download the source code package of Python
3.7.5 to any directory of the installation environment. The command is as follows:
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
2. Run the following command to go to the download directory and decompress the source code package:
tar -zxvf Python-3.7.5.tgz
3. Go to the decompressed folder and run the following conguration, build, and installation commands:
cd Python-3.7.5 ./congure --prex=/usr/local/python3.7.5 --enable-shared
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 18
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
make sudo make install
The
--prex parameter species 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.
This document uses
--prex=/usr/local/python3.7.5 as an example. After the conguration, compilation, 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.
4. Check whether libpython3.7m.so.1.0 exists in /usr/lib64 or /usr/lib. If yes, skip this step or back up the libpython3.7m.so.1.0
le provided by the system
and run the following command:
Copy the compiled
sudo cp /usr/local/
le libpython3.7m.so.1.0 to /usr/lib64:
python3.7.5/lib/
libpython3.7m.so.1.0 /usr/lib64
When the following information is displayed, enter y to overwrite the libpython3.7m.so.1.0
cp: overwrite 'libpython3.7m.so.1.0'?y
If the /usr/lib64 directory does not exist in the environment, copy the
le provided by the system.
le to
the /usr/lib directory.
sudo cp /usr/local
Replace the path of the libpython3.7m.so.1.0
/python3.7.5/lib
/libpython3.7m.so.1.0 /usr/lib
le as required.
5. Run the following commands to set the soft link:
sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7 sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7.5 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7.5
If a message indicating that the link already exists is displayed during the command execution, run the following command to delete the existing link and run the command again:
sudo rm -rf /usr/bin/python3.7.5 sudo rm -rf /usr/bin/pip3.7.5 sudo rm -rf /usr/bin/python3.7 sudo rm -rf /usr/bin/pip3.7
6. After the installation is complete, run the following commands to check the installation version. If the required version information is displayed, the installation is successful.
python3.7.5 --version pip3.7.5 --version
Step 3 Install the Python 3 development environment.
Before the installation, run the pip3.7.5 list command to check whether the dependencies have been installed. If yes, skip this step. If not, run the following command to install the dependencies: (If only some of the software is not installed, modify the following command to install selected software only.) The Model Accuracy Analyzer in the Toolkit depends on protobuf and SciPy.
Proling
depends on protobuf, grpcio, grpcio-tools, and requests.
If you install Python and its dependencies as a non-root user, add --user at the end of each command in this step to ensure that the installation is successful. Example command: pip3.7.5 install attrs --user
pip3.7.5 install attrs pip3.7.5 install psutil
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 19
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
pip3.7.5 install decorator pip3.7.5 install numpy pip3.7.5 install protobuf== pip3.7.5 install scipy pip3.7.5 install sympy pip3.7.5 install c pip3.7.5 install grpcio==1.32.0 pip3.7.5 install grpcio-tools==1.32.0 pip3.7.5 install requests
3.11.3
During the command execution, if the network connection fails and the message "Could not
nd a version that satises the requirement
xxx
" is displayed, rectify
the fault by referring to 6.4 What Do I Do If "Could not nd a version that
satises the requirement xxx" Is Displayed When pip3.7.5 install Is Run?.
----End

3.3.3 EulerOS (ARM)

Environment Requirements
The following software or dependencies need to be installed for the development kit, Python, auxiliary development tools, and application compilation.
Table 3-8 Dependency information
Parameter
Version
Python 3.7.5
cmake 3.5.1+
protobuf 3.11.3+
gcc 7.3.0 or later
gcc-c++ 7.3.0 or later
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 20
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Parameter Version
make
unzip
zlib-devel
lib-devel
openssl-devel
sqlite-devel
pciutils
net-tools
lapack
lapack-devel
blas
blas-devel
gcc-gfortran
attrs
psutil
decorator
numpy
scipy
sympy
c
grpcio
grpcio-tools
requests
There is no version requirement. The version to be installed is subject to the source provided by the OS.
Check the umask of the root user.
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
le and save the
le:
vi ~/.bashrc source ~/.bashrc
Creating Installation and Running Users
Table 3-9 lists the users for installing and running the driver, rmware, and CANN
software.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 21
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
Table 3-9 Installation and running user list
Package
Installation User Running User
Type
Driver and
The user must be root. The user must be a non-root user.
rmware
installation package
CANN software package
The user can be root or non-root. For details, see the content below the table.
For installation as the root user:
After installation as the root user, you must switch to a non-root user for execution (the running user must not belong to the root user group). Therefore, you need to create a running user before the installation.
If the created user is HwHiAiUser, you can directly install the software
packages as the HwHiAiUser user. The default installation user is HwHiAiUser.
If the created user is not HwHiAiUser, you need to specify the running
user (by using the --install-username=
usergroup=
user group
parameter) when installing the software package.
user name
--install-
Perform the following operations to create a user.
For installation as a non-root user:
In this scenario, the installation and running users must be the same.
If a non-root user exists, you do not need to create one.
If you want to use a new non-root user, you need to create the user
To create a non-root user, run the following commands as the root user:
1. Create a non-root user.
groupadd useradd -g
usergroup
usergroup
-d /home/
username
-m
username
2. Set the password of the non-root user.
passwd
username
● If the CANN software package is installed by a non-root user, the owner group of the user must be the same as that of the driver running user. If they are dierent, add them to the Driver running user group.
● The created running user cannot belong to the root user group.
● 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 le or using the chage command. For details, see 5.5 Setting User Account
Validity Period.
rst.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 22
NO TE
NO TE
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
(Optional) Conguring the Permission of the Installation User
Skip the following part if you install as the root user.
Before installing the development kit, you need to download the dependencies, which require sudo yum permission. Run the following commands as the root user:
1. Open the /etc/sudoers le:
chmod u+w /etc/sudoers vi /etc/sudoers
2. Under root ALL=(ALL) ALL in the le, add the following content:
username
rm, /bin/sh, /bin/cp, /bin/bash, /usr/bin/make install, /bin/ln -s /usr/local/python3.7.5/bin/ python3 /usr/bin/python3.7, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7, /bin/ln -s /usr/ local/python3.7.5/bin/python3 /usr/bin/python3.7.5, /bin/ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/ pip3.7.5
Replace username with the name of the common user who executes the installation script.
3. Run :wq! to save the
4. Run the following command to revoke the write permission on the /etc/ sudoers
chmod u-w /etc/sudoers
ALL=(ALL:ALL) NOPASSWD:SETENV:/usr/bin/yum, /usr/bin/pip, /bin/tar, /bin/mkdir, /bin/
Ensure that the last line of the /etc/sudoers le is #includedir /etc/sudoers.d. Otherwise, add it manually.
le.
le:
Checking the Source Validity
The installation requires the download of related dependencies. Ensure that the installation environment can be connected to the network.
Run the following command as the root user to check whether the source is valid:
yum repolist
If an error is reported during command execution or dependency installation, check whether the network connection is normal, or replace the source in the /etc/yum.repos.d/ xxxx.repo
congure a network proxy, see 5.2 Conguring a System Network Proxy.
le with an available source or use an image source. For details about how to
Installing Dependencies
● If you install Python and its dependencies as the root user, perform 1 to 3. Note that the sudo keywords in the commands need to be deleted if any.
● If you install Python and its dependencies as a non-root user, run the su - username command to switch to the non-root user and perform 1 to 3.
Step 1 Check whether the Python dependencies and GCC software are installed.
Run the following commands to check whether the dependencies such as GCC, Make, and Python are installed:
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 23
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
gcc --version gcc-c++ --version make --version cmake --version rpm -qa|grep gcc-c++ rpm -qa |grep unzip rpm -qa |grep zlib-devel rpm -qa |grep rpm -qa |grep openssl-devel rpm -qa |grep sqlite-devel rpm -qa |grep unzip rpm -qa |grep pciutils rpm -qa |grep net-tools rpm -qa |grep lapack rpm -qa |grep lapack-devel rpm -qa |grep blas rpm -qa |grep blas-devel rpm -qa |grep gcc-gfortran
lib-devel
If the following information is displayed, the installation is complete. Go to the next step.
gcc (GCC) 7.3.0 gcc-c++-7.3.0 GNU Make 4.2.1 cmake version 3.12.1 unzip-6.0-40.eulerosv2r8.aarch64 zlib-devel-1.2.11-14.eulerosv2r8.aarch64
lib-devel-3.1-18.h3.eulerosv2r8.aarch64
openssl-devel-1.1.1-3.h7.eulerosv2r8.aarch64 sqlite-devel-3.24.0-2.h4.eulerosv2r8.aarch64 unzip-6.0-40.eulerosv2r8.aarch64 pciutils-3.5.1-3.el7.aarch64 net-tools-2.0-0.24.20131004git.el7.aarch64 lapack-3.8.0-10.eulerosv2r8.aarch64 lapack-devel-3.8.0-10.eulerosv2r8.aarch64 blas-3.8.0-10.eulerosv2r8.aarch64 blas-devel-3.8.0-10.eulerosv2r8.aarch64 gcc-gfortran-7.3.0-20190804.h22.eulerosv2r8.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 unzip zlib-devel lib-devel openssl-devel sqlite-devel pciutils net-tools lapack lapack-devel blas blas-devel gcc-gfortran
Step 2 Check whether the Python development environment is installed.
The development kit depends on the Python environment. Run the python -- version and pip --version commands to check whether Python has been installed. If the following information is displayed, Python has been installed. Go to the next step.
Python 3.7.5 pip
19.2.3
from /usr/local/python3.7.5/lib/python3.7/site-packages/pip (python 3.7)
Otherwise, use the following procedure to install Python 3.7.5:
1. Run the wget command to download the source code package of Python
3.7.5 to any directory of the installation environment. The command is as follows:
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
2. Run the following command to go to the download directory and decompress the source code package:
tar -zxvf Python-3.7.5.tgz
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 24
NO TE
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
3. Go to the decompressed folder, create an installation directory, and run the conguration, build, and installation commands.
cd Python-3.7.5 mkdir
/usr/local/python3.7.5
./congure --prex=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared make && make install
The --enable-shared parameter is used to compile the libpython3.7m.so.1.0 dynamic library.
4. Run the following command to copy the libpython3.7m.so.1.0 dynamic library:
a. The yum tool strongly depends on the libpython3.7m.so.1.0 le provided
by the system. Therefore, you need to back up the libpython3.7m.so.1.0 le. Run the following commands:
cd /usr/lib64 cp libpython3.7m.so.1.0 libpython3.7m.so.1.0.bak
If /usr/lib64 does not exist in the environment, use the actual path.
b. Copy the compiled
sudo cp /usr/local/
le libpython3.7m.so.1.0 to /usr/lib64:
python3.7.5/lib/
libpython3.7m.so.1.0 /usr/lib64
When the following information is displayed, enter y to overwrite the libpython3.7m.so.1.0 le provided by the system.
cp: overwrite 'libpython3.7m.so.1.0'?
If the /usr/lib64 directory does not exist in the environment, copy the le to the /usr/lib directory.
sudo cp /usr/local
/python3.7.5/lib
/libpython3.7m.so.1.0 /usr/lib
Replace the path of the libpython3.7m.so.1.0 le as required.
c. If you need to use the yum tool, run the following command to restore
the libpython3.7m.so.1.0.bak le backed up in a:
mv libpython3.7m.so.1.0.bak libpython3.7m.so.1.0
5. Run the following commands to set the soft link:
sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7 sudo ln -s /usr/local/python3.7.5/bin/python3 /usr/bin/python3.7.5 sudo ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3.7.5
If a message indicating that the link already exists is displayed during the command execution, run the following command to delete the existing link and run the command again:
sudo rm -rf /usr/bin/python3.7 sudo rm -rf /usr/bin/pip3.7 sudo rm -rf /usr/bin/python3.7.5 sudo rm -rf /usr/bin/pip3.7.5
6. After the installation is complete, run the following commands to check the installation version. If the required version information is displayed, the installation is successful.
python3.7 --version pip3.7 --version python3.7.5 --version pip3.7.5 --version
Step 3 Install the Python 3 development environment.
Before the installation, run the pip3.7.5 list command to check whether the dependencies have been installed. If yes, skip this step. If not, run the following
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 25
Atlas Data Center CANN Software Installation Guide (Inference) 3 Installing the Development Environment
command to install the dependencies: (If only some of the software is not installed, modify the following command to install selected software only.)
If you install Python and its dependencies as a non-root user, add --user at the end of each command in this step to ensure that the installation is successful. Example command: pip3.7.5 install attrs --user
pip3.7.5 install attrs pip3.7.5 install psutil pip3.7.5 install decorator pip3.7.5 install numpy pip3.7.5 install protobuf==3.11.3 pip3.7.5 install scipy pip3.7.5 install sympy pip3.7.5 install pip3.7.5 install grpcio==1.32.0 pip3.7.5 install grpcio-tools==1.32.0 pip3.7.5 install requests
c
During the command execution, if the network connection fails and the message "Could not
nd a version that satises the requirement
the fault by referring to 6.4 What Do I Do If "Could not
xxx
" is displayed, rectify
nd a version that
satises the requirement xxx" Is Displayed When pip3.7.5 install Is Run?.
----End

3.3.4 CentOS (x86 OS)

Environment Requirements
The following software or dependencies need to be installed for the development kit, Python, auxiliary development tools, and application compilation.
Table 3-10 Dependency information
Parameter
Python 3.7.5
cmake 3.5.1+
protobuf 3.11.3+
numpy 1.13.3+
gcc You can run the gcc --version command on the OS
gcc-c++
Version
to query the GCC version. If the GCC version is earlier than 7.3.0, you can obtain the gcc4.8.5 development kit. If the gcc version is 7.3.0 or later, you can obtain the gcc7.3.0 development kit. The GCC versions of the software packages installed in the development environment and operating environment must be the same. Otherwise, the applications compiled in the development environment fail to run in the operating environment.
Issue 01 (2021-03-02) Copyright © Huawei Technologies Co., Ltd. 26
Loading...
+ 70 hidden pages