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

username: randomluck040
cooked: <p>Hi guys, I have following issue and I hope I’m in the right category.</p>
<p>So I have following setup:</p>
<ul>
<li><code>RTX2080 Ti</code></li>
<li><code>Python 3.9.4</code></li>
<li><code>NVIDIA-SMI Driver Version 461.33</code></li>
</ul>
<p>When I run <code>nvidia-smi</code>, 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 <code>nvcc -V</code> it returns:</p>
<pre><code class="lang-auto">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
</code></pre>
<p>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:</p>
<p><code>pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code></p>
<p>Now when I start CMD or run any IDE/Editor and try to <code>import torch</code>, I’m getting following error:<br>
<code>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.</code></p>
<p>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 <code>import torch</code> just fine.</p>

username: el_youssfi_azeddine
cooked: <p>GOOD luck man, I just passed one week to try to fix cuda (rtx3090). Finally I followed this tuto: <a href="https://pub.towardsai.net/installing-pytorch-with-cuda-support-on-windows-10-a38b1134535e" rel="noopener nofollow ugc">Installing Pytorch with CUDA support on Windows 10 | by Eugenia Anello | Towards AI</a></p>
<p>I used cuda 11.0<br>
pytorch: 1.7.1<br>
and it works good now!</p>

username: randomluck040
cooked: <p><a class="mention" href="/u/el_youssfi_azeddine">@el_youssfi_azeddine</a> thank you! I didn’t know that I need to install cuDNN which solved my issues it seems. At least I can import <code>torch</code> now without error. I’ve got following set up working now:</p>
<ul>
<li><code>RTX2080 Ti</code></li>
<li><code>Python 3.9.4</code></li>
<li><code>NVIDIA-SMI Driver Version 461.33</code></li>
<li><code>cuDNN v8.1.1.33 for CUDA 11.2</code></li>
<li><code>pytorch 1.8.1</code></li>
</ul>
<p>Took me a day to figure it out but hey, let the training begin!</p>
<p>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…</p>

username: el_youssfi_azeddine
cooked: <p>yeah pytorch version + cuda version are very important, I tried many versions and finally 1.17.1 and 11.0 works for me now!<br>
good luck!</p>

username: randomluck040
cooked: <p>Just for future reference in case someone stumbles upon the same issue: I’ve managed to get everything working according to the link <a class="mention" href="/u/el_youssfi_azeddine">@el_youssfi_azeddine</a> provided (<a href="https://discuss.pytorch.org/t/installation-of-pytorch-with-cuda-rtx-2080-ti-cuda-11-1/118450/2">here</a>) and everything works correctly now.</p>
<p>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!</p>

username: Abdelkareem_Elkhateb
cooked: <p>can someone share with my the content of the meidum article, i am blocked from medium.<br>
I am also have cuda 12.2 but can’t run pytorch-gpu</p>