Installation of PyTorch with CUDA (RTX 2080 Ti, CUDA 11.1)

Hi guys, I have following issue and I hope I’m in the right category.

So I have following setup:

  • RTX2080 Ti
  • Python 3.9.4
  • NVIDIA-SMI Driver Version 461.33

When I run nvidia-smi, it returns said driver version and CUDA Version 11.2 (which, as I understand, is the most recent CUDA version my GPU supports, right?). When I run nvcc -V it returns:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:12:04_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.relgpu_drvr455TC455_06.29069683_0

which seems to be right since I’ve installed CUDA Toolkit 11.1 because I want it to work with PyTorch. I’m installing PyTorch (from the “getting started” page) with:

pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f

Now when I start CMD or run any IDE/Editor and try to import torch, I’m getting following error:
Error loading "C:\Users\myusername\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cudnn_cnn_train64_8.dll" or one of its dependencies.

I don’t exactly understand what I’m doing wrong. Is there any chance that it’s not working because there is an “ü” in my username which I’ve replaced by “myusername” for privacy purposes? However, when I install the non-CUDA-version, I can import torch just fine.

GOOD luck man, I just passed one week to try to fix cuda (rtx3090). Finally I followed this tuto: Installing Pytorch with CUDA support on Windows 10 | by Eugenia Anello | Towards AI

I used cuda 11.0
pytorch: 1.7.1
and it works good now!

@el_youssfi_azeddine thank you! I didn’t know that I need to install cuDNN which solved my issues it seems. At least I can import torch now without error. I’ve got following set up working now:

  • RTX2080 Ti
  • Python 3.9.4
  • NVIDIA-SMI Driver Version 461.33
  • cuDNN v8.1.1.33 for CUDA 11.2
  • pytorch 1.8.1

Took me a day to figure it out but hey, let the training begin!

Okay, nevermind, now I get a cuDNN error “CUDNN_STATUS_VERSION_MISMATCH”. I’ll try to roll back to 1.7.1 and 11.0 I guess…

1 Like

yeah pytorch version + cuda version are very important, I tried many versions and finally 1.17.1 and 11.0 works for me now!
good luck!

Just for future reference in case someone stumbles upon the same issue: I’ve managed to get everything working according to the link @el_youssfi_azeddine provided (here) and everything works correctly now.

No idea what I’m exactly missing out on since I didn’t read the change logs but I’ll definitely try to work out 1.8.1 with the most recent CUDA toolkit when I have more time!

1 Like