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:
      1
      rpm -ivh xxx.rpm
      
    • If you install the package as a non-root user, run the following command:
      1
      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 group of the CANN package running user must be the same as that of the driver running user. If they are different, add the CANN package running user to the group of the driver running user.
    • If the CANN package has been installed, uninstall the package and then install it.
    • After the installation is complete, run the yum list | grep nnrt command to query the software package installation information. The following uses the nnrt software package as an example.
    • 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:
    1
    rpm -Uvh xxx.rpm
    
  • Non-root user (obtain the required sudo permission):
    1
    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.

1
rpm -Uvh xxx.rpm --force

Uninstallation

To uninstall the NNRT software (xxx.rpm CANN package), run the following command (replace <arch> in the following command with the actual architecture).
  • rpm mode:
    • root user:
      1
      rpm -e Ascend-cann-nnrt.<arch>
      
    • Non-root user (obtain the required sudo permission):
      1
      sudo -E rpm -e Ascend-cann-nnrt.<arch>
      
  • yum mode:
    • root user:
      1
      yum remove Ascend-cann-nnrt.<arch>
      
    • Non-root user (obtain the required sudo permission):
      1
      sudo -E yum remove Ascend-cann-nnrt.<arch>