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 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.3 Preparations for Installation................................................................................................................................................8
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
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.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
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
Conguring the NIC IP Address....................................................................................................................................... 74
5.1
5.2 Conguring a System Network Proxy............................................................................................................................77
5.4 Uninstalling the CANN Software.....................................................................................................................................78
5.5 Setting User Account Validity Period............................................................................................................................. 79
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 satises the requirement xxx" Is Displayed When
7.2 Default Mounted Contents of Ascend Docker Runtime.......................................................................................... 93
7.3 About CCEC Compiler.......................................................................................................................................................... 94
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 classication
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 congured with Ascend AI devices
(such as inference cards). Applications depend on the
package, Toolbox, driver, and rmware to perform oine 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
congure Ascend AI devices (such as
oine inference engine
rmware, oine
a.The inference card driver,
b.The oine 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.
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 classication 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-
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.
HardwareAscend AI DeviceHow 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 NameDescriptionHow to
Ascend-canntoolkit_
{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.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Package
Type
MCU
package
Package NameDescriptionHow to
Obtain
● A300-3010mcu_
{version}
● A300-3010mcu_
{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.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
ParameterVersion
gccYou 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
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 UserRunning 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:
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 dierent, 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)
Conguring 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:
Replace username with the name of the common user who executes the
installation script.
Ensure that the last line of the /etc/sudoersle 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.repole with an available source or use an
image source. For details about how to
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:
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-
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
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-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.
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:
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.0le 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:
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:
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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-7 Installation and running user list
Package
Installation UserRunning 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 dierent, 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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
(Optional) Conguring 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/sudoersle:
chmod u+w /etc/sudoers
vi /etc/sudoers
2.Add the following content below # User privilege
Replace username with the name of the common user who executes the
installation script.
Ensure that the last line of the /etc/sudoersle 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:
specication 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 congure a network proxy, see 5.2 Conguring 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:
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:
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
make
sudo make install
The
--prex parameter species 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
--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
sudo cp /usr/local/
lelibpython3.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:
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:
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.
Proling
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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-9 Installation and running user list
Package
Installation UserRunning 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 dierent, 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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
(Optional) Conguring 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/sudoersle:
chmod u+w /etc/sudoers
vi /etc/sudoers
2.Under root ALL=(ALL) ALL in the le, add the following content:
Ensure that the last line of the /etc/sudoersle 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
congure a network proxy, see 5.2 Conguring 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:
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:
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:
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.
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
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
During the command execution, if the network connection fails and the message
"Could not
nd a version that satises the requirement
the fault by referring to 6.4 What Do I Do If "Could not
xxx
" is displayed, rectify
nd a version that
satises 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
Python3.7.5
cmake3.5.1+
protobuf3.11.3+
numpy1.13.3+
gccYou 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.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-11 Installation and running user list
Package
Installation UserRunning 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 dierent, 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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
(Optional) Conguring 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:
Replace username with the name of the common user who executes the
installation script.
3.Run :wq! to save the le.
4.Run the following command to revoke the write permission on the /etc/sudoersle:
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:
Ensure that the last line of the /etc/sudoersle is #includedir /etc/sudoers.d.
Otherwise, add it manually.
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 congure a network proxy, see 5.2
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 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:
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
installed. If the following information is displayed, Python has been installed. Go
to the next step.
Python 3.7.5
19.2.3
pip
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:
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
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-shared
make
sudo make install
The --prex parameter species 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
--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:
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.0le 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
/python3.7.5/lib
/libpython3.7m.so.1.0 /usr/lib
Replace the path of the libpython3.7m.so.1.0le as required.
5.Run the following commands to set the soft link:
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:
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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-13 Installation and running user list
Package
Installation UserRunning 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 dierent, 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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
(Optional) Conguring 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/sudoersle:
chmod u+w /etc/sudoers
vi /etc/sudoers
2.Add the following content below # User privilege
Replace username with the name of the common user who executes the
installation script.
Ensure that the last line of the /etc/sudoersle 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:
specication 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 congure a network proxy, see 5.2 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.
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:
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
19.2.3
pip
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:
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
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.0le provided by the system
and run the following command:
Copy the compiled lelibpython3.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
cp: overwrite 'libpython3.7m.so.1.0'?y
le provided by the system.
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.0le as required.
5.Run the following commands to set the soft link:
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:
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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
the fault by referring to 6.4 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
3.3.6 BClinux (x86)
Environment Requirements
The following software or dependencies need to be installed for the development
kit, Python, auxiliary development tools, and application compilation.
Table 3-14 Dependency information
ParameterVersion
Python3.7.5
cmake3.5.1+
protobuf3.11.3+
numpy1.13.3+
gccYou can run the gcc --version command on the OS to
gcc-c++
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.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-15 Installation and running user list
Package
Installation UserRunning 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 dierent, 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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
(Optional) Conguring 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/sudoersle:
chmod u+w /etc/sudoers
vi /etc/sudoers
2.Under root ALL=(ALL) ALL in the le, add the following content:
Ensure that the last line of the /etc/sudoersle is #includedir /etc/sudoers.d.
Otherwise, add it manually.
4.Run the following command to revoke the write permission on the /etc/sudoers
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 clean all
Update the image source.
yum makecache
If the message "Your license is invalid" is displayed, obtain the OS authentication
license.
If an error is reported during yum makecache command execution or dependency
installation, check whether the network is connected, or replace the source in
the /etc/yum.repos.d/BCLinux-Base.repo
image source (the BCLinux uses the CentOS 7.6 source). For details about how to
congure a network proxy, see 5.2 Conguring a System Network Proxy.
Installing Dependencies
le:
le with an available source or use an
● 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.
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
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:
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-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.
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
sudo cp /usr/local/
lelibpython3.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
le provided by the system.
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.0le as required.
5.Run the following commands to set the soft link:
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:
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
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
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
In the preceding command, .run indicates the development kit Ascend-cann-
toolkit_
{version}
_linux-
{arch}
_gcc
x.x.x
.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 (Optional) Specify the 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.
●If you do not specify an installation path, the software is installed in the
default path. The default installation paths are as follows:
–root user: /usr/local/Ascend
–Non-root user:
${HOME}
In the preceding command,
/Ascend
${HOME}
indicates the directory of the
current user.
Step 7 Install the software. (The following commands support --install-for-all and --
install-path=
<path>
. For details about the parameters, see 7.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.
● The development kits of multiple versions can be installed by dierent users in the same
development environment. The users must be in the same group as the Driver running
user. If the owner groups are dierent, add the users to the group of the Driver running
user.
● If the installation is performed by the root user, do not to specify the installation pathin the directory of a non-root user. Otherwise, the root user
non-root 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 eect. In the current version, only n is supported.
The installation of aicpu_kernels needs to restart the device to take eect, do you want to
hot_reset the device? [y/n] n
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
HardwareInference Card Model
Atlas 800 inference server (model
3000)
Atlas 800 inference server (model
3010)
Inference server with Atlas 300I
inference card (model 3010)
To install the inference card driver and rmware and upgrade the MCU, perform
the following steps:
Step 1 Check the kernel version of the OS. For details, see "Installation and Maintenance
> Checking the Environment" in the
or
(Model 3000)
Step 2 Install the inference card driver and rmware. For details, see "Installation and
Maintenance > Installing the Driver and Firmware" in the
Atlas 300I Inference Card User Guide (Model 3010)
Card User Guide (Model 3000)
3010)
.
Step 3 Upgrade the MCU. For details, see "Upgrading Components" > "Upgrading the
MCU" in the Atlas 300I Inference Card 1.0.7 Upgrade Guide (Models 3000,
3010).
Atlas 300I inference card (model 3000)
Atlas 300I inference card (model 3010)
Atlas 300I Inference Card User Guide
.
Atlas 300I Inference
or
Atlas 300I Inference Card User Guide (Model
----End
● Obtain the user guide based on the inference card model.
● The microcontroller unit (MCU) is an out-of-band management module of the inference
card. It provides functions such as board monitoring and fault reporting. The inference
card has been integrated with the initial version before delivery. To ensure that all
functions are available, upgrade the MCU to the latest version.
3.5.2 Installing the Development Kit
Prerequisites
●Prepare for the installation by referring to 3.3 Preparations for Installation.
●Obtain the development kit Ascend-cann-toolkit_
{arch}_{gcc_version}
●The AICPU operator package in the development kit must be installed as the
root user. If you install the development kit as a non-root user, you need to
switch to the root user to install the AICPU operator package.
Procedure
.run by referring to 3.2 Obtaining Software Packages.
{version}
_linux-
Step 1 Log in to the installation environment as the installation user of the software
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Ensure that the installation user of the software package is the same as the
installation dependency user in 3.3 Preparations for Installation.
Step 2 Upload the obtained development kit to any directory (for example, /home/
package) in the installation environment.
Step 3 Go to the directory where the software packages are stored.
Step 4 Grant the execute permission on the software package.
chmod +x *.run
In the preceding command, .run indicates the development kit Ascend-canntoolkit_
{version}
_linux-
{arch}
_gcc
x.x.x
.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 (Optional) Specify the 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.
●If you do not specify an installation path, the software is installed in the
default path. The default installation paths are as follows:
–root user: /usr/local/Ascend
–Non-root user:
${HOME}
In the preceding command,
/Ascend
${HOME}
indicates the directory of the
current user.
Step 7 Install the software. (The following commands support --install-for-all and --
install-path=
<path>
. For details about the parameters, see 7.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.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
● The development kits of multiple versions can be installed by dierent users in the same
development environment. The users must be in the same group as the Driver running
user. If the owner groups are dierent, add the users to the group of the Driver running
user.
● If the installation is performed by the root user, do not to specify the installation pathin the directory of a non-root user. Otherwise, the root user
non-root 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
{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.
le may be replaced by a
.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.
Step 8 If a non-root user is used to install the development kit in the previous step,
perform this step. Switch to the root user (you can also run the sudo command)
and run the following installation command:
1.Go to the directory where the AICPU operator package is stored.
${install_path}
cd
/ascend-toolkit/latest/
2.Install the AICPU operator package.
./Ascend310-aicpu_kernels-
The AICPU does not support the specied installation path and shares the
installation path of the driver.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Table 3-20 Environment variables
ScenarioEnvironment Variable
Inference
(development
environment)
Step 4 Run source .bashrc to make the environment variables take
----End
Verifying the Installation
You can use the Ascend-DMI tool to check the compatibility between the device
health information and software and hardware. After
variables, you can use the tool in any directory. You can use the tool as the root
user or a non-root user. If you use the tool as a non-root user, perform the
following steps to add the user group for running the software package. (If -install-for-all is used during software package installation, skip this operation.)
For example, the default user group for running the software package is
HwHiAiUser (you can run the source /etc/ascend_install.info; echo $
{UserGroup} command to query the user group for running the software
package). Perform the following steps to add the user to the HwHiAiUser user
group:
install_path=/usr/local/Ascend #Change the path based on the
site requirements.
Atlas Data Center
CANN Software Installation Guide (Inference)3 Installing the Development Environment
Figure 3-1 Number of the installed card
2.Run the ascend-dmi -dg -c
health status.
required.
For details about how to check the device health status, see 5.6 Performing
Fault Diagnostics.
Step 2 Check the software and hardware compatibility.
●If you use the default path when installing the software package:
Run the ascend-dmi -c command to check the software and hardware
compatibility.
●You need to set this parameter if the default installation path is not used. For
example, if the software package is installed in the /home/
directory, run the following command:
ascend-dmi -c -p /home/
For details about how to check software and hardware compatibility, see 5.7
Performing a Software and Hardware Compatibility Test.
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
4 Installing the Operating Environment
4.1 Obtaining Software Packages
4.2 Installation on a Physical Machine
4.3 Installation in a Container
4.1 Obtaining Software Packages
Downloading Software Packages
Obtain software packages and digital signature
operating environment based on the following table. The versions of the software
packages must be consistent.
Hardware
Atlas 800 inference server
(model 3000)
Atlas 800 inference server
(model 3010)
Inference server with Atlas
300I inference card (model
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
Table 4-1 CANN software packages
Packag
Package NameDescriptionHow
e Type
Oine
inferenc
e engine
Ascend-cannnnrt_
{version}
{arch}_{gcc_version}
package
ToolboxAscend-cann-
toolbox_
{version}
{arch}_{gcc_version}
Ascend
Docker
Ascend-dockerruntime_
{arch}
{version}_{os}-
.tar.gz
_linux-
_linux-
.run
.run
It contains the ACL library
ACLlib, which is used for model
inference of applications.
Obtain the software packages
based on the CPU architecture
(x86_64 or aarch64).
It contains AICPU operators,
which are used for inference
model calling.
The container engine plug-in
Ascend Docker provides Ascend
NPU-based containerization
support for all AI inference jobs
so that AI jobs can run
smoothly on Ascend devices as
Docker containers.
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
{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
4.2 Installation on a Physical Machine
4.2.1 Preparations for Installation
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:
vi ~/.bashrc
source ~/.bashrc
{os}
le and save the
Creating Installation and Running Users
Table 4-4 lists the users for installing and running the driver,
software.
Table 4-4 Installation and running user list
Package
Type
Driver and
rmware
installation
package
CANN
software
package
●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.
Installation UserRunning User
The user must be root.The user must be a non-root user.
The user can be root or
non-root. For details, see
the content below the
table.
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
–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
● 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 dierent, 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.
4.2.2 Installing the Ascend AI Device Driver and Firmware
The following table lists the inference card models congured for each server.
Hardware
Atlas 800 inference server (model
3000)
Atlas 800 inference server (model
3010)
Inference server with Atlas 300I
inference card (model 3010)
Inference Card Model
Atlas 300I inference card (model 3000)
Atlas 300I inference card (model 3010)
To install the inference card driver and
rmware and upgrade the MCU, perform
the following steps:
Step 1 Check the kernel version of the OS. For details, see "Installation and Maintenance
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
Step 2 Install the inference card driver and rmware. For details, see "Installation and
Maintenance > Installing the Driver and Firmware" in the
Card User Guide (Model 3000)
3010)
.
Step 3 Upgrade the MCU. For details, see "Upgrading Components" > "Upgrading the
MCU" in the Atlas 300I Inference Card 1.0.7 Upgrade Guide (Models 3000,
3010).
----End
● Obtain the user guide based on the inference card model.
● The microcontroller unit (MCU) is an out-of-band management module of the inference
card. It provides functions such as board monitoring and fault reporting. The inference
card has been integrated with the initial version before delivery. To ensure that all
functions are available, upgrade the MCU to the latest version.
or
Atlas 300I Inference Card User Guide (Model
Atlas 300I Inference
4.2.3 Installing the Inference Software
Prerequisites
Procedure
Step 1 Log in to the installation environment as the installation user of the software
●Prepare for the installation by referring to 4.2.1 Preparations for Installation.
●Before installing the software, ensure that the inference card driver and
rmware have been installed in the installation environment.
●Obtain the oine inference engine package Ascend-cann-
nnrt_
{version}
toolbox_
Obtaining Software Packages.
●The AICPU operator package in the toolbox must be installed as the root user.
If you install the toolbox as a non-root user, you need to switch to the root
user to install the AICPU operator package.
Obtain and install the oine inference engine package and utility tool package.
The installation sequence is not required and the installation procedures are the
same. The detailed installation procedure is as follows:
package.
For details about the installation user requirements, see Creating Installation and
Running Users.
_linux-
{version}
{arch}_{gcc_version}
_linux-
{arch}_{gcc_version}
.run and Toolbox Ascend-cann-
.run by referring to 4.1
Step 2 Upload the
(for example, /home/package) in the installation environment.
Step 3 Go to the directory where the software packages are stored.
Step 4 Grant the execute permission on the software package.
oine inference engine package and utility kit obtained to any path
Page 63
NO TE
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
*.run indicates the software package name, for example, the oine inference engine
package Ascend-cann-nnrt_
actual package name.
{version}
_linux-
{arch}_{gcc_version}
.run. Replace it with the
Step 5 Run the following command to check the consistency and integrity of the software
package installation le:
./*.run --check
Step 6 (Optional) Specify the 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.
●If you do not specify an installation path, the software is installed in the
default path. The default installation paths are as follows:
–root user: /usr/local/Ascend
–Non-root user:
${HOME}
In the preceding command,
/Ascend
${HOME}
indicates the directory of the
current user.
Step 7 Install the software. (The following commands support --install-for-all and --
install-path=
<path>
. For details about the parameters, see 7.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.
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
● The oine inference engine package and utility kit can be installed by dierent users in
the same operating environment. However, for dierent users, the installed versions
must be the same, and users must be in the same group as the Driver running user.
Otherwise, add the users to the group of the Driver running user.
● If the installation is performed by the root user, do not to specify the installation pathin the directory of a non-root user. Otherwise, the root user
non-root user for privilege escalation.
● The --quiet option is not supported when the Toolbox Ascend-cann-
toolbox_
● If the following information is displayed during the installation of the Toolbox Ascendcann-toolbox_
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
{version}
{version}
_linux-
{arch}_{gcc_version}
_linux-
eect. In the current version, only n is supported.
.run is installed in an x86 system.
{arch}_{gcc_version}
.run in the x86 system, asking you
le may be replaced by a
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.
Step 8 If a non-root user is used to install the toolbox in the previous step, perform this
step. Switch to the root user (you can also run the sudo command) and run the
installation command.
1.Go to the directory where the AICPU operator package is stored.
${install_path}
cd
/toolbox/latest/
2.Install the AICPU operator package.
./Ascend310-aicpu_kernels-
The AICPU does not support the specied installation path and shares the
installation path of the driver.
----End
Log File and Software Package Paths
The toolbox is used as an example to describe the paths of log
package paths.
The operations described in this section cannot be performed on an Atlas 200 AI
accelerator module (model 3000) that functions as a PCIe slave device (EP mode).
Conguring Environment Variables
Step 1 Log in to the server as the root user.
Step 2 Run the vi ~/.bashrc command.
Step 3 Add environment variables in Table 4-7 to the .bashrc
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
Table 4-7 Environment variables
ScenarioEnvironment Variable
Inference
(operating
environment)
Step 4 Run source .bashrc to make the environment variables take eect.
----End
Verifying the Installation
You can use the Ascend-DMI tool to check the compatibility between the device
health information and software and hardware. After conguring the environment
variables, you can use the tool in any directory. You can use the tool as the root
user or a non-root user. If you use the tool as a non-root user, perform the
following steps to add the user group for running the software package. (If -install-for-all is used during software package installation, skip this operation.)
For example, the default user group for running the software package is
HwHiAiUser (you can run the source /etc/ascend_install.info; echo $
{UserGroup} command to query the user group for running the software
package). Perform the following steps to add the user to the HwHiAiUser user
group:
install_path=/usr/local/Ascend #Change the path based on the
site requirements.
2.Run the usermod -a -G HwHiAiUser
to the HwHiAiUser user group.
root user. Replace it with the actual user name.
To verify the installation, perform the following steps:
Step 1 Check the device health status.
Run the ascend-dmi -dg -l 0 command to query health information.
For details about how to check the device health status, see "Tool Usage Guide >
Performing Fault Diagnostics" in the .
Step 2 Check the software and hardware compatibility.
●If you use the default path when installing the software package:
Run the ascend-dmi -c command to check the software and hardware
compatibility.
●You need to set this parameter if the default installation path is not used. For
example, if the software package is installed in the /home/
directory, run the following command:
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
ascend-dmi -c -p /home/
For details about how to check software and hardware compatibility, see "Tool
Usage Guide > Performing a Software and Hardware Compatibility Test" in the .
----End
xxx
/Ascend
4.3 Installation in a Container
4.3.1 Installing the Inference Card Driver and Firmware and
Upgrading the MCU on the Host
Creating a Running User
You must install the driver and
you must run the driver and
cannot be in the root user group. The following uses the default running user
HwHiAiUser of the driver as an example.) Before the installation, you need to
create a running user.
To create the HwHiAiUser user, perform the following steps as user root:
rmware as the root user. After the installation,
rmware as a non-root user. (The running user
1.Create the HwHiAiUser user.
groupadd HwHiAiUser
useradd -g HwHiAiUser -d /home/HwHiAiUser -m
2.Set the password of the HwHiAiUser user.
passwd HwHiAiUser
● The owner group of the running user is HwHiAiUser.
● 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.
HwHiAiUser
Installing the Inference Card Driver and Firmware and Upgrading the MCU
The following table lists the inference card models
Hardware
Atlas 800 inference server (model
3000)
Inference Card Model
Atlas 300I inference card (model 3000)
congured for each server.
Atlas 800 inference server (model
3010)
Inference server with Atlas 300I
inference card (model 3010)
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
To install the inference card driver and rmware and upgrade the MCU, perform
the following steps:
Step 1 Check the kernel version of the OS. For details, see "Installation and Maintenance
> Checking the Environment" in the
(Model 3000)
Step 2 Install the inference card driver and rmware. For details, see "Installation and
Maintenance > Installing the Driver and Firmware" in the
or
Atlas 300I Inference Card User Guide (Model 3010)
Card User Guide (Model 3000)
3010)
.
Step 3 Upgrade the MCU. For details, see "Upgrading Components" > "Upgrading the
MCU" in the Atlas 300I Inference Card 1.0.7 Upgrade Guide (Models 3000,
3010).
----End
● Obtain the user guide based on the inference card model.
● The microcontroller unit (MCU) is an out-of-band management module of the inference
card. It provides functions such as board monitoring and fault reporting. The inference
card has been integrated with the initial version before delivery. To ensure that all
functions are available, upgrade the MCU to the latest version.
Atlas 300I Inference Card User Guide
.
Atlas 300I Inference
or
Atlas 300I Inference Card User Guide (Model
4.3.2 Installing the Toolbox on the Host
The Ascend-Toolbox-{version}-x.x.x-linux_gccx.x.x.run tool package cannot be
installed in the container. Therefore, you need to install the tool package by
referring to 4.2.3 Installing the Inference Software. The tool package contains
the AICPU operator. Therefore, the AICPU operator must be installed.
4.3.3 Installing Ascend Docker on the Host
Ascend Docker provides Ascend NPU-based containerization support for all AI
training and inference jobs so that AI jobs can run smoothly on Ascend devices as
Docker containers.
Prerequisites
●The Docker program has been installed in the packaging environment and the
Docker version is 18.03 or later.
●The Ascend Docker software package has been obtained in 4.1 Obtaining
Software Packages based on the OS and platform type.
Installing Ascend Docker
Step 1 Upload the obtained software package to the server.
Step 2 Go to the directory where the software package is stored and run the following
command to decompress the Ascend Docker software package:
tar -xzvf Ascend-docker-runtime_
Step 3 Run the following command to switch to the directory where the decompressed
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
● You do not need to install the driver in the container for an OS that does not have the
note "The driver needs to be installed in the container" in Table 4-8.
● In the container image OS scenario, only services in the running state are supported,
and services in the development state are not supported.
● Currently, the container image OS can be Ubuntu 18.04.1 and 18.04.4.
Prerequisites
●Obtain the software packages and the Dockerle and script les required for
packaging images by referring to Table 4-9.
In a software package name,
{arch}
indicates the operating system architecture, and
the GCC version.
●The user environment needs to connect to the network to pull images. If the
network is not connected, see 5.2
●The container OS image can be obtained from Docker Hub. For example, to
pull the Ubuntu 18.04 container image, run the following command:
docker pull ubuntu:18.04
The ARM CentOS 7.6 cannot be obtained from Docker Hub. If you need to use
the CentOS 7.6 image, you can obtain it from AscendHub. After the image is
obtained, run the following command to rename the image:
docker tag swr.cn-south-1.myhuaweicloud.com/public-ascendhub/centos:7.6.1810 arm64v8/centos:7
{version}
indicates the software package version,
{gcc_version}
Conguring a System Network Proxy.
indicates
Table 4-9 Required software
Software Package
Ascend-cannnnrt_
{version}
_linux-
{arch}_{gcc_version}
A300-30x0-npudriver_
6-gcc4.8.5-
{version}_
{arch}
centos7.
.run
.run
DescriptionHow to Obtain
Oine inference engine
package
Driver installation
package. According to
Table 4-8, if the driver
needs to be installed in
the container, obtain this
software package.
DockerleRequired for creating an
image
Service inference
program package
Service inference
program package.
The .tgz format is
supported.
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
The procedure for preparing the install.sh and run.sh scripts is the same as
that for preparing the Dockerle.Compilation Sample shows the le
content.
– In this document, the driver running user is HwHiAiUser. If you specify another
user as the driver running user, change the user name to the actual one.
– After creating the Dockerle, run the following command to change the permission
on the Dockerle:
chmod 600 Dockerle
Step 5 Go to the directory where the software packages are stored and run the following
command to create a container image:
docker build -t
DRIVER_PKG=
HWHIAIUSER_GID=
image-name
drivepackage-name
gid
In the preceding command, --build-arg DRIVER_PKG=
--build-arg NNRT_PKG=
--build-arg HWHIAIUSER_UID=
--build-arg DIST_PKG=
nnrt-name
distpackage-name
drivepackage-name
--build-arg
uid
--build-arg
.
is the
specied driver package. If you do not need to install the driver in the container,
delete it. Do not omit . at the end of the command. Table 4-10 describes the
parameters in the command.
Table 4-10 Command parameter description
Parameter
image-name
Description
Species the image name and tag. Change them based on
the actual situation.
--build-argParameters in the Dockerle.
NNRT_PKG
nnrt-name
: species the name of the oine inference
engine package. Do not omit the le name extension.
Replace it with the actual one.
DRIVER_PKG
drivepackage-name
: species the name of the driver
package. Do not omit the le name extension. Replace it
with the actual one.
HWHIAIUSER_UI
D
HWHIAIUSER_GID
uid
: species the UID of HwHiAiUser. Replace it with the
UID of HwHiAiUser on the host.
gid
: species the GID of HwHiAiUser. Replace it with the
Gid of HwHiAiUser on the host.
DIST_PKG
distpackage-name
: species the name of the compressed
package of the service inference program. Do not omit the
le name extension. Replace it with the actual one.
Run the following command to query the UID and GID of the HwHiAiUser user on the
host:
Atlas Data Center
CANN Software Installation Guide (Inference)4 Installing the Operating Environment
Table 4-14 Parameter description
ParameterDescription
-e ASCEND_VISIBLE_DEVICES=
xxx
Use the ASCEND_VISIBLE_DEVICES
environment variable to specify the NPU
device to be mounted to the container,
and use the device sequence number to
specify the device. You can specify a single
device or a device range. The two types of
devices can be used together. Example:
1. -e ASCEND_VISIBLE_DEVICES=0
indicates that device 0 (/dev/davinci0)
is mounted to the container.
2. -e ASCEND_VISIBLE_DEVICES=1,3
indicates that devices 1 and 3 are
mounted to the container.
3. -e ASCEND_VISIBLE_DEVICES=0-2
indicates that devices 0 to 2 (including
devices 0 and 2) are mounted to the
container. The
eect is the same as that
of
-e ASCEND_VISIBLE_DEVICES=0,1,2
4. ASCEND_VISIBLE_DEVICES=0-2,4:
indicates that devices 0 to 2 and device
4 are mounted to the container. The
eect is the same as that of
-e ASCEND_VISIBILE_DEVICES=0,1,2,4
image-name
Image name and tag. Change them based
on the actual situation.
-e
ASCEND_RUNTIME_OPTIONS=
DRV
NO
Only NPU devices and management
devices (for example: /dev/davinci0, /dev/davinci_manager, /dev/hisi_hdc,
and /dev/devmm_svm) are mounted to
the container to support driver installation
in the container.
-v /usr/local/bin/npu-smi:/usr/
local/bin/npu-smi
Mount the npu-smi tool to the container.
Change the value as required.
If the information similar to the following is displayed, the npu-smi tool is
available and the slogd daemon process is started:
● In the preceding command example, the service program is run by default. If you need
to directly access the container, add /bin/bash to the end of the command. An example
is provided as follows:
docker run -it -e ASCEND_VISIBLE_DEVICES=
● The preceding command lists only the minimum mounting content. You can add the
contents as required.
● For the default contents mounted to Ascend Docker Runtime, see 7.2 Default Mounted
Contents of Ascend Docker Runtime. If you use a specied path to install the driver on
the host, you need to mount the directories and les listed in Table 7-2. The following is
an example:
● When the docker run command is used to start a container, the -eASCEND_RUNTIME_OPTIONS=VERBOSE environment variable is added to print logs
to /var/log/ascend-docker-runtime.log for debugging and fault locating. This function
is disabled by default.
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
5 Common Operations
5.1 Conguring the NIC IP Address
Conguring a System Network Proxy
5.2
5.3 Installing CMake 3.5.2
5.4 Uninstalling the CANN Software
5.5 Setting User Account Validity Period
5.6 Performing Fault Diagnostics
5.7 Performing a Software and Hardware Compatibility Test
5.1
Conguring the NIC IP Address on CentOS/EulerOS/BC_Linux
Conguring the NIC IP Address
After the OS is installed, you need to congure the IP address of the NIC on the
iBMC remote management page to remotely connect to the server. The
conguration method is as follows.
Step 1 Log in to the OS as the root user.
Step 2 Go to the
congured. NIC enp2s0f0 is used as an example. The NIC and path vary depending
on the site requirements.
/etc/syscong/network-scripts/ifcfg-enp2s0f0
vi
Step 3 Congure the service IP address, subnet mask, and gateway of the corresponding
NIC, as shown in Figure 5-1.
congurationle of the NIC for which an IP address needs to be
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
Figure 5-1 Setting network parameters
● BOOTPROTO indicates the IP address type of the device. For a static IP address, set this
parameter to static or none. For a dynamic IP address, set this parameter to dhcp so
that the IP address can be obtained automatically.
● Set ONBOOT to yes to enable automatic network connection.
● PREFIX indicates the network bit. If the value is 22, the subnet mask is 255.255.252.0.
Step 4 Restart the network service.
service network restart
Step 5 Check whether the IP address is
congured successful.
ifcong
----End
Conguring the NIC IP Address on Ubuntu
Step 1 Log in to the OS as the root user.
Step 2 Go to the
NIC and path vary depending on the site requirements.
vi /etc/netplan/01-netcfg.yaml
conguration le of the NIC. NIC enp125s0f0 is used as an example. The
Step 3
Congure the service IP address, subnet mask, and gateway, as shown in Figure
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
5.2 Conguring a System Network Proxy
The following procedure is a general method for conguring a network proxy. It
may not be applicable to all network environments. The method of conguring
the network proxy depends on the actual network environment.
Prerequisites
●Ensure that the network cable of the server is connected and the proxy server
can connect to the external network.
●The
Conguring a System Network Proxy
Step 1 Log in to the user environment as the root user.
conguration proxy is based on the condition that the server is located on
an intranet and cannot be directly connected to the external network.
Step 2 Run the following command to edit the
vi /etc/prole
/etc/prolele:
Add the following content to the le, save the le, and exit:
export http_proxy="http://
export https_proxy="
user:password@proxyserverip:port
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 Run the following command to make the
source /etc/prole
conguration take eect.
Step 4 Run the following command to check whether the external network is connected:
wget www.baidu.com
If the HTML le can be downloaded, the server is connected to the external
network successfully.
If a certicate error occurs when you use a proxy to connect to the network, you need to
install the certicate of the proxy server before downloading third-party components.
----End
5.3 Installing CMake 3.5.2
1.Run the wget command to download the source code package of CMake to
any directory on the server:
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
cd cmake-3.5.2
./bootstrap --prex=/usr
make
sudo make install
4.After the installation is complete, run the cmake --version command again to
check the version number.
5.4 Uninstalling the CANN Software
If you uninstall only the inference engine, development kit, or Toolbox, you can
uninstall them in any sequence. However, if you also need to uninstall the
inference card driver, you need to uninstall other software packages before
uninstalling the driver.
Method 1: Uninstalling a Software Package
To uninstall an installed software package, perform the following steps:
Step 1 Log in to the installation environment as the installation user of the software
package.
Step 2 Go to the directory where the software packages are stored.
Step 3 Uninstall the software package.
●If you specify a path when installing a software package, run the ./
package name
software package.
<path>
indicates the specied software package installation path. Replace the
software package name with the actual package name.
●If you do not specify a path when installing the software package, run the./
software package name
package.
If the following information is displayed, the software is successfully uninstalled:
[INFO]
xxx
[INFO] process end
xxx
uninstall success
indicates the name of the software package to be uninstalled.
----End
Method 2: Using a Script
You can also use the uninstallation script to uninstall the. The following describes
how to uninstall the development suite package.
.run --uninstall --install-path=
.run --uninstall command to uninstall the software
<path>
software
to uninstall the
Step 1 Go to the directory where the uninstallation script of the software is stored.
Generally, the script is stored in the script directory.
cd
<path>
{path}
in a
/ascend-toolkit/latest/xxx-linux_gccx.x.x/script
indicates the tool installation directory. If the software package is installed
specied directory, replace it with the specied directory. If this parameter is
-mMinimum time (in days) for which the password must be used.
The password cannot be changed during this period. The value
0 indicates that the password can be changed at any time.
-MMaximum validity period (days) of a password. The value 1
indicates that the validity check of the password can be
disabled.
-dLast password change date.
-IMaximum idle period (in days) after which the user account
will be disabled. After the specied time period has expired, the
password will be invalid.
-EDate when the user account expires. The user account is
unavailable when the account validity period has expired.
-WNumber of days in advance users are notied that their
passwords are about to expire.
-lLists the current settings. It helps non-privileged users to
determine the time when their passwords or accounts expire.
● Table 5-1 lists only common parameters. You can run the chage --help command to
display detailed parameter description.
● The date is in the format of
indicates that the user account test will expire on December 1, 2020.
● User must be specied. Replace it with the actual user name. The default user name is
root.
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
For example, to change the validity period of the test user to December 1, 2020,
run the following command:
chage -E 2020-12-01 test
5.6 Performing Fault Diagnostics
Function
Obtain the chip health information and perform computing power, power
consumption, and bandwidth tests on the chip, and determine the health status of
the current product based on the test results.
Commands for Querying Test Parameters
You can run either of the following commands to list the parameters of the fault
diagnostics command:
ascend-dmi -dg -h
ascend-dmi -dg --help
Table 5-2 describes the parameters.
Table 5-2 Parameter description
Parameter
[-dg, diagnosis]Performs a fault diagnostic test of
[-c, --card]Species a card for diagnostics. If
[-l, --level]Species the diagnosis level. If this
DescriptionMandatory/
the entire card.
this parameter is not specied,
fault diagnostics will be performed
on all cards by default.
You can run the ascend-dmi info
command to obtain the numbers
of the installed cards.
parameter is not specied, a level
0 diagnosis will be performed by
default.
The following options are
available:
● 0: performs a diagnosis test on
the chip health.
● 1: performs a diagnosis test on
the power consumption,
bandwidth, and computing
power of the card.
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
ParameterDescriptionMandatory/
Optional
Example
Leave -c and -l
unspecied
Performs a level 0 diagnosis of all
cards.
Optional
To ensure the correctness and accuracy of the test result, perform the fault diagnostic test
separately.
The command output on an inference server is similar to that on a training server.
The following uses the screenshots on an inference server as an example.
●Perform a level 0 diagnosis test on card No. 65.
ascend-dmi -dg -c 65 -l 0
In the command, 65 is the number of the card to be tested. You can run the
ascend-dmi info command to obtain the card number information.
If information shown in Figure 5-4 is displayed, the tool is running properly.
For details about the parameters, see Table 5-3.
Figure 5-4 Fault diagnosis example (level 0)
●Perform a level 1 diagnosis test on card No. 65.
ascend-dmi -dg -c 65 -l 1
In the command, 65 is the number of the card to be tested. You can run the
ascend-dmi info command to obtain the card number information.
If information shown in Figure 5-5 is displayed, the tool is running properly.
For details about the parameters, see Table 5-3.
Atlas Data Center
CANN Software Installation Guide (Inference)5 Common Operations
Table 5-3 Parameter description
ParameterDescription
CardIndicates the card number.
DeviceIndicates the chip number.
HealthIndicates the chip health status.
Flops TestIndicates the computing power test.
Duration (ms)Indicates the test duration in ms.
Computing Power (TFLOPS)Indicates the computing power.
Bandwidth TestIndicates the bandwidth test type.
Bandwidth (MB/s)Indicates the bandwidth in MB/s.
Power TestIndicates the power consumption test.
Max Power (W)Indicates the maximum power
consumption.
Average Power (W)Indicates the average power
consumption.
Max AI Core (%)Indicates the maximum AI core usage.
Average AI Core (%)Indicates the average AI core usage.
Max Temp (C)Indicates the maximum temperature.
Average Temp (C)Indicates the average temperature.
Max Voltage (V)Indicates the maximum voltage.
Average Voltage (V)Indicates the average voltage.
5.7 Performing a Software and Hardware Compatibility
Test
Function
Test the hardware and software compatibility by obtaining the hardware
information, architecture, driver version, rmware version, and software version
information.
Commands for Querying Test Parameters
You can run either of the following commands to list the parameters of the
compatibility test command:
Atlas Data Center
CANN Software Installation Guide (Inference)6 FAQs
6 FAQs
6.1 What Do I Do If the "Software Has Been Installed" During RUN Package
Installation?
6.2 pip3.7.5 install numpy Error
6.3 The error message "subprocess.CalledProcessError: Command '('lsb_release', 'a')' return non-zero exit status 1 " is displayed during pip3.7.5 installation.
6.4 What Do I Do If "Could not
Displayed When pip3.7.5 install Is Run?
nd a version that satises the requirement xxx" Is
6.1 What Do I Do If the "Software Has Been Installed"
During RUN Package Installation?
Symptom
The following message is displayed during installation:
run package is already installed, install failed
Solution
The software package cannot be installed repeatedly. You need to uninstall the
software package and then install it. For details, see 5.4 Uninstalling the CANN
Software.
6.2 pip3.7.5 install numpy Error
Symptom
When you run the pip3.7 install numpy command to install the dependency, the
error message "Could not build wheels for numpy which use PEP 517 and cannot
be install directly" is displayed, as shown in the following
Note that the CFLAGSag is always valid in the active window.
export CFLAGS=
ag must be changed back after being used. Otherwise, the
6.3 The error message "subprocess.CalledProcessError:
Command '('lsb_release', '-a')' return non-zero exit
status 1 " is displayed during pip3.7.5 installation.
Symptom
During dependency installation, the error message "subprocess.CalledProcessError:
Command '('lsb_release', '-a')' return non-zero exit status 1 " is displayed when
you run the pip3.7.5 install xxx command to install related software. The error
message is as follows:
Atlas Data Center
CANN Software Installation Guide (Inference)6 FAQs
Possible Causes
When the subprocess module of Python 3.7.5 is executed, the system displays a
message indicating that the lsb_release.py module cannot be found when the
lsb_release -a command is executed. The lib path of Python 3.7.5 is /usr/local/
python3.7.5/lib/python3.7/. The lsb_release.py module does not exist in the path.
Therefore, an error is reported.
Procedure
Step 1 Run the following command to search for the missing
nd / -name lsb_release
After the preceding command is executed, the following path is obtained. The
path is only an example and may vary according to the actual situation.
/usr/bin/lsb_release
Step 2 Run the following command to delete the /usr/bin/lsb_releasele in Step 1:
rm /usr/bin/lsb_release
Step 3 Run the pip3.7.5 list command to check whether the fault is rectied.
----End
le lsb_release.py:
6.4 What Do I Do If "Could not nd a version that
satises the requirement xxx" Is Displayed When
pip3.7.5 install Is Run?
Symptom
During dependency installation, when the pip3.7.5 install xxx command is used
to install related software, a message is displayed indicating that the network
cannot be connected and the message "Could not
requirement xxx" is displayed.
Atlas Data Center
CANN Software Installation Guide (Inference)6 FAQs
Figure 6-1 Message displayed upon pip3 install
Possible Causes
The pip source is not congured.
Procedure
Congure the pip source as follows:
Step 1 Run the following command as the installation user of the software package:
cd ~/.pip
If a message indicating that the directory does not exist is displayed, run the
following commands to create and go to the directory:
mkdir ~/.pip
cd ~/.pip
Create a pip.conf le in the .pip directory:
touch pip.conf
Step 2 Edit the pip.conf
le.
Run the vi pip.conf command to open the pip.confle and edit the le as
follows.
[global]
# Huawei source is used as an example. Replace it based on the actual situation.
index-url = https://mirrors.huaweicloud.com/repository/pypi/simple
trusted-host = mirrors.huaweicloud.com
timeout = 120
Atlas Data Center
CANN Software Installation Guide (Inference)7 Reference
7 Reference
7.1 Parameters
7.2 Default Mounted Contents of Ascend Docker Runtime
7.3 About CCEC Compiler
7.4 HCC Overview
7.1 Parameters
One-click installation is supported in the command line. You can select parameters
as required to complete the installation. All parameters are optional.
Installation command format: ./*.run [options]
For details, see Table 7-1.
If the parameters queried by running the ./*.run --help command are not
described in the following table, this parameter is reserved or applies to other chip
versions. You do not need to pay attention to this parameter.
Table 7-1 Parameters supported by the installation package
Parameter
Description
--help | -hQueries help information.
--versionQueries version information.
--infoQueries software package construction information.
--listQueries the software package list.
--checkChecks the consistency and integrity of software packages.
--noexecDecompresses a software package to the current directory
without running the installation script. This parameter is
used together with --extract=<path>. The format is as
follows:
--noexec --extract=<path>
--extract=<path>Decompresses a software package to a specied directory.
--tar arg1
[arg2 ...]
Runs the tar command on the software package. Use the
arguments following tar as the command arguments. For
example, the --tar xvf command indicates that the .run
package will be decompressed to the current directory.
--installInstalls a software package. You can specify the installation
path --install-path=<path> or use the default installation
path.
--install-for-allAllows all users to have the same installation group
permission.
If this option is included in installation or upgrade
command, all users have the same permission on the
directories and les created by the runle installer as the
installation group.
This parameter must be used together with one of the
parameters --install, --devel, and --upgrade, for example, ./
*.run --install --install-for-all.
NOTE
Make sure the security risks are considered before you include this
option.
--install-
username=<user
name>
Initial installation: You can specify the running user name.
Otherwise, HwHiAiUser is used by default.
Overwrite: The user name used in the last installation is
adopted.
This parameter must be used together with --install-usergroup=<usergroup>.
--install-
usergroup=<user
group>
Initial installation: You can specify the running user group
name. Otherwise, HwHiAiUser is used by default.
Overwrite: The user group name used in the last installation
is adopted.
This parameter must be used together with --install-username=<username>.
Atlas Data Center
CANN Software Installation Guide (Inference)7 Reference
DirectoryDescription
/usr/local/bin/npu-smiDirectory for storing les and the npu-
smi tool.
/var/log/npu/conf/slog/slog.confDirectory for storing the conguration
le of the log service.
7.3 About CCEC Compiler
The built-in CCEC compiler in Ascend AI Software Stack implements the TBE
operator build, and compiles the Code Compute Engine (CCE) operator generated
by the CodeGen module into an executable that can run on the Ascend AI
ProcessorHiSilicon SoC. During graph build, the TBE automatically invokes the
CCEC compiler, free from manual calling.
The CCEC compiler is stored in the ccec_compiler directory in the ATC or
FwkACLlib installation path. The main binary tools are listed in the following table.
Table 7-3 CCEC compiler tools
Tool
Name
clangccec_compiler/bi
llvmobjdum
p
Relative PathDescriptionRisk Analysis
n/clang
ccec_compiler/bi
n/llvm-objdump
CCE operator compiler.
Automatically invoked to
build the TBE operators. It
cannot be invoked
separately.
Debugger, providing the
function of printing the
operator function name
and oset address
information for fault
locating.
When the AI Core Error
Analyzer is used to parse AI
Core errors, this tool is
automatically invoked to
locate the function error
during TBE operator
development. It cannot be
called be invoked
separately.
Attackers may use
the existing
debugger or
compiler to build
new programs,
causing secondary
attack on the
system.
Atlas Data Center
CANN Software Installation Guide (Inference)7 Reference
Tool
Name
lldccec_compiler/bi
Relative PathDescriptionRisk Analysis
n/lld
7.4 HCC Overview
The Toolkit runle provides the Huawei Compiler Collection (HCC) for compiling
drivers and applications on the device side. The HCC is stored in the toolchain/hcc/ directory in the Toolkit installation path. The following table describes the
binary tools in the directory.
Table 7-4 HCC tools
Single-architecture CCE
operator linker.
During TBE operator build,
this tool is automatically
used to link operators to
form a complete executable
program. It cannot be
called be invoked
separately.
Tool
gcchcc/bin/aarch64-target-linux-gnu-gccCompiles a source le into an
ldhcc/bin/aarch64-target-linux-gnu-
readelfhcc/bin/aarch64-target-linux-gnu-
Relative PathDescription
executable.
This tool is used to compile
user code on the device side.
Adds all symbols to the
gnu-ld
gnu-readelf
dynamic symbol table to
create a dynamically linked
executable.
This tool is used to link the
intermediate
complete executable le
during user code compilation
on the device side.
Displays the information
contained in the ELF header
at the start of the le.
This tool is used to display
the information contained in
the ELF header of the
operator library binary
the start of the le, for
debugging purposes.