Cant install pytorch gpu version via conda

Wesley_Neill: <p>I’m working in a conda environment on windows 10, which I recently had to rebuild.</p>
<p>I was specifically using pytorch 1.10.2 with gpu. Now, whenever I try to install pytorch with</p>
<p><code>conda install pytorch==1.10.2 torchvision torchaudio cudatoolkit=11.3 -c pytorch</code> conda tries to install a cpu only version:</p>
<p><img src="https://discuss.pytorch.org/uploads/default/original/3X/5/a/5abe9a58693566e17bdf369c8766e35ffeccac9e.png" alt="image" data-base62-sha1="cWLkUb1cYvePFha0HGtzS9NE2AK" width="527" height="151"></p>
<p>Previously I had installed pytorch with pip, but decided to be consistent and use only conda since I’m in a conda environment.</p>
<p>Here are the things I’ve tried.</p>
<ul>
<li>uninstalled the global CUDA software I got directly from NVIDIAs website</li>
<li>uninstalled all conda versions of cudatoolkit, pytorch torchvision, etc…</li>
<li>updated my GPU driver to the latest</li>
<li>restart my computer</li>
<li>reinstalled pytorch etc. with conda.</li>
</ul>
<p>None of this has helped. Further, when I uninstalled the CUDA software from the NVIDIA site, I no longer have acces to nvcc, so I can’t see my version number. However this is what I show with <code>nvidia-smi</code>:</p>
<p><img src="https://discuss.pytorch.org/uploads/default/original/3X/3/9/3982f1eb6dd57d762d63cef44229f102738d3720.png" alt="image" data-base62-sha1="8cLLnvMS6kEIIUFtoAjsI6mWJYk" width="581" height="293"></p>
<p>I’m going to try it with pip now, and see if that works. However, I’d really like to know what the issue with conda is even if it does.</p>

ptrblck: <p>The install command works on my Windows laptop:</p>
<pre><code class="lang-auto">conda install pytorch==1.10.2 torchvision torchaudio cudatoolkit=11.3 -c pytorch
...
The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cudatoolkit-11.3.1         |       h59b6b97_2       820.7 MB
    dataclasses-0.8            |     pyh4f3eec9_6          22 KB
    pytorch-1.10.2             |py3.6_cuda11.3_cudnn8_0        1.45 GB  pytorch
    pytorch-mutex-1.0          |             cuda           3 KB  pytorch
    torchaudio-0.10.2          |       py36_cu113         2.1 MB  pytorch
    torchvision-0.11.3         |       py36_cu113         8.9 MB  pytorch
    typing_extensions-4.1.1    |     pyh06a4308_0          29 KB
    ------------------------------------------------------------
                                           Total:        2.26 GB
</code></pre>

Wesley_Neill: <p>I noticed your build has “py3.6” whereas I’m working with 3.8.</p>
<p>I used pip, and everything works now mostly… pytorch3d. ops errors out when passed a tensor on the GPU… <code>RuntimeError: Not compiled with GPU support.</code> I’m going to re-install it now that I have the right version of PyTorch going.</p>
<p>Oh, and even with pip I had to do some weird work around that a coworker had which was to download the pytorch wheel from <a href="http://pyg.org" rel="noopener nofollow ugc">pyg.org</a> and then install it with pip.</p>
<p>Oh well.</p>

ekkap: <p>I was able to workaround this issue by specifying the build numbers for the gpu versions of the relevant packages.<br>
<code>conda install pytorch=1.12.1=py3.9_cuda11.6_cudnn8.3.2_0 torchvision=0.13.1=py39_cu116 torchaudio=0.12.1=py39_cu116 cudatoolkit=11.6 -c pytorch -c conda-forge</code></p>

Saurabh_Kataria: <p>For me too, <code>conda</code> is installing CPU version of pytorch. What worked for me was <code>conda install pytorch=*=*cuda10.2* torchaudio torchvision cudatoolkit=10.2 -c pytorch</code>. I adapted the solution from [<a href="https://stackoverflow.com/a/74621804/3342981" class="inline-onebox" rel="noopener nofollow ugc">python - Why does Anaconda install pytorch cpuonly when I install cuda? - Stack Overflow</a>] slightly for my situation.</p>