Pytorch not getting compiled with GPU when using conda install

Megh_Bhalerao: <p>Hello,<br>
I am getting the error when I run the following-</p>
<pre><code class="lang-auto">&gt;&gt; x = torch.tensor(1).cuda()
&gt;&gt; AssertionError: Torch not compiled with CUDA enabled
</code></pre>
<p>I know that this is a known issue but none of the online solutions have worked for me. Following is the details of my setup:</p>
<pre><code class="lang-auto">nvidia-smi
Sun Mar 12 22:59:10 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.30.02              Driver Version: 530.30.02    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  Tesla V100-SXM2-16GB            On | 00000000:00:04.0 Off |                    0 |
| N/A   36C    P0               33W / 300W|      0MiB / 16384MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   1  Tesla V100-SXM2-16GB            On | 00000000:00:05.0 Off |                    0 |
| N/A   35C    P0               32W / 300W|      0MiB / 16384MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

</code></pre>
<p><code>nvcc -V</code> gives</p>
<pre><code class="lang-auto">nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0
</code></pre>
<p>I have installed PyTorch from the PyTorch website using -</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
</code></pre>
<p>I have pytorch-cuda installed in my env -<br>
<code>conda list | grep cuda</code> gives -</p>
<pre><code class="lang-auto">cuda                      11.7.1                        0    nvidia
cuda-cccl                 11.7.91                       0    nvidia
cuda-command-line-tools   11.7.1                        0    nvidia
cuda-compiler             11.7.1                        0    nvidia
cuda-cudart               11.7.99                       0    nvidia
cuda-cudart-dev           11.7.99                       0    nvidia
cuda-cuobjdump            11.7.91                       0    nvidia
cuda-cupti                11.7.101                      0    nvidia
cuda-cuxxfilt             11.7.91                       0    nvidia
cuda-demo-suite           12.1.55                       0    nvidia
cuda-documentation        12.1.55                       0    nvidia
cuda-driver-dev           11.7.99                       0    nvidia
cuda-gdb                  12.1.55                       0    nvidia
cuda-libraries            11.7.1                        0    nvidia
cuda-libraries-dev        11.7.1                        0    nvidia
cuda-memcheck             11.8.86                       0    nvidia
cuda-nsight               12.1.55                       0    nvidia
cuda-nsight-compute       12.1.0                        0    nvidia
cuda-nvcc                 11.7.99                       0    nvidia
cuda-nvdisasm             12.1.55                       0    nvidia
cuda-nvml-dev             11.7.91                       0    nvidia
cuda-nvprof               12.1.55                       0    nvidia
cuda-nvprune              11.7.91                       0    nvidia
cuda-nvrtc                11.7.99                       0    nvidia
cuda-nvrtc-dev            11.7.99                       0    nvidia
cuda-nvtx                 11.7.91                       0    nvidia
cuda-nvvp                 12.1.55                       0    nvidia
cuda-runtime              11.7.1                        0    nvidia
cuda-sanitizer-api        12.1.55                       0    nvidia
cuda-toolkit              11.7.1                        0    nvidia
cuda-tools                11.7.1                        0    nvidia
cuda-visual-tools         11.7.1                        0    nvidia
cudatoolkit               11.3.1               ha36c431_9    nvidia
pytorch-cuda              11.7                 h67b0de4_1    pytorch
pytorch-mutex             1.0                        cuda    pytorch
</code></pre>
<p><code>python -m torch.utils.collect_env</code> gives</p>
<pre><code class="lang-auto">Collecting environment information...
PyTorch version: 1.12.1
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 11 (bullseye) (x86_64)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
Clang version: Could not collect
CMake version: version 3.18.4
Libc version: glibc-2.31

Python version: 3.10.9 (main, Mar  1 2023, 18:23:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
Is CUDA available: False
CUDA runtime version: 12.1.66
GPU models and configuration: 
GPU 0: Tesla V100-SXM2-16GB
GPU 1: Tesla V100-SXM2-16GB

Nvidia driver version: 530.30.02
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.5
[pip3] numpydoc==1.5.0
[pip3] torch==1.12.1
[pip3] torchaudio==0.12.1
[pip3] torchvision==0.13.1
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               ha36c431_9    nvidia
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0           py310h7f8727e_0  
[conda] mkl_fft                   1.3.1           py310hd6ae3a3_0  
[conda] mkl_random                1.2.2           py310h00e6091_0  
[conda] numpy                     1.23.5          py310hd5efca6_0  
[conda] numpy-base                1.23.5          py310h8e6c178_0  
[conda] numpydoc                  1.5.0           py310h06a4308_0  
[conda] pytorch                   1.12.1          cpu_py310hb1f1ab4_1  
[conda] pytorch-cuda              11.7                 h67b0de4_1    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.12.1              py310_cu113    pytorch
[conda] torchvision               0.13.1              py310_cu113    pytorch
</code></pre>
<p>System information is the following -</p>
<pre><code class="lang-auto">   Static hostname: debian
Transient hostname: megh-gpu-2-v100s-16-vcpus
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 52d373a32c64a329a0d690441b0f70a2
           Boot ID: 844478b6a51748d98fa0725631603484
    Virtualization: kvm
  Operating System: Debian GNU/Linux 11 (bullseye)
            Kernel: Linux 5.10.0-21-cloud-amd64
      Architecture: x86-64
</code></pre>
<p>I am guessing maybe the issue is due to some version mismatch, but I am not sure why - since I have cuda 12 on my system and I know that it is backwards compatible.</p>
<p>I would appreciate any help with regards to this, thanks!</p>

ptrblck: <p>You have installed the CPU-only binary as reported here:</p>
<pre><code class="lang-auto">[conda] pytorch                   1.12.1          cpu_py310hb1f1ab4_1  
</code></pre>
<p>so uninstall it and reinstall the PyTorch binary with the desired CUDA runtime. If you get stuck try to create a new virtual environment and reinstall the binaries there.</p>

Megh_Bhalerao: <p>I tried creating a fresh env and again tried to install the latest PyTorch but it seems like PyTorch is only building the cpu only binary. Is there any way to solve this? is this some issue with my cuda installation on my machine?</p>

ptrblck: <p>Your local CUDA toolkit won’t be used unless you build PyTorch from source or a custom CUDA extension, since the binaries ship with their own CUDA runtime, cuDNN, cuBLAS, NCCL, etc. dependencies. You would only need a properly installed NVIDIA driver to execute PyTorch.<br>
The posted command works for me in a new environment (using Python 3.8) and installs the right packages:</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
...
The following NEW packages will be INSTALLED:
...
  pytorch            pytorch/linux-64::pytorch-1.13.1-py3.8_cuda11.7_cudnn8.5.0_0
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cuda
  requests           conda-forge/noarch::requests-2.28.2-pyhd8ed1ab_0
  svt-av1            conda-forge/linux-64::svt-av1-1.4.1-hcb278e6_0
  torchaudio         pytorch/linux-64::torchaudio-0.13.1-py38_cu117
  torchvision        pytorch/linux-64::torchvision-0.14.1-py38_cu117
</code></pre>
<p>As shown the CUDA 11.7 binaries are properly selected.<br>
Also note that the command installs an older <code>1.12.1</code> release instead of the current stable <code>1.13.1</code> release and 3rd party libs (<code>torchaudio</code> and <code>torchvision</code>) with CUDA 11.3.<br>
I don’t know why <code>conda</code> fails to install the desired version, so could you post the install output showing all dependencies?</p>

Megh_Bhalerao: <aside class="quote no-group" data-username="ptrblck" data-post="4" data-topic="174655">
<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>Also note that the command installs an older <code>1.12.1</code> release instead of the current stable <code>1.13.1</code> release and 3rd party libs (<code>torchaudio</code> and <code>torchvision</code>) with CUDA 11.3.</p>
</blockquote>
</aside>
<p>Thanks, I am using the standard command on the <a href="http://PyTorch.org" rel="noopener nofollow ugc">PyTorch.org</a> website with the following configurations -<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/4/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1.png" data-download-href="https://discuss.pytorch.org/uploads/default/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1" title="Screenshot 2023-03-12 at 9.52.40 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/d/4/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1_2_690x270.png" alt="Screenshot 2023-03-12 at 9.52.40 PM" data-base62-sha1="unDddBTdiM7FRR4ylk1P5drQ5fb" width="690" height="270" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/d/4/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1_2_690x270.png, https://discuss.pytorch.org/uploads/default/optimized/3X/d/4/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1_2_1035x405.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/d/4/d4ed1a34dd7a42b16ad70dc85b8c5d547d4cd9f1_2_1380x540.png 2x" data-dominant-color="F1DAD5"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot 2023-03-12 at 9.52.40 PM</span><span class="informations">1594×624 54.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
When I run the above command I get -</p>
<pre><code class="lang-auto">Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done


==&gt; WARNING: A newer version of conda exists. &lt;==
  current version: 22.9.0
  latest version: 23.1.0

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /home/megh.bhalerao/pkgs/anaconda3/envs/smrsum

  added / updated specs:
    - pytorch
    - pytorch-cuda=11.7
    - torchaudio
    - torchvision


The following NEW packages will be INSTALLED:

  cuda               nvidia/linux-64::cuda-11.7.1-0 None
  cuda-cccl          nvidia/linux-64::cuda-cccl-11.7.91-0 None
  cuda-command-line~ nvidia/linux-64::cuda-command-line-tools-11.7.1-0 None
  cuda-compiler      nvidia/linux-64::cuda-compiler-11.7.1-0 None
  cuda-cudart        nvidia/linux-64::cuda-cudart-11.7.99-0 None
  cuda-cudart-dev    nvidia/linux-64::cuda-cudart-dev-11.7.99-0 None
  cuda-cuobjdump     nvidia/linux-64::cuda-cuobjdump-11.7.91-0 None
  cuda-cupti         nvidia/linux-64::cuda-cupti-11.7.101-0 None
  cuda-cuxxfilt      nvidia/linux-64::cuda-cuxxfilt-11.7.91-0 None
  cuda-demo-suite    nvidia/linux-64::cuda-demo-suite-12.1.55-0 None
  cuda-documentation nvidia/linux-64::cuda-documentation-12.1.55-0 None
  cuda-driver-dev    nvidia/linux-64::cuda-driver-dev-11.7.99-0 None
  cuda-gdb           nvidia/linux-64::cuda-gdb-12.1.55-0 None
  cuda-libraries     nvidia/linux-64::cuda-libraries-11.7.1-0 None
  cuda-libraries-dev nvidia/linux-64::cuda-libraries-dev-11.7.1-0 None
  cuda-memcheck      nvidia/linux-64::cuda-memcheck-11.8.86-0 None
  cuda-nsight        nvidia/linux-64::cuda-nsight-12.1.55-0 None
  cuda-nsight-compu~ nvidia/linux-64::cuda-nsight-compute-12.1.0-0 None
  cuda-nvcc          nvidia/linux-64::cuda-nvcc-11.7.99-0 None
  cuda-nvdisasm      nvidia/linux-64::cuda-nvdisasm-12.1.55-0 None
  cuda-nvml-dev      nvidia/linux-64::cuda-nvml-dev-11.7.91-0 None
  cuda-nvprof        nvidia/linux-64::cuda-nvprof-12.1.55-0 None
  cuda-nvprune       nvidia/linux-64::cuda-nvprune-11.7.91-0 None
  cuda-nvrtc         nvidia/linux-64::cuda-nvrtc-11.7.99-0 None
  cuda-nvrtc-dev     nvidia/linux-64::cuda-nvrtc-dev-11.7.99-0 None
  cuda-nvtx          nvidia/linux-64::cuda-nvtx-11.7.91-0 None
  cuda-nvvp          nvidia/linux-64::cuda-nvvp-12.1.55-0 None
  cuda-runtime       nvidia/linux-64::cuda-runtime-11.7.1-0 None
  cuda-sanitizer-api nvidia/linux-64::cuda-sanitizer-api-12.1.55-0 None
  cuda-toolkit       nvidia/linux-64::cuda-toolkit-11.7.1-0 None
  cuda-tools         nvidia/linux-64::cuda-tools-11.7.1-0 None
  cuda-visual-tools  nvidia/linux-64::cuda-visual-tools-11.7.1-0 None
  cudatoolkit        nvidia/linux-64::cudatoolkit-11.3.1-ha36c431_9 None
  ffmpeg             pytorch/linux-64::ffmpeg-4.3-hf484d3e_0 None
  gds-tools          nvidia/linux-64::gds-tools-1.6.0.25-0 None
  gnutls             pkgs/main/linux-64::gnutls-3.6.15-he1e5248_0 None
  lame               pkgs/main/linux-64::lame-3.100-h7b6447c_0 None
  libcublas          nvidia/linux-64::libcublas-11.10.3.66-0 None
  libcublas-dev      nvidia/linux-64::libcublas-dev-11.10.3.66-0 None
  libcufft           nvidia/linux-64::libcufft-10.7.2.124-h4fbf590_0 None
  libcufft-dev       nvidia/linux-64::libcufft-dev-10.7.2.124-h98a8f43_0 None
  libcufile          nvidia/linux-64::libcufile-1.6.0.25-0 None
  libcufile-dev      nvidia/linux-64::libcufile-dev-1.6.0.25-0 None
  libcurand          nvidia/linux-64::libcurand-10.3.2.56-0 None
  libcurand-dev      nvidia/linux-64::libcurand-dev-10.3.2.56-0 None
  libcusolver        nvidia/linux-64::libcusolver-11.4.0.1-0 None
  libcusolver-dev    nvidia/linux-64::libcusolver-dev-11.4.0.1-0 None
  libcusparse        nvidia/linux-64::libcusparse-11.7.4.91-0 None
  libcusparse-dev    nvidia/linux-64::libcusparse-dev-11.7.4.91-0 None
  libiconv           pkgs/main/linux-64::libiconv-1.16-h7f8727e_2 None
  libidn2            pkgs/main/linux-64::libidn2-2.3.2-h7f8727e_0 None
  libnpp             nvidia/linux-64::libnpp-11.7.4.75-0 None
  libnpp-dev         nvidia/linux-64::libnpp-dev-11.7.4.75-0 None
  libnvjpeg          nvidia/linux-64::libnvjpeg-11.8.0.2-0 None
  libnvjpeg-dev      nvidia/linux-64::libnvjpeg-dev-11.8.0.2-0 None
  libtasn1           pkgs/main/linux-64::libtasn1-4.16.0-h27cfd23_0 None
  libunistring       pkgs/main/linux-64::libunistring-0.9.10-h27cfd23_0 None
  nettle             pkgs/main/linux-64::nettle-3.7.3-hbbd107a_1 None
  nsight-compute     nvidia/linux-64::nsight-compute-2023.1.0.15-0 None
  openh264           pkgs/main/linux-64::openh264-2.1.1-h4ff587b_0 None
  pytorch-cuda       pytorch/noarch::pytorch-cuda-11.7-h67b0de4_1 None
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cuda None
  torchaudio         pytorch/linux-64::torchaudio-0.12.1-py310_cu113 None
  torchvision        pytorch/linux-64::torchvision-0.13.1-py310_cu113 None


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: \ By downloading and using the CUDA Toolkit conda packages, you accept the terms and conditions of the CUDA End User License Agreement (EULA): https://docs.nvidia.com/cuda/eula/index.html

done
Retrieving notices: ...working... done

</code></pre>
<p>To me it seems as though nothing is getting downloaded. Please let me know if I am missing anything.<br>
Thanks!</p>

Megh_Bhalerao: <p>Update -<br>
When I install pytorch via - <code>pip3 install torch torchvision torchaudio</code> inside my env which I created using <code>conda</code> - now I am able to do stuff on GPU i.e. <code>torch.cuda.is_available()</code> returns <code>True</code> - not sure why I was facing an issue with conda.</p>
<p>If the following information helps - I installed cuda following the documentation here -<a href="https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements" class="inline-onebox" rel="noopener nofollow ugc">cuda-installation-guide-linux 12.1 documentation</a></p>
<p>It was a bare bones machine which did not have cuda installed - was it some issue with the way I installed cuda because of which conda was not Able to install it. I followed the instructions exactly on the above webpage.</p>
<p>The below is my new collect-env</p>
<pre><code class="lang-auto">Collecting environment information...
PyTorch version: 1.13.1+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 11 (bullseye) (x86_64)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
Clang version: Could not collect
CMake version: version 3.18.4
Libc version: glibc-2.31

Python version: 3.10.9 (main, Mar  8 2023, 10:47:38) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 12.1.66
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: Tesla V100-SXM2-16GB
GPU 1: Tesla V100-SXM2-16GB

Nvidia driver version: 530.30.02
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.24.2
[pip3] torch==1.13.1
[pip3] torchaudio==0.13.1
[pip3] torchvision==0.14.1
[conda] numpy                     1.24.2                   pypi_0    pypi
[conda] pytorch-cuda              11.7                 h67b0de4_1    pytorch
[conda] torch                     1.13.1                   pypi_0    pypi
[conda] torchaudio                0.13.1                   pypi_0    pypi
[conda] torchvision               0.14.1                   pypi_0    pypi

</code></pre>

ptrblck: <aside class="quote no-group" data-username="Megh_Bhalerao" data-post="6" data-topic="174655">
<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/megh_bhalerao/48/13547_2.png" class="avatar"> Megh_Bhalerao:</div>
<blockquote>
<p>It was a bare bones machine which did not have cuda installed - was it some issue with the way I installed cuda because of which conda was not Able to install it.</p>
</blockquote>
</aside>
<p>No, since your local CUDA toolkit won’t be used unless you build from source or a custom CUDA extension as described in my previous post.</p>
<p>The <code>conda install</code> command still shows the wrong <code>torchvision</code> and <code>torchaudio</code> versions and does not even show a <code>pytorch</code> package. It also seems you are trying to run this command in the already broken environment so did you try to create a new and empty virtual environment as suggested previously?</p>

Megh_Bhalerao: <aside class="quote no-group" data-username="ptrblck" data-post="7" data-topic="174655">
<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>No, since your local CUDA toolkit won’t be used unless you build from source or a custom CUDA extension as described in my previous post.</p>
</blockquote>
</aside>
<p>Oh, yes sorry, I do understand that - the machine did not even have Nvidia drivers installed so I had to do that too which I followed the instructions on the link in my previous post.</p>
<p>Yes - when I create a new and fresh env using the command -<br>
<code>conda create -n test anaconda</code><br>
Then run the PyTorch installation command via conda in the previous posts I get the exactly same log message as in this post -</p><aside class="quote quote-modified" data-post="5" data-topic="174655">
  <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/megh_bhalerao/48/13547_2.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/pytorch-cuda-11-7-not-compiled-on-machine-with-cuda-12-1/174655/5">Pytorch not getting compiled with GPU when using conda install</a> 
  </div>
  <blockquote>
    Thanks, I am using the standard command on the <a href="http://PyTorch.org" rel="noopener nofollow ugc">PyTorch.org</a> website with the following configurations - 
[Screenshot 2023-03-12 at 9.52.40 PM] 
When I run the above command I get - 
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environme…
  </blockquote>
</aside>
<p><img src="https://discuss.pytorch.org/images/emoji/apple/confused.png?v=12" title=":confused:" class="emoji only-emoji" alt=":confused:" loading="lazy" width="20" height="20"></p>

ptrblck: <aside class="quote no-group" data-username="Megh_Bhalerao" data-post="8" data-topic="174655">
<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/megh_bhalerao/48/13547_2.png" class="avatar"> Megh_Bhalerao:</div>
<blockquote>
<p>Then run the PyTorch installation command via conda in the previous posts I get the exactly same log message as in this post -</p>
</blockquote>
</aside>
<p>Your log message doesn’t even show PyTorch as an installed library in “The following NEW packages will be INSTALLED” so it seems it might be coming from somewhere else (maybe the base environment)?<br>
Compare your install log to mine which shows that the latest stable release with CUDA 11.7 will be installed <a href="https://discuss.pytorch.org/t/pytorch-not-getting-compiled-with-gpu-when-using-conda-install/174655/4">here</a>.</p>

Megh_Bhalerao: <p>Hi - I think I found out what the issue was - so I was creating an environment using<br>
<code>conda create -n my_env anaconda</code> when I am in my base env<br>
When I was installing <code>anaconda</code> as in the above command it was installing the cpu version of <code>pytorch</code> for some reason.<br>
When I create a fresh env with no <code>anaconda</code> I.e like this <code>conda create -n my_env</code> - and then run the <code>conda install pytorch .... etc</code> as taken from <a href="http://pytorch.org" rel="noopener nofollow ugc">pytorch.org</a> it seems to install cuda pytorch correctly.</p>
<p>Not sure why anaconda was installing pytorch cpu - I saw this from the Conda create logs when I was creating the env</p>
<p>Thanks!</p>