Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 4286
Next
In Process

askthedev.com Latest Questions

Asked: September 24, 20242024-09-24T21:03:06+05:30 2024-09-24T21:03:06+05:30In: Ubuntu

How can I completely uninstall the NVIDIA CUDA toolkit from my Ubuntu system and then install a newer version?

anonymous user

I’ve been trying to get my NVIDIA CUDA toolkit sorted out on my Ubuntu setup, and I’m running into some serious headaches! So here’s my situation: I’ve been using an older version of the CUDA toolkit for a bit now, but I’ve noticed that my machine isn’t performing as well as it used to. I think it might be time to upgrade to a newer version since I’m planning to experiment with some machine learning stuff, and I want to make sure I have the latest features and optimizations.

The problem is that I’m not quite sure how to completely uninstall the version I currently have. I’ve read a few guides online, but they all seem to jump around and assume a level of expertise that I definitely do not have. My CUDA installation is a bit messy—I have no idea if there are remnants left behind that could interfere with a clean install. I’ve tried running the built-in uninstaller, but I think I may have missed some steps because I’m still seeing some CUDA-related files lurking around.

So, my first question is: what’s the best way to completely uninstall the existing CUDA toolkit? Are there specific commands I should run in the terminal? I’d love some step-by-step guidance. Also, if anyone has tips on how to check for leftover files or dependencies to make sure everything’s clean before moving on, that would be super helpful.

Once I’ve got that old version out of the way, I’ll want to install the newer version. I’m looking at the latest version on the NVIDIA website, but I’m a bit concerned about running into issues during installation if I’m not careful. Any advice on that? Should I stick to the command line for the install, or is there a GUI option that would make things easier?

I really appreciate any tips you guys have. I’m a little nervous about messing things up further, but I’m eager to get this up and running for my projects! Thanks in advance!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-24T21:03:07+05:30Added an answer on September 24, 2024 at 9:03 pm






      Uninstalling CUDA Toolkit on Ubuntu


      Uninstalling CUDA Toolkit on Ubuntu

      Getting rid of the old CUDA toolkit can feel a bit tricky when you’re not sure where to start, but don’t worry! I’ll walk you through it step by step.

      Step 1: Uninstall CUDA Toolkit

      First, you’ll want to make sure you completely uninstall the existing version. Open a terminal and run the following command:

      sudo apt-get --purge remove "*cublas*" "*cudnn*" "*cuda*" "*nsight*"

      This command will remove all the CUDA packages. Using –purge ensures that configuration files are also removed.

      Step 2: Check for Leftover Files

      After removing the packages, it’s a good idea to check for any leftover files. Run these commands:

      dpkg -l | grep cuda
      dpkg -l | grep nvidia

      If you see any NVIDIA or CUDA-related packages still listed, you can remove them using a similar sudo apt-get –purge remove command followed by the package names.

      Step 3: Clean Up Residuals

      Once you’ve removed the packages, run this command to clean up:

      sudo apt-get autoremove
      sudo apt-get autoclean

      This helps to get rid of any unnecessary packages and clears out the local repository of retrieved package files.

      Step 4: Installing the New Version

      Now that you have a clean slate, it’s time to install the latest CUDA toolkit. You can choose to do this via the command line or using the NVIDIA installer. Most people recommend using the command line for better control.

      If you want to stick with the command line, here’s a quick way to do it:

      sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu$(lsb_release -rs)/x86_64/7fa2af80.pub
      sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu$(lsb_release -rs)/x86_64/ /"
      sudo apt-get update
      sudo apt-get install cuda

      After installing, you may need to add CUDA to your PATH. Open your ~/.bashrc file and add the following lines at the end:

      export PATH=/usr/local/cuda/bin:${PATH}
      export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
      source ~/.bashrc

      And voila! That should set you up for a fresh start with the latest CUDA toolkit.

      Tips

      • Always check the official NVIDIA documentation for the latest instructions and compatibility notes.
      • Backing up your system before making major changes can save a lot of headaches later.
      • If you’re really unsure, consider reaching out to community forums like Stack Overflow or NVIDIA Developer forums!

      Good luck! You got this!


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-24T21:03:07+05:30Added an answer on September 24, 2024 at 9:03 pm


      To completely uninstall the existing NVIDIA CUDA toolkit on your Ubuntu setup, you can utilize the `apt` package manager if you originally installed it via a repository. Open your terminal and execute the following commands step by step:
      sudo apt-get remove --purge '^cuda.*' followed by sudo apt-get autoremove to remove any unused dependencies. Lastly, you can use sudo rm -rf /usr/local/cuda* to ensure that any CUDA-related folders are deleted. After this, to check for leftover files, you can use dpkg -l | grep cuda to list any remaining CUDA packages; if any packages show up, you can remove them using the sudo apt-get remove command followed by the package name.

      Once you have removed the old version, installing the latest version from the NVIDIA website is recommended. You can choose either using the command line or the graphical installer based on your comfort level. If you prefer the command line, download the CUDA .deb file and follow the installation instructions provided on the official NVIDIA documentation. If you opt for the GUI route, be aware that it often simplifies the process but could also lead to more complex dependency issues. Make sure to consult the release notes for the version you are installing to ensure compatibility with any libraries or dependencies you’re using for machine learning. After installation, verify the setup by running nvcc --version to confirm the installation was successful.


        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.