Installing the Framework Plugin Package

Software Package Preparation

Before installing the software, refer to Table 1 to obtain required software packages and corresponding digital signature files. The versions of the software packages must be consistent.

Once you download this software, you agree to the terms and conditions of Huawei Enterprise End User License Agreement (EULA).

Table 1 Software package download

Name

Software

Description

How to Obtain

Framework plugin package

Ascend-cann-tfplugin_{version}_linux-{arch}.run

Plugin package, an adaptation plugin used to connect to the upper-layer framework TensorFlow.

If the deep learning framework TensorFlow is used for online inference or training, you need to obtain the software package.

Link

{version} indicates the software version, and {arch} indicates the CPU architecture.

Digital Signature Verification

To avoid using software packages that have been tampered with during transfer or storage, download their integrity verification files while downloading the software packages.

Click PGP Verify to obtain the tool package, decompress it and verify the PGP digital signature. For details, see OpenPGP Signature Verification Guide. If the verification fails, do not use the software package. Click here to contact technical support.

Procedure

  1. Log in to the installation environment as the installation user of each software package. Upload the obtained framework plugin package to any path (for example, /home/package) in the installation environment.
  2. Go to the directory where the software package is stored and run the following command to grant the execute permission on the software package:
    chmod +x Ascend-cann-tfplugin_{version}_linux-{arch}.run
  3. Check the consistency and integrity of the software package installation file.
    ./Ascend-cann-tfplugin_{version}_linux-{arch}.run --check
  4. Install the software. (The following commands support parameters such as --install-path=<path>. For details about the parameters, see Command-Line Options.)
    ./Ascend-cann-tfplugin_{version}_linux-{arch}.run --install
  5. You need to sign the Huawei Enterprise End User License Agreement (EULA) before starting the installation process. You can enter y or Y to confirm the agreement based on the command output, or enter any other character to reject the agreement. After you accept the agreement, the installation starts.
    If the current language environment does not meet the requirements, run the following commands to configure the default language environment:
    # Set the language to Chinese (simplified).
    export LANG=zh_CN.UTF-8
    # Set the language to English.
    export LANG=en_US.UTF-8
    If the following information is displayed, the software is successfully installed:
    1
    xxx install success
    

    xxx indicates the name of the actual software package to be installed.

  6. Set environment variables. You can modify the ~/.bashrc file to set permanent environment variables. The procedure is as follows:
    1. Run the vi ~/.bashrc command in any directory as the running user to open the .bashrc file, and add the following content to the end of the file. The default installation path of the root user is used as an example. Change it to the actual installation path of set_env.sh.
      source /usr/local/Ascend/tfplugin/set_env.sh
    2. Run the :wq! command to save the file and exit.
    3. Run the source ~/.bashrc command for the modification to take effect immediately.
  7. Check whether the installation is successful. Query the CANN version. If the query result is the same as the version of the installation software package, the installation is successful.
    1. Go to the directory where the software package installation information file is stored.
      cd /usr/local/Ascend/tfplugin/latest

      In the preceding command, /usr/local/Ascend is the default installation path of the root user. Replace it with the actual installation path.

    2. Run the following command to query the version:
      cat ascend_tfplugin_install.info

Follow-up Operations

When the training script stores data in a serialized structure (for example, calling the serialization-related APIs of TensorFlow), if Protobuf is installed using pip, the protobuf/pyext/_message.cpython-37m-<arch>-linux-gnu.so dynamic library will be missing. Compiling the dynamic library during training will cause low performance. Re-install Protobuf using the source code before the training service is executed. This will compile the protobuf/pyext/_message.cpython-37m-<arch>-linux-gnu.so dynamic library, thereby improving the training performance.

For details, see Installing Protobuf of the Python Version.

Command-Line Options

One-click software installation is supported in the command line. You can select commands as required to complete the installation. All options below are optional.

Installation command format: ./software_package_name.run [options]

For details, see Table 2.

If the option queried by running the ./software_package_name.run --help command is not in the following table, the option is reserved or applies to other processor models. You do not need to pay attention to it.

Table 2 Options supported by the installation package

Option

Description

--help | -h

Queries help information.

--info

Queries software package compilation information.

--list

Queries the software package list.

--check

Checks the consistency and integrity of the software package.

--quiet | -q

Indicates silent installation or upgrade, which skips interactive information.

When this option is used for installation or upgrade, the Huawei Enterprise End User License Agreement is signed by default.

--nox11

Does not use the x11 operating mode.

--noexec

Decompresses the software package to the current directory without running the installation script. This option is used together with --extract=<path>. The format is as follows:

--noexec --extract=<path>

--extract=<path>

Decompresses the software package to a specified directory.

--tar arg1 [arg2 ...]

Runs the tar command on the software package. Use the options following tar as the command options. For example, the --tar xvf command is used to decompress a software package to the current directory.

--install

Installs a software package. You can specify the installation path --install-path=<path> or use the default installation path.

--install-path=<path>

Specifies the installation, upgrade, and uninstallation paths. This option must be used in conjunction with the installation, upgrade, and uninstallation options. If the global configuration file ascend_cann_install.info exists in the environment, the path specified by this option must be the same as the installation path in the global configuration file. If you want to change the installation path, delete the global configuration file ascend_cann_install.info or change the installation path in the global configuration file to a specified path. In addition, you are advised to uninstall the CANN package in the original path.

Check whether the file exists in the following directory:

  • root user: /etc/Ascend
  • Non-root user: ${HOME}/Ascend

If you do not specify the path, the default path is used.

  • For installation as the root user, the default installation path is /usr/local/Ascend.
  • For installation as a non-root user, the default installation path is ${HOME}/Ascend.

If an installation directory is specified by this option, the root user must have the 755 permission on this directory, and a non-root user must have the 750 permission on this directory.

--install-for-all

Allows all users to have the same installation user group permission.

If this option is included in installation or upgrade command, all users have the same permission on the directories and files created by the runfile installer as the installation user group.

This option must be used together with --install or --upgrade. For example:

./Software package name.run --install --install-for-all
NOTE:

Ensure the security risks are considered before you include this option.

--force

Specifies the forcible installation/upgrade command. If the installation or upgrade fails due to the installation or upgrade check failure, the system prompts you to use this option to skip the check to make the installation or upgrade succeed.

This option must be used together with --install and --upgrade.

--upgrade

Upgrades the installed software from an earlier version to a later version.

If you need to roll back from a later version to an earlier version, uninstall the later version and install the required version.

--uninstall

Uninstalls the software that has been installed.

--version

Queries version information.

The following options are not displayed in --help. Do not use them directly.

  • --xwin: uses the xwin operating mode.
  • --phase2: performs the second step.