Uninstalling CANN

If the CANN software is installed using a .run package (offline) or a package manager (online), perform the following steps to uninstall it.

If ops is installed together with Toolkit, ops will be automatically uninstalled when Toolkit is uninstalled.

Script-based Uninstallation (Recommended)

If the CANN software is installed using a .run package (offline), you can use an uninstallation script to uninstall the software by performing the following steps:

Go to the path where the uninstallation script is stored and run the uninstallation command.
  • 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.

Uninstalling the Software Package Using the Parameter

If the software is installed using a .run package (offline), you can use an uninstallation script to uninstall the software by performing the following steps:

Go to the directory where the software package is stored and 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 is not read.

Path of the configuration file:

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

Performing Uninstallation Using the Package Manager (Yum)

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

If both the ops and Toolkit packages are uninstalled, uninstall ops first and then CANN software.

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

Performing Uninstallation Using the Package Manager (apt-get)

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

If both the ops and Toolkit packages are uninstalled, uninstall ops first and then CANN software.

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

Performing Uninstallation Using the Package Manager (Conda)

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

If both the ops and Toolkit packages are uninstalled, uninstall ops first and then CANN software.

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)

After the online installation using pip, you must uninstall both the ops and Toolkit packages. You can use the following method to uninstall them:

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