# Cant install pytorch gpu version via conda

**URL:** <https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282>\
**Category:** windows\
**Created:** [March 23, 2022, 7:21pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282 "2022-03-23T19:21:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wesley\_Neill](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/wesley_neill/32/25709_2.png) [@Wesley\_Neill](https://discuss.pytorch.org/u/Wesley_Neill)\
**Post date:** [March 23, 2022, 7:21pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282/1 "2022-03-23T19:21:29Z")

</div>

I’m working in a conda environment on windows 10, which I recently had to rebuild.

I was specifically using pytorch 1.10.2 with gpu. Now, whenever I try to install pytorch with

`conda install pytorch==1.10.2 torchvision torchaudio cudatoolkit=11.3 -c pytorch` conda tries to install a cpu only version:

![image](https://discuss.pytorch.org/uploads/default/original/3X/5/a/5abe9a58693566e17bdf369c8766e35ffeccac9e.png)

Previously I had installed pytorch with pip, but decided to be consistent and use only conda since I’m in a conda environment.

Here are the things I’ve tried.

- uninstalled the global CUDA software I got directly from NVIDIAs website
- uninstalled all conda versions of cudatoolkit, pytorch torchvision, etc…
- updated my GPU driver to the latest
- restart my computer
- reinstalled pytorch etc. with conda.

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 `nvidia-smi`:

![image](https://discuss.pytorch.org/uploads/default/original/3X/3/9/3982f1eb6dd57d762d63cef44229f102738d3720.png)

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.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [March 23, 2022, 9:06pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282/2 "2022-03-23T21:06:38Z")

</div>

The install command works on my Windows laptop:

```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

```

---

<div class="post-metadata">

**Author:** ![Wesley\_Neill](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/wesley_neill/32/25709_2.png) [@Wesley\_Neill](https://discuss.pytorch.org/u/Wesley_Neill)\
**Post date:** [March 23, 2022, 9:19pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282/3 "2022-03-23T21:19:48Z")

</div>

I noticed your build has “py3.6” whereas I’m working with 3.8.

I used pip, and everything works now mostly… pytorch3d. ops errors out when passed a tensor on the GPU… `RuntimeError: Not compiled with GPU support.` I’m going to re-install it now that I have the right version of PyTorch going.

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 [pyg.org](http://pyg.org) and then install it with pip.

Oh well.

---

<div class="post-metadata">

**Author:** ![ekkap](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/e/ad7895/32.png) [@ekkap](https://discuss.pytorch.org/u/ekkap)\
**Post date:** [August 12, 2022, 9:50pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282/4 "2022-08-12T21:50:50Z")

</div>

I was able to workaround this issue by specifying the build numbers for the gpu versions of the relevant packages.  
`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`

---

<div class="post-metadata">

**Author:** ![Saurabh\_Kataria](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/saurabh_kataria/32/12442_2.png) [@Saurabh\_Kataria](https://discuss.pytorch.org/u/Saurabh_Kataria)\
**Post date:** [January 10, 2023, 11:35pm UTC](https://discuss.pytorch.org/t/cant-install-pytorch-gpu-version-via-conda/147282/5 "2023-01-10T23:35:40Z")

</div>

For me too, `conda` is installing CPU version of pytorch. What worked for me was `conda install pytorch=*=*cuda10.2* torchaudio torchvision cudatoolkit=10.2 -c pytorch`. I adapted the solution from [[python - Why does Anaconda install pytorch cpuonly when I install cuda? - Stack Overflow](https://stackoverflow.com/a/74621804/3342981)] slightly for my situation.
