GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation

Alexander_Soare: <p>I installed PyTorch with</p>
<pre><code class="lang-auto">pip3 install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu110/torch_nightly.html
</code></pre>
<p>And then in a Python session I ran:</p>
<pre><code class="lang-auto">import torch
torch.tensor(1).cuda()
</code></pre>
<p>which then raised the warning in the title.</p>
<p>I know this supposedly works for people with CUDA 11.1 (while I’m on 11.0) but before I ruin my life by trying to upgrade my CUDA I thought I’d check here to make sure I’m not missing anything else.</p>

eqy: <p>Just as a sanity check, what does <code>torch.version.cuda</code> show?</p>

Alexander_Soare: <p><a class="mention" href="/u/eqy">@eqy</a> thanks for jumping in. Well it shows 10.2. I understand the significance of this, but I don’t know why it is so or what to do about it.</p>
<p>On another note to provide more context, I’ve been working with PyTorch on my computer for a while now with no problems using <code>pip3 install https://download.pytorch.org/whl/cu110/torch-1.7.1%2Bcu110-cp38-cp38-linux_x86_64.whl</code>. I just want to work with some of the latest FX tracing stuff which is why I want to upgrade to 1.8</p>

eqy: <p>If <code>nvidia-smi</code> shows CUDA 11.0, then the first thing I try to do when I see this (if there aren’t other users on the system or dependencies) is to just <code>pip3 uninstall</code> (or whatever other package managers might have installed PyTorch) until <code>import torch</code> no longer works in a Python interpreter. Then I try the install again and see if it works.</p>
<p>Unfortunately this kind of thing still appears in the year 2021 (e.g,.<br>
<a href="https://discuss.pytorch.org/t/need-help-trouble-with-cuda-capability-sm-86/120235/7">[NEED HELP] Trouble with CUDA capability sm_86 - PyTorch Forums</a>)</p>

ptrblck: <aside class="quote no-group" data-username="Alexander_Soare" data-post="1" data-topic="123499">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alexander_soare/48/24720_2.png" class="avatar"> Alexander_Soare:</div>
<blockquote>
<p>I know this supposedly works for people with CUDA 11.1 (while I’m on 11.0) but before I ruin my life by trying to upgrade my CUDA I thought I’d check here to make sure I’m not missing anything else.</p>
</blockquote>
</aside>
<p>Your local CUDA toolkit won’t be used unless you are building PyTorch from source or a custom CUDA extension, since the binaries ship with the CUDA runtime, which is specified by the install command.</p>
<p>I see that you were using the <code>cu110</code> path, so switch to:</p>
<pre><code class="lang-auto">pip3 install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
</code></pre>
<p>Also, since your current installation shows CUDA10.2, make sure it’s removed first, as explained by <a class="mention" href="/u/eqy">@eqy</a></p>

Alexander_Soare: <p>I’m speechless…</p>
<p>I did not know that about the binaries shipping with CUDA. I just assumed I had to get the one that matches my toolkit.</p>
<p>Problem solved. Thank you!</p>

saran: <aside class="quote no-group" data-username="ptrblck" data-post="5" data-topic="123499">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>building PyTorch from source</p>
</blockquote>
</aside>
<p>i am facing the same problem " i also dont know about binaries and what is mean by " building Pytorch from source ? and what is other way to build pytorch which can work me and can solve this problem "</p>

ptrblck: <p>Your 3090 will work, if you select <code>CUDA11.1</code> <a href="https://pytorch.org/get-started/locally/">here</a> and install the pip wheels or conda binaries using the provided commands.</p>

Neda: <p><a class="mention" href="/u/ptrblck">@ptrblck</a> I have the following error with the <code>CUDA11.4</code></p>
<pre><code class="lang-auto">NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
</code></pre>
<p>I installed PyTorch using this command:</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
</code></pre>
<p>I would be grateful if you please point me in the right direction. Should I install Nightly version or docker?</p>

ptrblck: <p>You have most likely another PyTorch installation with CUDA10.2 in your current environment, which conflicts with the new one.<br>
Try to either uninstall all source builds, pip wheels, and conda binaries in the current environment or create a new virtual environment and reinstall PyTorch again.</p>

Neda: <p>Thanks <a class="mention" href="/u/ptrblck">@ptrblck</a> . Should I install with this box for cuda 11.4?<code>conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia </code></p>

ptrblck: <p>I’m not sure where a “box for cuda11.4” shows up, but I guess you mean the selection in the installation guide?<br>
If so, CUDA11.4 isn’t available and you should use the CUDA11.1 selector.</p>

Neda: <p>Thanks, <a class="mention" href="/u/ptrblck">@ptrblck</a> . Yes, I mean the selection in the installation guide.</p>

SumNeuron: <p>I have installed torch and cudakit 11 via conda from the link above and I when I run torch.version.cuda I get 10.2 instead of 11.3…</p>

ptrblck: <p>Double post from <a href="https://discuss.pytorch.org/t/rtx-3090-compatibility/110014/8">here</a> with a follow-up.</p>

Zakir: <p>Thank you for your great support in this forum. However, I am still confused every time what do you mean by pytorch from source? What do you mean pip wheels or conda binaries.</p>
<p>What I know that it is pip command or conda command we use to install any package. Thank you</p>

ptrblck: <p>“From source” means you are building PyTorch locally on your workstation from its source code by compiling the code.<br>
To do so you would <code>git clone</code> the PyTorch source code, install the compiler toolchain(s), and build it locally on your workstation.</p>
<p>“pip wheels” are the pip binaries installed via <code>pip install torch ...</code>.</p>
<p>“conda binaries” are the conda binaries installed via <code>conda install pytorch ...</code>.</p>
<p>I hope that clears things up.</p>

doukAndy: <p>excuse me ptrblck! i am facing the same problem of</p>
<pre><code class="lang-auto">NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
</code></pre>
<p>with CUDA Version 12.1 (checked by nvidia-smi), and a CUDA runtime version of 10.1 (checked by nvcc -V). which version of pytorch should i install? i searched in <a href="http://pytorch.org" rel="noopener nofollow ugc">pytorch.org</a> for CUDA12.1 but there is no suitable pytorch version <img src="https://discuss.pytorch.org/images/emoji/apple/sob.png?v=12" title=":sob:" class="emoji" alt=":sob:" loading="lazy" width="20" height="20"></p>

ptrblck: <p>Based on the error message you have installed an old PyTorch version which shipped with CUDA 10.2 and you should see it via <code>print(torch.version.cuda)</code>.<br>
Your locally installed CUDA toolkit won’t be used unless you build PyTorch from source or a custom CUDA extension. The current releases binaries ship with CUDA 11.7 and 11.8 and you can install either for your device.</p>

doukAndy: <p>omg thanks A LOT for your advice! Do you mean that the installed CUDA10.1 is no need to be in concern if I’m in a created conda env, and the cuda driver version 12.1 is compatible with pytorch of higher version (shipped with cuda 11.7 or 11.8)?</p>