Downloading Packages

You can download the OS dependencies required by the CANN software package, TensorFlow installation package for the x86 architecture, and Docker software in Windows or Linux OS.

Notes

  • For details about how to configure a network proxy, see Configuring the Network Proxy.
  • ascend-deployer provides the source configuration file. Huawei source is used by default. Replace it as required. For details, see Configuring the Source.
  • Once you start downloading, OS dependencies required by the CANN software package, TensorFlow installation package for the x86 architecture, and Docker software will be automatically downloaded and stored in the ascend-deployer/resources directory.
  • A large amount of open source software needs to be installed. The open source software downloaded using ascend-deployer comes from the OS source. You need to fix the vulnerabilities of the open source software as required. You are advised to use the official source to update the software regularly.

Procedure

The online download of driver, firmware, and CANN software packages can be used only when the following conditions are met (before installing the following software, ensure that the software and version meet the security requirements of your organization):

  • The OS must be Windows or Ubuntu 18.04.1/5. Note that the path for storing the ascend-deployer tool cannot contain Chinese characters.
  • You can access support.huawei.com using the Firefox browser. You can download the Firefox installation package from the Firefox official website or use the package manager provided by the system to install the Firefox browser.
  • You need to prepare an account for logging in to the support website and apply for and confirm the permission to download software packages (driver and firmware packages, CANN software package, and toolbox software package) in advance. You can apply for the permission by clicking the URL in the ascend-deployer/downloader/software/CANN_*.json file.
  • You need to place the obtained geckodriver package in a directory at the same level as the ascend-deployer directory. For Linux, ensure that the owner group name of the geckodriver is the same as the current user name and the permission is 500. For the Windows OS, ensure that other users do not have the read and write permissions. You can obtain the geckodriver package as follows:
    • Windows: Visit https://github.com/mozilla/geckodriver/releases, obtain geckodriver-vx.x.x-win64.zip, and decompress it to obtain geckodriver.exe.
    • Ubuntu x86_64: Visit https://github.com/mozilla/geckodriver/releases, obtain geckodriver-vx.x.x-linux64.tar.gz, and decompress it to obtain the geckodriver.
    • Ubuntu AArch64: Perform the following operations to obtain the geckodriver software package and decompress it to obtain the geckodriver:
      Download the firefox-geckodriver_<version>ubuntu0.18.04.1_arm64.deb package from the image source and upload it to the server. Perform the following operations to decompress the package to obtain the geckodriver:
      dpkg -x firefox-geckodriver_<version>ubuntu0.18.04.1_arm64.deb .   # Decompresses the software package to the current directory. After the decompression, the usr directory is generated.
      ls usr/bin/geckodriver   # Check the generated usr/bin/geckodriver file. After the geckodriver file is obtained, clear the temporary files.
  • You need to use pip3 to install selenium (pip3 install selenium) in advance. If pip3 is unavailable, install it by yourself.
  • Modify the <third-party_package_directory_used_by_Python 3>/selenium/webdriver/firefox/webdriver.py and <third-party_package_directory_used_by_Python 3>/selenium/webdriver/firefox/firefox_profile.py to control the port enabled by the program and harden the file permission. See selenium_firefox.patch and selenium_firefox_profile.patch.
  • In Linux, for security purposes, you need to run the following commands as the root user to disable connections of other users:
    iptables -A OUTPUT -m owner ! --uid-owner current username -o lo -p tcp --dport 56003 -j REJECT
    ip6tables -A OUTPUT -m owner ! --uid-owner current username -o lo -p tcp --dport 56003 -j REJECT
    iptables -A OUTPUT -m owner ! --uid-owner current username -o lo -p tcp --dport 56004 -j REJECT
    ip6tables -A OUTPUT -m owner ! --uid-owner current username -o lo -p tcp --dport 56004 -j REJECT

    After the installation is complete, run the following command to cancel the preceding configuration.

    1. Query the existing rules.
      iptables -L OUTPUT --line-number
    2. Find the line number of the added rule and run the following command to cancel the configuration:
      iptables -D OUTPUT num

      In the preceding command, replace num with the actual value, for example, 1.

  • After the software package is downloaded, verify its PGP digital signature according to OpenPGP Signature Verification Guide to ensure that the software package is not tampered with. If the verification fails, do not use the software package, and contact Huawei technical support engineers.
  • Windows
    1. Download Python since Python 3 is required in the Windows environment. Python 3.7 or later is recommended. If it has been installed, skip this step.

      Download link: Python 3.7.5

      Complete the installation as prompted. During the installation, select Add Python to environment variables on the Advanced Options page. Otherwise, you need to manually add environment variables.

    2. Start the download in either of the following ways:
      • (Recommended) Run start_download_ui.bat.

        On the displayed page, select the OS and the software package to be downloaded.

      • Run start_download.bat.

        Specify the OS and required software packages for the device to be installed. See Configuring the Downloading Behavior.

  • Linux
    • Both the root user and non-root users are allowed to perform the download operation. The user who performs the download operation must have the execute permission on the ascend-deployer directory.
    • Ensure that Python 3 and pip 3 exist in the current environment.
    • If you want to install the software listed in Table 1 as a non-root user, you need to download the software as the root user and non-root user respectively.
    • Run the following command to install ascend-deployer using pip.
      ascend-download --os-list=<OS1>,<OS2> --download=<PK1>,<PK2>==<Version>

      Run the ascend-download --help command to view the options of <OS1>,<OS2> and <PK1>,<PK2>==<Version>. For details about the parameters, see Table 1. After the preceding command is executed, the ascend-deployer directory will be generated in the $HOME directory by default. You can change the path of the directory by setting the environment variable ASCEND_DEPLOYER_HOME.

    • To decompress the downloaded .zip package, go to the ascend-deployer directory and run the following command:
      ./start_download.sh --os-list=<OS1>,<OS2> --download=<PK1>,<PK2>==<Version>

      Run the ./start_download.sh --help command to view the options of <OS1>,<OS2> and <PK1>,<PK2>==<Version>. For details about the parameters, see Table 1.

    Table 1 Parameter description

    Parameter

    Description

    --os-list=<OS1>,<OS2>

    --os-list specifies the target device OS. You can configure one or more OSs as required. The following is an example:

    --os-list=Ubuntu_18.04_aarch64,Ubuntu_18.04_x86_64

    --download=<PK1>,<PK2>==<Version>

    You can use the --download parameter to download the software packages (such as the Toolkit software package) listed in Table 1, MindSpore software package, and MindStudio software package. This parameter must be used together with the --os-list parameter. If you want to obtain the software packages in other ways (For details, see Obtaining Software Packages), delete this parameter. If you need to install MindSpore or MindStudio, specify the --download parameter to download it online.

    If you want to specify the software package version to be downloaded, pay attention to the version mapping between CANN, MindSpore, and MindStudio. See Table 2. If you do not specify the software package version, the latest available version of the software package will be downloaded. The following is an example:

    --download=CANN,MindSpore,MindStudio

    • If --download is set to CANN, the driver, firmware, and CANN software packages will be automatically downloaded and stored in the ascend-deployer/resources/CANN_x.x.x directory.
    • If --download is set to MindSpore, the MindSpore software package is automatically downloaded and stored in the Ascendxxx and CPU directories in ascend-deployer/resources/{OS}.
    • If --download is set to MindStudio, The MindStudio software package will be automatically downloaded and stored in the ascend-deployer/resources/MindStudio_x.x.x directory. Currently, the ascend-deployer tool is used to download and install MindStudio. Only Ubuntu_18.04_x86_64, Ubuntu_18.04_aarch64, and EulerOS_2.8_aarch64 are supported.
    Table 2 Version mapping

    Software

    Matching Version 1

    Matching Version 2

    Matching Version 3

    Matching Version 4

    CANN

    20.3.0

    5.0.1.spc103

    5.0.2.1

    5.0.3.1

    MindSpore

    1.1.1

    1.2.1

    1.3.0

    1.5.0

    MindStudio

    2.0.0

    3.0.1

    3.0.2

    3.0.3