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 specied 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 eort 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.
2.2 Preparations for Installation................................................................................................................................................3
2.6.2 Creating an Inference Container Image.................................................................................................................... 12
2.6.3 Starting and Verifying a Container Image................................................................................................................16
3 Installing the Operating Environment............................................................................. 19
3.1 Data Planning........................................................................................................................................................................ 19
3.1.1 AI Edge Station Network Ports..................................................................................................................................... 19
3.5.1 Installing and Running SmartKit.................................................................................................................................. 24
3.5.2 Batch Conguration Using a Template......................................................................................................................26
Conguration Using SmartKit (Recommended).....................................................................24
4 Common Operations............................................................................................................ 39
4.1 Conguring a System Network Proxy............................................................................................................................39
4.2 Uninstalling the CANN Software.....................................................................................................................................40
4.3 Setting User Account Validity Period............................................................................................................................. 41
5.1 What Do I Do If "Could not nd a version that satises the requirement xxx" Is Displayed When
pip3.7.5 install Is Run?................................................................................................................................................................43
6.2 About CCEC Compiler.......................................................................................................................................................... 47
The development environment refers to an environment used by a user to develop
an application program. It is usually deployed a PC or a server.
The development kit must be installed in the development environment. In the
scenario where the operating environment is deployed on an ARM device and the
development environment is deployed on an x86-architecture device, you need to
install the development kits of both the x86 and ARM architectures and the cross
compilation tool in the development environment.
Installing the Operating Environment
The operating environment is the environment for running applications developed
by users. The operating environment requires the
devices. See Atlas 500 AI edge station.
Create a container image using the
run the container image on an Ascend AI device.
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
2 Installing the Development Environment
2.1 Obtaining Software Packages
2.2 Preparations for Installation
2.3 Procedure
Conguring the Compilation Environment
2.4
2.5 Developing Applications
2.6 Verifying Applications
2.1 Obtaining Software Packages
Downloading Software Packages
Before installing the software, obtain software packages. The versions of the
software packages must be consistent.
Table 2-1 Software packages
Name
Develop
ment kit
PackageOS
Architecture
Ascend-canntoolkit_
nuxx86_64_gcc7.3.0.ru
n
{version}
Ubuntu X86It is used for
_li
DescriptionHow to
Obtain
Link
application
development,
custom operator,
and model
conversion. The
development kit
contains the
library
required for
developing
applications and
development
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
ParameterVersion
Restriction
gcc7.3.0 or later
Checking 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:
a.Run the following command in any directory to open the .bashrcle.
vi ~/.bashrc
Append umask 0022 to the end of the le.
b.Run the :wq! command to save the le and exit.
c.Run the source ~/.bashrc command for the modication to take eect
immediately.
How to Obtain
Creating Installation and Running Users
Table 2-3 lists the users for installing and running the rmware and CANN
software.
Table 2-3 Installation and running user list
Package
Type
CANN
software
packages
●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
–If the created user is not HwHiAiUser, you need to specify the running
●For installation as a non-root user:
Installation UserRunning User
The user can be root or
non-root. For details, see
the content below the
table.
packages as the HwHiAiUser user. The default installation user is
HwHiAiUser.
user (by using the --install-username=
usergroup=
user group
parameter) when installing the software package.
Perform the following operations to create a user.
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
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
● 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 4.3 Setting User Account
Conguring Permissions for the 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
chmod u+w /etc/sudoers
vi /etc/sudoers
2.Add the following content under # User privilege specication of the le:
Replace username with the actual installation userfor installation as a nonroot user. Replace username with the actual running user (HwHiAiUser by
default) for installation as the root user.
Ensure that the /etc/sudoersle contains #includedir /etc/sudoers.d. If the le does
not contain #includedir /etc/sudoers.d, manually add it to the end of the
le.
3.Run the :wq! command to save the le.
4.Run the following command to revoke the write permission on the /etc/sudoersle:
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
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
le with an available source or use an image source. For
congure a network proxy, see 4.1 Conguring a System
Network Proxy.
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 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
g++ --version
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
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:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - runtime
zlib1g-dev:amd64 1:1.2.11.dfsg-0ubuntu2 amd64 compression library - development
libsqlite3-dev:amd64 3.22.0-1ubuntu0.3 amd64 SQLite 3 development
openssl 1.1.1-1ubuntu2.1~18.04.5 amd64 Secure Sockets Layer toolkit - cryptographic utility
libssl-dev:amd64 1.1.1-1ubuntu2.1~18.04.5 amd64 Secure Sockets Layer toolkit - development
lib-dev:amd64 3.2.1-8 amd64 Foreign Function Interface library (development les)
unzip 6.0-21ubuntu1 amd64 De-archiver for .zip les
pciutils 1:3.5.2-1ubuntu1.1 amd64 Linux PCI Utilities
net-tools 1.60+git20161116.90da8a0-1ubuntu1 amd64 NET-3 networking toolkit
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.
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
● If you install dependencies as the root user, delete sudo from the commands in
steps 1 and 2.
● If Python and its dependency are installed as a non-root user, run the su -
username
command to switch to the non-root user, and then perform step 1
to step 3.
● libsqlite3-dev must be installed before the Python installation. If the Python
3.7.5 environment has been installed in the user's OS and libsqlite3-dev is
installed after the Python 3.7.5 environment is installed, you need to rebuild
the Python environment.
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:
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 conguration, build, and
installation commands:
cd Python-3.7.5
./congure--prex=/usr/local/python3.7.5 --enable-loadable-sqlite-extensions --enable-shared
make
sudo make install
--prex parameter species 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. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev.
This document uses
--prex=/usr/local/python3.7.5 as an example. After theconguration, 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 lelibpython3.7m.so.1.0 to /usr/lib64:
If a message indicating that the link already exists is displayed during the
command execution, run the following commands to delete the existing link
and run the commands again:
a.Run the vi ~/.bashrc command in any directory as the running user to
open the .bashrc
# 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
b.Run the :wq! command to save the
le and append the following content to the le:
le and exit.
c.Run the source ~/.bashrc command for the modication to take eect
immediately.
8.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
During the command execution, if the network connection fails and the message
"Could not nd a version that satises the requirement
xxx
" is displayed, rectify
the fault by referring to 5.1 What Do I Do If "Could not nd a version that
satises the requirement xxx" Is Displayed When pip3.7.5 install Is Run?.
----End
2.3 Procedure
Prerequisites
You have prepared for the installation by referring to 2.2 Preparations for
Installation.
Procedure
Step 1 Log in to the installation environment as the installation user of the software
Step 2 Upload the development kit obtained in 2.1 Obtaining Software Packages to any
Step 3 Go to the directory where the software package is stored.
Step 4 Grant the execute permission on the software package.
Obtain the development kit packages Ascend-cann-toolkit_
x86_64_gcc7.3.0.run and Ascend-cann-toolkit_
{version}
{version}
_linux-
_linux-
aarch64_gcc7.3.0.run by referring to 2.1 Obtaining Software Packages.
package.
Ensure that the installation user of the software packages is the same as the
installation dependency user in 2.2 Preparations for Installation.
directory (for example, /home/package) in the installation environment.
You need to obtain the two software packages applicable to Ubuntu x86 and
Ubuntu ARM, upload the two software packages, and perform the entire
installation process from Step 4 to Step 7.
chmod +x *.run
In the preceding command, *.run indicates the development kit Ascend-canntoolkit_
{version}
_linux-
{arch}
_gcc7.3.0.run. Replace it with the actual package name.
Step 5 Run the following command to check the consistency and integrity of the software
package installation
le:
./*.run --check
Step 6 Create a software installation path.
●If you need to specify the installation path, you need to create it rst. For
example, if the installation path is /home/work, run the mkdir -p /home/work command to create an installation path and then select the path to
install the software.
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
Step 7 Install the software. (The following commands support --install-for-all and --
install-path=
<path>
. For details about the parameters, see 6.1 Parameters.)
●If the installation is performed as a non-root user, run the following
command:
./*.run --install
●If the installation is performed as the root user:
–As the default running user HwHiAiUser, run the following command:
./*.run --install
–As a
specied running user, run the following command:
./*.run --install-username=
username
--install-usergroup=
usergroup
--
install
where, --install-username and --install-usergroup are used to specify
the running users.
● If the installation is performed by the root user, do not to specify the installation path in
the directory of a non-root user. Otherwise, the root user le may be replaced by a nonroot user for privilege escalation.
● The --quiet option is not supported when the development kit Ascend-cann-
toolkit_
● If the following information is displayed during the installation of the development kit
Ascend-cann-toolkit_
asking you whether to perform a hot reset, enter n. After the installation is complete,
restart the OS for the setting to take
The installation of aicpu_kernels needs to restart the device to take eect, do you want to
hot_reset the device? [y/n] n
For more installation modes, see 6.1 Parameters.
{version}
_linux-
{arch}_{gcc_version}
{version}
.run is installed in an x86 system.
_linux-
{arch}_{gcc_version}
eect. In the current version, only n is supported.
.run in the x86 system,
If the following information is displayed, the software is successfully installed:
[INFO]
xxx
[INFO] process end
xxx
install success
indicates the name of the software package to be installed.
----End
2.4 Conguring the Compilation Environment
The OS and architecture of the development environment are dierent from those
of the operating environment. Therefore, you need to install the cross-compiler in
the development environment. For details, see Table 2-6.
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
Table 2-6 Cross-compiler installation
OS and
Architectu
re of the
Developm
ent
Environm
ent
Ubuntu18.
04+x86_64
OS and
Archite
cture of
the
Operati
ng
Environ
ment
Ubuntu
18.04+A
rm64
Compilation Environment Conguration
Run the aarch64-linux-gnu-g++ --version command in
the development environment as the installation user of
the software package to check whether g++ has been
installed. If not, run the following command to install g
++:
sudo apt install g++-aarch64-linux-gnu
2.5 Developing Applications
After the development environment is set up, developers can develop applications
in the development environment. For details, see the
Solution V100R020C00 Application Software Development Guide
Atlas Intelligent Edge
.
2.6 Verifying Applications
2.6.1 Verication Description
Prepare an Atlas 500 AI edge station by referring to 3 Installing the Operating
Environment and perform the following operations on the edge station.
2.6.2 Creating an Inference Container Image
Prerequisites
●In the container scenario, install Docker 18.03 or later.
●Obtain the
package by referring to Table 2-7. The user environment needs to connect to
the network to pull images. If the network is not connected, see 4.1
Conguring a System Network Proxy.
oine inference engine package and service inference program
Atlas Intelligent Edge
CANN Software Installation Guide (A500-3000,
A500-3010)2 Installing the Development Environment
Table 2-7 Required software
Software PackageDescriptionHow to Obtain
A500-3000nnrt_
{version}
aarch64_gcc7.3.0.run
dockerleRequired for creating an
Service inference program
package
_linux-
Oine inference engine
package
{version}
software package
version.
image
Collection of service
inference programs.
The .tar and .tgz
formats are supported.
The compressed
package format of the
service inference
program must be
supported by the
compression program in
the container. In
addition, the command
for decompressing the
service inference
program package in
install.sh must map the
actual format.
indicates the
Link
Prepared by
users
Prepared by
users
Procedure
Step 1 Upload the software package to the same directory (for example, /home/test) on
Step 2 Perform the following steps to create a Dockerle:
install.shInstallation script of the
service inference
program.
run.shScript for running the
service inference
program.
the edge station.
●A500-3000-nnrt_
●Service inference program package
1.Log in to the edge station as the root user and run the id HwHiAiUser
command to query and record the UID and GID of the HwHiAiUser user on
the host.
2.Go to the software package upload directory in Step 1 and run the following
command to create a