To uninstall the NVIDIA Tesla driver, follow the procedure for your operating system.
Warning
GPU-accelerated instances require a compatible driver to work properly. If you uninstall the current driver for any reason, you must install a new driver that is compatible with your instance type and operating system. Otherwise, a mismatch between the GPU-accelerated instance and the installed driver may cause your services to become unavailable.
Uninstall the driver on Windows
The following procedure uses a gn6i GPU-accelerated compute-optimized instance that runs Windows Server 2019 and has NVIDIA Tesla driver version 472.50 installed.
-
Connect to the GPU-accelerated instance.
-
On the Windows desktop, click the
icon in the lower-left corner, and then click Control Panel.
-
In the Control Panel, select .
-
Right-click the NVIDIA Tesla driver that you want to uninstall, such as NVIDIA Graphics Driver 472.50, and then click Uninstall/Change.
-
In the NVIDIA Uninstaller dialog box, click UNINSTALL.
-
When the uninstallation is complete, click RESTART NOW.
After the instance restarts, the NVIDIA Tesla driver is uninstalled.
Uninstall the driver on Linux
The uninstallation method depends on how the driver was installed. Use the procedure that matches your installation scenario. The following procedures use NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1 as examples.
Note
Perform the steps in the Linux procedures as the root user. If you are logged on as a regular user, use the sudo command to run the steps with root permissions.
(Conditionally required) Step 1: Uninstall the nvidia-fabricmanager service
This step is required only if your GPU-accelerated instance belongs to the ebmgn8v, ebmgn7, ebmgn7e, ebmgn7ex, or sccgn7ex instance family. The following procedure uses NVIDIA Tesla driver version 470.161.03.
Important
If your GPU-accelerated instance is not in the ebmgn8v, ebmgn7, ebmgn7e, ebmgn7ex, or sccgn7ex instance family, skip this step and proceed to Step 2.
-
Run the following commands to stop and disable the nvidia-fabricmanager service.
systemctl stop nvidia-fabricmanager
systemctl disable nvidia-fabricmanager
-
Run the commands to uninstall the nvidia-fabricmanager installation package.
The specific commands depend on the operating system.
-
CentOS or Alibaba Cloud Linux
# Query the package name.
rpm -qa | grep nvidia-fabric-manager
# Run the uninstallation command.
rpm -e nvidia-fabric-manager-470.161.03-1.x86_64
-
Ubuntu
# Query the package name.
dpkg --list |grep nvidia-fabricmanager
# Run the uninstallation command.
apt remove nvidia-fabricmanager-470
Step 2: Uninstall the driver
To manually uninstall an NVIDIA Tesla driver on Ubuntu, CentOS, Alibaba Cloud Linux, or SUSE, use the method that matches the original installation package type: run, deb, or rpm.
Scenario 1: Installed from a run package
If the NVIDIA Tesla driver was automatically installed when you created the GPU-accelerated instance, you must uninstall it by using the method for run installation packages. The following procedure uses NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1 as an example.
-
Run the following command to uninstall the NVIDIA Tesla driver.
/usr/bin/nvidia-uninstall
-
Run the following commands to uninstall CUDA.
/usr/local/cuda/bin/cuda-uninstaller
rm -rf /usr/local/cuda-11.4
[root@xxxxx ~]# /usr/local/cuda/bin/cuda-uninstaller
Successfully uninstalled
Note
The uninstallation command depends on the CUDA version. If the cuda-uninstaller file is not found, check the /usr/local/cuda/bin/ directory for a file name that starts with uninstall_cuda. If you find one, use its name in the command instead of cuda-uninstaller.
-
Run the following command to restart the instance.
Scenario 2: Installed from a deb package
If you installed the NVIDIA Tesla driver from a deb installation package on an Ubuntu operating system, follow this procedure to uninstall it. This example uses NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1.
-
Run the following commands to uninstall CUDA.
apt-get --purge remove "*cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
"*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
rm -rf /usr/local/cuda-11.4
-
Run the following command to uninstall the NVIDIA Tesla driver.
apt-get --purge remove "*nvidia*" "libxnvctrl*"
-
Run the following command to remove unnecessary packages.
-
Run the following command to restart the instance.
Scenario 3: Installed from an rpm package
The uninstallation method for an rpm installation package depends on the operating system.
CentOS 7 or Alibaba Cloud Linux 2
If you installed the NVIDIA Tesla driver from an rpm installation package on CentOS 7 or Alibaba Cloud Linux 2, follow this procedure to uninstall it. This example uses NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1.
-
Run the following commands to uninstall CUDA.
yum remove "cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
"*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
rm -rf /usr/local/cuda-11.4
-
Run the following command to uninstall the NVIDIA Tesla driver.
-
Run the following command to restart the instance.
CentOS 8 or Alibaba Cloud Linux 3
If you installed the NVIDIA Tesla driver from an rpm installation package on CentOS 8 or Alibaba Cloud Linux 3, follow this procedure to uninstall it. This example uses NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1.
-
Run the following commands to uninstall CUDA.
dnf remove "cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
"*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
rm -rf /usr/local/cuda-11.4
-
Run the following command to uninstall the NVIDIA Tesla driver.
dnf module remove --all nvidia-driver
-
Run the following command to reset the NVIDIA Tesla driver module.
dnf module reset nvidia-driver
-
Run the following command to restart the instance.
SUSE
If you installed the NVIDIA Tesla driver from an rpm installation package on a SUSE operating system, follow this procedure to uninstall it. This example uses NVIDIA Tesla driver 470.161.03 and CUDA 11.4.1.
-
Run the following commands to uninstall CUDA.
zypper remove "cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
"*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
rm -rf /usr/local/cuda-11.4
-
Run the following command to uninstall the NVIDIA Tesla driver.
-
Run the following command to restart the instance.