Installing CANN

Prerequisites

  • The preparations for the installation are complete. For details, see Installing Dependencies.
  • Click Link and In the Edit Resource area on the left, select required software packages,Click Link. Obtain Ascend-cann-toolkit_<version>_linux-<arch>.run and Ascend-cann-kernels-<chip_type>_<version>_linux-<arch>.run. Log in to the installation environment as the installation user and upload the software package to any directory (/home/package).
  • The available space of the kit installation directory is greater than 7 GB. If the available space is less than 7 GB, clear the space or change the installation directory.

Installing Toolkit

  1. Log in to the installation environment as the installation user of the software package. Upload the obtained Toolkit to any path (for example, /home/package) in the installation environment.
  2. Add the execute permission on the software package and verify the consistency and integrity of the software package installation file.
    1
    2
    chmod +x Ascend-cann-toolkit_<version>_linux-<arch>.run
    ./Ascend-cann-toolkit_<version>_linux-<arch>.run --check
    

    If the following information is displayed, the software package verification is successful:

    1
    Verifying archive integrity...  100%   SHA256 checksums are OK. All good.
    
  3. Install the software package. (The installation command supports parameters such as --install-path= <path>. For details, see the parameter description.)
    1
    ./Ascend-cann-toolkit_<version>_linux-<arch>.run --install
    

    After the preceding command is executed, enter Y or y to agree to the Huawei Enterprise End User License Agreement (EULA) to continue the installation.

    If the following information is displayed, the software is successfully installed:
    1
    xxx install success
    

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

    If you do not specify an installation path, the software is installed in the default path. The default installation paths are as follows: For the root user, the path is /usr/local/Ascend. For a non-root user, the path is ${HOME} /Ascend. ${HOME} indicates the directory of the current user.

  4. Configure environment variables. The default installation path of a non-root user is used as an example. Run the following command based on the actual path of set_env.sh:
    1
    2
    3
    4
    # Configure environment variables when installing the Toolkit package.
    source ${HOME}/Ascend/ascend-toolkit/set_env.sh
    #Replace <arch> with the actual architecture.
    export LD_LIBRARY_PATH=${HOME}/Ascend/ascend-toolkit/latest/<arch>-linux/devlib/:$LD_LIBRARY_PATH
    
  5. Verifying the installation. Run the following command to 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.
      1
      cd ${HOME}/Ascend/ascend-toolkit/latest/<arch>-linux
      

      {arch} indicates the CPU architecture (aarch64 or x86_64).

    2. Run the following command to view the version information provided in the version field:
      1
      cat ascend_toolkit_install.info
      

Installing Kernels

CANN binary operator package, including the dynamic and static library files for single-operator API execution (such as aclnn APIs) and kernel binary file.

Usage Scenarios:

  • This software package must be installed when single-operator APIs (such as aclnn APIs) are executed.
  • In the dynamic shape scenario in graph mode, you are advised to install this software package to improve the compilation performance.
  • In the static shape scenario in graph mode, if this software package is installed, the compilation performance can be improved. If this package is not installed, build a new kernel based on the specified shape to improve the operator execution performance.
  1. Add the execute permission on the software package and verify the consistency and integrity of the software package installation file.
    1
    2
    chmod +x Ascend-cann-kernels-<chip_type>_<version>_linux-<arch>.run
    ./Ascend-cann-kernels-<chip_type>_<version>_linux-<arch>.run --check
    

    If the following information is displayed, the software package verification is successful:

    1
    Verifying archive integrity...  100%   SHA256 checksums are OK. All good.
    
  2. Run the corresponding command to install the software package based on the required file.
    • To install all files, including the dynamic and static library files for single-operator API execution (such as aclnn APIs) and the kernel binary file, run the following command:
      1
      ./Ascend-cann-kernels-<chip_type>_<version>_linux-<arch>.run --devel
      
    • To install files except the static library, run the following command:
      1
      ./Ascend-cann-kernels-<chip_type>_<version>_linux-<arch>.run --install
      

    After the preceding command is executed, enter Y or y to agree to the Huawei Enterprise End User License Agreement (EULA) to continue the installation.

    If the following information is displayed, the software is successfully installed:
    1
    xxx install success
    

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

  3. Verifying the installation. Run the following command to query the software 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. Replace it with the actual installation path.
      1
      cd ${HOME}/Ascend/ascend-toolkit/latest/opp_kernel
      
    2. Run the following command to view the version information in the version_dir field:
      1
      cat version.info