Complete Guide: Removing, Installing, and Upgrading Cuda, Cudnn, and Pytorch on Windows for All GPU Types in 2024

Posted by

Sure! Let’s begin with removing existing installations of Cuda, Cudnn, and Pytorch before installing or upgrading to the latest versions.

Step 1: Removing Existing Installations
First, we need to uninstall any existing installations of Cuda, Cudnn, and Pytorch on your Windows system. To do this, follow these steps:

  1. Open the Control Panel on your Windows system.
  2. Click on "Programs and Features" or "Add or Remove Programs" depending on your Windows version.
  3. Locate the entries for Cuda, Cudnn, and Pytorch in the list of installed programs.
  4. Select each entry and click on the "Uninstall" button to remove them from your system.

Step 2: Installing Cuda
After removing the existing installations, we can now proceed with installing Cuda.

  1. Visit the NVIDIA website and download the latest version of Cuda for Windows.
  2. Run the Cuda installer and follow the on-screen instructions to complete the installation.
  3. Make sure to select the appropriate settings for your GPU type during the installation process.

Step 3: Installing Cudnn
Next, we will install Cudnn, which is a library for accelerating deep learning computations.

  1. Visit the NVIDIA website and download the latest version of Cudnn for Windows.
  2. Extract the Cudnn files to a location on your system.
  3. Add the path to the Cudnn installation directory to your system’s PATH environment variable.

Step 4: Installing Pytorch
Finally, we will install Pytorch, which is a popular deep learning library that works seamlessly with Cuda and Cudnn.

  1. Open a command prompt or terminal window on your system.
  2. Install Pytorch using pip by running the following command:
    pip install torch torchvision
  3. Once the installation is complete, you can start using Pytorch in your projects.

Step 5: Upgrading Cuda, Cudnn, and Pytorch
To upgrade to the latest versions of Cuda, Cudnn, and Pytorch, follow these steps:

  1. Repeat the installation process for Cuda and Cudnn with the latest versions available on the NVIDIA website.
  2. Update Pytorch to the latest version by running the following command:
    pip install torch torchvision --upgrade

That’s it! You have now completely removed, installed, and upgraded Cuda, Cudnn, and Pytorch on your Windows system for all GPU types in 2024. If you encounter any issues during the process, refer to the official documentation for each tool or seek help from online forums and communities.

0 0 votes
Article Rating
25 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@loki-gv3sq
1 month ago

Why its read timed out i have been stuck at 2.2gb its shows error i have triwd 1000 of time i have 16 gb ram 1650 gtx i have properly installed cuda and visual studio still the download stops after 2.2gb and shows read timed out error

@muhammadalpimalfarolis6730
1 month ago

why we have to uninstall the nvidia graphic driver ?

@solotee5265
1 month ago

Been having a hard time dealing with CUDA versions with Pytorch, thanks to you this problem resolved quickly.
Thank you so much for making this video!

@TrầnQuốcHuy-p5d
1 month ago

Thank you for this video! I have a problem: when I type "nvcc -V," it shows CUDA 11.8, but when I type "nvidia-smi," it shows CUDA 12.5, and when I type "torch.version.cuda," it shows 12.1. So what is my CUDA version? Please help!

@user-vr3bl6cn9e
1 month ago

i have a GeForce GTX 580 with compute capability of 2.0 and name Fermi, the support matrix does not show any relevant version for my case. what do i do?

@iNTERnazionaleNotizia589
1 month ago

After watching your video, Can I conclude as follows: Python and Pytorch will always work normal and independent (no need GPU in the first place).

However, when we run CUDA in Pytorch and have error/issue : does that mean that this issue is always related to the installation of 3 components: CUDA, cuDNN, and Visual Studio? (i.e., so that's why in this video, you only demonstrate the uninstall-installation procedure for these 3 components, and you dont need to reinstall Pytorch and Python from the start)?

@MoniPriyanka
1 month ago

Very helpful, I was struggling with installation. This helped me and finally cuda setup is done.

Thanks a lot of this video.

@AkdenAi
1 month ago

Hello. I did what you did and started using cuda. ​​Thank you very much. So how can I use opencv with cuda? Can you help me?

@rajkumarbetham8878
1 month ago

my system GPU is Geforce GT 710 architecture is Kepler cuda compute capability is 3.5 is it possible to install cuda and pytorch

@archittayal1646
1 month ago

Thank you so much brother! You are a lifesaver. I was so confused trying to do it on my own and then following others but you explained everything perfectly. Keep up the Good work!

@StuartHouston-ep4ch
1 month ago

Do you need to do the install via Windows or will the Anaconda one work?

@GamersHobby
1 month ago

Guys put the pytorch prompt in anaconda prompt it will fsix everything

@ParthivShah
1 month ago

Thank You very much dude.

@aaryachoudhary7949
1 month ago

Installing CUDA 12.4 but pytorch 12.1 won't cause any problems laters right?

@sanskarsingh5654
1 month ago

Hi bro, can we use same setup for installing TensorFlow enabled with GPU?
pytorch is enabled with gpu as i followed your steps, but i want to use tensorflow.
can you help me out thankyou

@SahilKumar-yv8vh
1 month ago

can you make the same for tensorflow please..

@juliaoliva8866
1 month ago

when I import torch I get “[WinError 126] The specified module could not be found. Error loading “…shm.dll” or one of its dependencies.”

@AzeemWaqar-rx6zg
1 month ago

I was having issue with my RTX 3070 for quite sometime but following this video step by step solved it. Thanks!!

@ishant3662
1 month ago

bro my nvidia -smi command didnt work
nvidia -smi

'nvidia' is not recognized as an internal or external command,

operable program or batch file.

@sachinmotwani2905
1 month ago

Quite elaborate and helpful. Thanks!