How To Uninstall CUDA (Windows/Mac/Linux)

How To Uninstall CUDA (Windows/Mac/Linux)


Nvidia’s CUDA is a model for parallel computing platforms and application programming interfaces.[1] It stands for Compute Unified Device Architecture and enables developers to utilize the power of Nvidia GPUs for general-purpose processing. This technology has revolutionized fields such as deep learning, scientific simulations, and computational finance, significantly accelerating complex computations. However,  sometimes uninstalling CUDA is necessary, like when your disk is getting full or if there are conflicts with other software, potentially leading to system instability. Additionally, in cases where the GPU is not actively used for parallel computing tasks, uninstalling CUDA can help streamline system resources and improve overall performance. Let’s go through how to uninstall CUDA on Windows, Mac, and Linux.

Uninstall CUDA on Windows

To uninstall CUDA on Windows, you can follow these steps:[2][3]

  • Search for “Control Panel” in the Windows search bar.
  • Select “Uninstall a program” or “Programs and Features” depending on your Windows version, in the Control Panel.
  • Look for “NVIDIA CUDA” or “NVIDIA CUDA Toolkit” in the list of installed programs.
  • Select it and click the “Uninstall” button.
  • Follow the instructions to complete the uninstallation.

If you want to remove all traces of CUDA from your system then you may want to also delete the folder where it was installed. By default, the CUDA Toolkit is installed in the C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA. You might also consider removing any environment variables that you might have setup for CUDA. Typically these are defined in PATH or CUDA_PATH. To do this:

  • Right-click on “This PC” or “My Computer” and select “Properties.”
  • Click on “Advanced system settings” on the left.
  • Click the “Environment Variables” button.
  • In the “User variables” and “System variables” sections, look for any CUDA-related variables and delete them.

Once finished uninstalling CUDA it’s a good idea to restart your PC.

Uninstall CUDA on Mac

To uninstall CUDA on a Mac, you can follow these steps:[4]

  • Open the Terminal application, which you can find in the Utilities folder within the Applications folder, or by searching for “Terminal” using Spotlight.
  • Run the following command to uninstall the CUDA Toolkit:
sudo /usr/local/cuda-X.Y/bin/uninstall_cuda_X.Y.pl

Replace “X.Y” with the version of CUDA installed. You can find your version of CUDA by running:

nvcc --version

For example, if you have CUDA 10.1 installed, you would use:

sudo /usr/local/cuda-10.1/bin/uninstall_cuda_10.1.pl
  • You will be prompted for your password since you are using the “sudo” command.
  • Follow the on-screen instructions to complete the uninstallation process.

After uninstalling the CUDA Toolkit, you may still have some residual files on your system. The easiest way to remove them is by using the terminal. Be cautious when using the rm command to delete files or directories, as it can be irreversible if you delete the wrong files.

  • Open Terminal again.
  • Run the following commands to remove any remaining CUDA-related files:
sudo rm -rf /usr/local/cuda
sudo rm -rf /Library/Frameworks/CUDA.framework
sudo rm -rf /Library/LaunchDaemons/com.nvidia.CUDASoftwareUpdate.plist

Once CUDA is removed it’s a good idea to restart your Mac.

Uninstall CUDA on Linux

Removing CUDA on Linux depends on the method you used to install it. If you installed CUDA using a package manager like apt on Ubuntu or yum on CentOS, you can use the same package manager to remove it.

For example, on Ubuntu, you can uninstall CUDA using apt:[5][6]

sudo apt-get remove --purge cuda

On CentOS, you can use yum:

sudo yum remove cuda

If you installed CUDA using the NVIDIA provided .run installer, you can uninstall it by running the .run file with the –uninstall flag. Navigate to the directory where the CUDA .run file is located and run:

sudo ./cuda_installer_file.run --uninstall

After uninstalling the CUDA Toolkit, you may want to remove any residual files and directories. The CUDA Toolkit is typically installed in the /usr/local/cuda directory. You can remove it using:

sudo rm -r /usr/local/cuda

To ensure that all changes take effect, it’s a good practice to reboot your system.

References

  1. Heller, M. (2022, September 16). What is CUDA? Parallel programming for GPUs. InfoWorld. https://www.infoworld.com/article/3299703/what-is-cuda-parallel-programming-for-gpus.html ↩︎
  2. CUDA installation Guide for Microsoft Windows. (n.d.). https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html ↩︎
  3. Stella. (2023, November 3). How to uninstall NVIDIA drivers on Windows 10? (3 methods) – MiniTool. MiniTool. https://www.minitool.com/news/how-uninstall-nvidia-drivers.html ↩︎
  4. Degtiarenko, I. (2023, January 19). How to uninstall Cuda on your Mac. MacPaw. https://macpaw.com/how-to/uninstall-cuda-driver-mac ↩︎
  5. Neupane, N. P. (2023, October 27). How to remove CUDA completely from Linux? – Netra Prasad Neupane – Medium. Medium. https://netraneupane.medium.com/how-to-remove-cuda-completely-from-linux-72a9b0edca53 ↩︎
  6. Admin. (n.d.). How to uninstall nvidia-cuda-toolkit software package from Ubuntu. https://www.thegeekdiary.com/how-to-uninstall-nvidia-cuda-toolkit-software-package-from-ubuntu/ ↩︎
Published