Installing, Upgrading, and Uninstalling the CANN Package (.rpm)

The .rpm format can be operated only with the root permission. Non-root users need to use the privilege escalation command and obtain the required sudo permission. After using the command, cancel the permission for high-risk commands. Otherwise, sudo privilege escalation may occur.

Installation

To install the xxx.rpm CANN package:

  1. Log in to the server as the installation user.
  2. Install the RPM package. (Replace xxx.rpm with the actual full name of the software package.)
    • If you install the package as the root user, run the following command:
      rpm -ivh xxx.rpm
    • If you install the package as a non-root user, run the following command:
      sudo -E rpm -ivh xxx.rpm
    • The CANN package in .rpm format complies with the common RPM rules. After the package has been installed, other users can use it. If --install-for-all is not carried during driver installation and the CANN package running user is not root, the user group to which the CANN package running user belongs must be the same as that to which the driver running user belongs. If they are different, add the CANN software package running user to the group of the driver running user.
    • After a non-root user installs the package, the installation user group is the root user group.
    • If the CANN package has been installed, uninstall the package and then install it.
    • After the installation is complete, run the yum list | grep toolkit command to query the software package installation information.
    • The CANN package in .rpm format can be installed only in the default path /usr/local/Ascend.

Upgrade

The upgrade command is as follows (replace xxx.rpm with the actual software package name):
  • root user:
    rpm -Uvh xxx.rpm
  • Non-root users (obtain the required sudo permission):
    sudo -E rpm -Uvh xxx.rpm

If the preceding command fails to be executed and the upgrade is required, run the --force command to force upgrade.

rpm -Uvh xxx.rpm --force

Uninstallation

If the CANN software package xxx.rpm is obtained, uninstall it as follows (replace <arch> in the command with the actual architecture):
  • rpm mode:
    • root user:
      rpm -e Ascend-cann-toolkit.<arch>
    • Non-root users (obtain the required sudo permission):
      sudo -E rpm -e Ascend-cann-toolkit.<arch>
  • yum mode:
    • root user:
      yum remove Ascend-cann-toolkit.<arch>
    • Non-root users (obtain the required sudo permission):
      sudo -E yum remove Ascend-cann-toolkit.<arch>