Upgrading CANN

If the CANN software is installed online using Yum, specify the target version number in the command. The following is an example:
1
sudo yum install -y Ascend-cann-toolkit-9.1.0-linux
If the CANN software is installed online using apt-get, specify the target version number in the command. The following is an example:
1
sudo apt-get install -y ascend-cann-toolkit=9.1.0

If the CANN software is installed online using Conda, click here to check and install the software by running the corresponding command.

For CANN software installed using a runfile, perform the following steps to upgrade the software. Note that the Ascend-cann_<version>_linux-<arch>.run package cannot be upgraded using the --upgrade parameter. You can uninstall the package and then install it again to complete the upgrade.

CANN Software Compatibility

  • CANN software allows independent upgrades for the Toolkit and ops packages (Toolkit and ops must be installed in the same version directory). The current major version (N) features a sliding-window compatibility covering adjacent years, defined as [N – 1, N, N + 1]. CANN 8.5.0 is the minimum supported version. For instance, the Toolkit of version 9.1.0 is compatible with the ops of version 8.5.0.
  • When upgrading certain CANN components (such as the ops) independently, the version number of the CANN software installation directory cann-<version> remains unchanged, and only the component-related files are updated. For example, if Toolkit and ops of version 9.0.0 have been installed and the ops is upgraded to version 9.1.0 independently, the installation directory remains cann-9.0.0.

Prerequisites

  • Before the upgrade, run the following command to check the version of the installed software and determine whether to perform the upgrade:
    bash ${HOME}/Ascend/cann/query_pkg_version.sh
  • Before upgrading Toolkit, ensure that the available space of the installation directory to be used is greater than the space occupied by the installed software package plus 10 GB. If the space is insufficient, clear the space.
    You can run the df -h <Installation directory> command to query the available space of the installation directory, and run the du -sh <Installation directory> command to query the space occupied by the software packages.
    1
    2
    df -h ${HOME}/Ascend/cann
    du -sh ${HOME}/Ascend/cann
    

Upgrading the CANN Software Package

  1. Log in to the installation environment as the installation user and go to the directory where the software package is stored.
  2. Add the execute permission on the software package (replace xxx.run with the actual full name of the software package):
    1
    chmod +x xxx.run
    
  3. Upgrade the software.
    1
    ./xxx.run --upgrade
    
    After the upgrade is complete, if the following information is displayed, the software is upgraded:
    1
    xxx upgrade success
    

    xxx indicates the name of the software package that is successfully upgraded.

Independent Upgrade of CANN Subpackages

CANN offers combined packages (Toolkit, ops, and nnal) and subpackages (like hccl, hixl, and ops-math). Some subpackages can be updated separately on demand. Make sure you follow the version mapping during upgrades. For details, see "Compatibility of Independently Upgradable Subpackages in the CANN ops Package" in the Release Notes.

For example, if Toolkit and ops of version 9.0.0 have been installed in the current environment and you need to upgrade the HIXL unilateral communication library separately, you can upgrade cann-hixl to version 9.1.0. Example command:
bash ./cann-hixl_9.1.0_linux-aarch64.run --upgrade --install-path=/home/custom_path
  • cann-hixl_9.1.0_linux-aarch64.run is an example subpackage. Replace it with the one in use.
  • /home/custom_path is an example installation path. Replace it with the one in use. Note that the upgrade path of the subpackage must be the same as that of the original CANN software.