You can manually uninstall the GPU driver. The uninstall command varies with the installation method of the GPU driver and the image type.

Background information

The GPU driver can only be uninstalled by the root user. If you are a common user, run the sudo command to obtain the permissions of a root user before you perform the operations.
If you have installed the GPU driver by using the automatic installation function, the uninstall method of the GPU driver varies with the operating system type:
  • The run mode is used for CentOS and SUSE.
  • The deb mode is used for Ubuntu.

Uninstall the GPU driver in Ubuntu

If you have used the deb package to install the GPU driver, we recommend that you complete the following steps to uninstall the GPU driver. This section uses Driver 410.104, CUDA 10.0.130, and cuDNN 7.5.0 as examples.

  1. Run the following command to uninstall the GPU driver:
    apt-get remove --purge nvidia-*
  2. Run the following command to uninstall CUDA and the cuDNN library:
    apt autoremove --purge cuda-10-0
    rm -rf /usr/local/cuda-10.0
  3. Run the following command to restart the instance:
    reboot

If you have used the run package to install the GPU driver, we recommend that you complete the following steps to uninstall the GPU driver:

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following command to uninstall CUDA and the cuDNN library:
    /usr/local/cuda/bin/cuda-uninstaller
    rm -rf /usr/local/cuda-10.0
    Note The uninstall command may differ between CUDA versions. If the cuda-uninstaller file does not exist, check whether a file whose name starts with uninstall_cuda is in the /usr/local/cuda/bin/. If yes, replace cuda-uninstaller in the command with that file name starting with uninstall_cuda.
  3. Run the following command to restart the instance:
    reboot

Uninstall the GPU driver in CentOS

If you have used the run package to install the GPU driver, we recommend that you complete the following steps to uninstall the GPU driver. This section uses Driver 410.104, CUDA 10.0.130, and cuDNN 7.5.0 as examples.

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following command to uninstall CUDA and the cuDNN library:
    /usr/local/cuda/bin/cuda-uninstaller
    rm -rf /usr/local/cuda-10.0
    Note The uninstall command may differ between CUDA versions. If the cuda-uninstaller file does not exist, check whether a file whose name starts with uninstall_cuda is in the /usr/local/cuda/bin/. If yes, replace cuda-uninstaller in the command with that file name starting with uninstall_cuda.
  3. Run the following command to restart the instance:
    reboot

If you have used the RPM package to install the GPU driver in CentOS 7, we recommend that you complete the following steps to uninstall the GPU driver:

  1. Run the following command to uninstall the GPU driver:
    yum remove xorg-x11-drv-nvidia nvidia-kmod cuda-drivers
    yum remove nvidia-diag-driver-local-repo-rhel7-410.104
  2. Run the following command to uninstall CUDA and the cuDNN library:
    yum remove /usr/local/cuda-10.0
    rm -rf /usr/local/cuda-10.0
  3. Run the following command to restart the instance:
    reboot

If you have used the RPM package to install the GPU driver in CentOS 6, we recommend that you complete the following steps to uninstall the GPU driver:

  1. Run the following command to uninstall the GPU driver:
    yum remove xorg-x11-drv-nvidia nvidia-kmod cuda-drivers
    yum remove nvidia-diag-driver-local-repo-rhel6-410.104
  2. Run the following command to uninstall CUDA:
    yum remove /usr/local/cuda-10.0
  3. Run the following command to restart the instance:
    reboot

Uninstall the GPU driver in the SUSE operating system

If you have used the run package to install the GPU driver, we recommend that you complete the following steps to uninstall the GPU driver. This section uses CUDA v9.0.176 as an example.

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following command to uninstall CUDA and the cuDNN library:
    /usr/local/cuda/bin/uninstall_cuda_9.0.pl
    rm -rf /usr/local/cuda-9.0
  3. Run the following command to restart the instance:
    reboot