Uninstalling the CANN

When uninstalling the CANN container image pulled from AscendHub, remove the built container image based on service requirements. If the CANN software is installed in the container in other modes, select the corresponding installation mode in Selecting an Installation Scenario and view the uninstallation procedure.

When the Toolkit is uninstalled, ops (which was installed alongside the Toolkit) will be automatically uninstalled as well.

(Recommended) Script-based Uninstallation

If the CANN software is installed offline using a runfile, you can use an uninstallation script to uninstall the software.

Go to the path where the uninstallation script is stored and run the uninstallation command.
  • Uninstalling the Toolkit:
    cd <path>/cann-<version>/<arch>-linux/script
    ./uninstall.sh
  • Uninstalling the ops separately:
    cd <path>/cann-<version>/<arch>-linux/script
    ./ops_uninstall.sh
  • NNAL:
    cd <path>/nnal
    ./nnal_uninstall.sh

In the preceding commands, <path> indicates the installation path of the software package, <version> indicates the software package version, and {arch}-linux indicates the CPU architecture. Replace them as required.

If the following information is displayed, the software is successfully uninstalled:
1
[INFO] xxx uninstall success

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

Uninstallation Using Parameters

If the CANN software is installed offline using a runfile, you can use the software package to uninstall the software.

Go to the directory where the software package is stored and run the following command to uninstall the software package:
./xxx.run --uninstall
If the following information is displayed, the software is successfully uninstalled:
1
[INFO] xxx uninstall success

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

In this mode, the CANN software package is uninstalled based on the path specified by Install_Path in the configuration file. The Install_Path in the configuration file in the backup timestamp folder will not be read.

Path of the configuration file:

  • root user: /etc/Ascend/ascend_cann_install.info
  • Non-root users: ${HOME}/Ascend/ascend_cann_install.info

Uninstallation Using the Package Manager (Yum)

For online installation using Yum, you can use the following method to uninstall the software.

If both the ops and Toolkit packages need to be uninstalled, follow the ops > CANN software uninstallation sequence.

Log in to the server as an installation user and uninstall the RPM package (replace xxx with the actual full name of the software package, for example, Ascend-cann-toolkit).
  • If you install the package as a non-root user, run the following command:
    sudo yum remove xxx
  • If you install the package as the root user, run the following command:
    yum remove xxx

Uninstallation Using the Package Manager (apt-get)

For online installation using apt-get, you can use the following method to uninstall the software.

If both the ops and Toolkit packages need to be uninstalled, follow the ops > CANN software uninstallation sequence.

Log in to the server as an installation user and uninstall the .deb package (replace xxx with the actual full name of the software package, for example, ascend-cann-toolkit).
  • If you install the package as a non-root user, run the following command:
    sudo apt-get remove xxx
  • If you install the package as the root user, run the following command:
    apt-get remove xxx

Uninstallation Using the Package Manager (Conda)

For online installation using Conda, you can use the following method to uninstall the software.

If both the ops and Toolkit packages need to be uninstalled, follow the ops > CANN software uninstallation sequence.

Log in to the server as an installation user, access the Conda virtual environment where the software package is located. Run the following command to uninstall the software package (replace xxx with the actual software package name, for example, cann-toolkit):
conda remove ascend::xxx

Uninstallation Using the Package Manager (pip)

For online installation using pip, you must uninstall both the ops and Toolkit packages as follows.

Run the following command to uninstall the software package (replace xxx and yyy with the actual software package names respectively, for example, ascend-cann-toolkit and ascend-cann-a3-ops):
pip uninstall xxx yyy