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

Background information

The root account is used in this topic. If you are a common user, run a sudo command to obtain the permissions of a root user before you proceed.
If you have installed the GPU driver by using the automatic installation feature, the uninstall method of the GPU driver varies depending on 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 perform the following operations to uninstall the GPU driver. Driver 410.104, CUDA 10.0.130, and cuDNN 7.5.0 are used in the examples.

  1. Run the following command to uninstall the GPU driver:
    apt-get remove --purge nvidia-*
  2. Run the following commands 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 perform the following operations to uninstall the GPU driver:

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following commands 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 exists in the /usr/local/cuda/bin/ directory. If yes, replace cuda-uninstaller in the command with the file name that starts 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 perform the following operations to uninstall the GPU driver. Driver 410.104, CUDA 10.0.130, and cuDNN 7.5.0 are used in the examples.

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following commands 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 exists in the /usr/local/cuda/bin/ directory. If yes, replace cuda-uninstaller in the command with the file name that starts 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 perform the following operations to uninstall the GPU driver:

  1. Run the following commands 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 commands 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 perform the following operations to uninstall the GPU driver:

  1. Run the following commands 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 SUSE

If you have used the run package to install the GPU driver, we recommend that you perform the following operations to uninstall the GPU driver. CUDA 9.0.176 is used in the examples.

  1. Run the following command to uninstall the GPU driver:
    /usr/bin/nvidia-uninstall
  2. Run the following commands 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