Conda keeps superseeding pytorch from cpu to gpu

wilhelm: <p>I installed pytorch with cudatools=12.4 using the conda installation process reported in the website.</p>
<p>Right now I did on a terminal:<br>
<code>$ conda update --all</code></p>
<p>and yes some packages need to be updated, but for some reasons which I don’t understand, conda wants to replace the <em>cuda</em> version of torch with an updated <em>cpu</em> version:</p>
<pre><code class="lang-auto"> - defaults
 - conda-forge
 - nvidia
 - pytorch-nightly
Platform: linux-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    boto3-1.34.116             |     pyhd8ed1ab_0          79 KB  conda-forge
    botocore-1.34.116          |pyge310_1234567_0         6.7 MB  conda-forge
    jinja2-3.1.4               |  py312h06a4308_0         355 KB
    pytorch-2.4.0.dev20240531  |     py3.12_cpu_0        88.5 MB  pytorch-nightly
    requests-2.32.3            |     pyhd8ed1ab_0          57 KB  conda-forge
    torchaudio-2.2.0.dev20240531|        py312_cpu         5.1 MB  pytorch-nightly
    torchvision-0.19.0.dev20240531|        py312_cpu         7.2 MB  pytorch-nightly
    transformers-4.41.2        |     pyhd8ed1ab_0         3.1 MB  conda-forge
    wayland-1.23.0             |       h5291e77_0         315 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       111.3 MB

The following packages will be UPDATED:

  boto3                               1.34.113-pyhd8ed1ab_0 --&gt; 1.34.116-pyhd8ed1ab_0 
  botocore                       1.34.114-pyge310_1234567_0 --&gt; 1.34.116-pyge310_1234567_0 
  gitdb                 pkgs/main::gitdb-4.0.7-pyhd3eb1b0_0 --&gt; conda-forge::gitdb-4.0.11-pyhd8ed1ab_0 
  pytorch            2.4.0.dev20240528-py3.12_cuda12.4_cud~ --&gt; 2.4.0.dev20240531-py3.12_cpu_0 
  requests           pkgs/main/linux-64::requests-2.32.2-p~ --&gt; conda-forge/noarch::requests-2.32.3-pyhd8ed1ab_0 
  torchaudio                  2.2.0.dev20240529-py312_cu124 --&gt; 2.2.0.dev20240531-py312_cpu 
  torchvision                0.19.0.dev20240529-py312_cu124 --&gt; 0.19.0.dev20240531-py312_cpu 
  transformers                          4.41.1-pyhd8ed1ab_0 --&gt; 4.41.2-pyhd8ed1ab_0 
  wayland                                 1.22.0-h8c25dac_1 --&gt; 1.23.0-h5291e77_0 

The following packages will be SUPERSEDED by a higher-priority channel:

  jinja2             conda-forge/noarch::jinja2-3.1.4-pyhd~ --&gt; pkgs/main/linux-64::jinja2-3.1.4-py312h06a4308_0 
  mkl                conda-forge::mkl-2022.1.0-h84fe81f_915 --&gt; pkgs/main::mkl-2022.1.0-hc2b9512_224 
  mkl-devel          conda-forge::mkl-devel-2022.1.0-ha770~ --&gt; pkgs/main::mkl-devel-2022.1.0-h66538d2_224 
  mkl-include        conda-forge::mkl-include-2022.1.0-h84~ --&gt; pkgs/main::mkl-include-2022.1.0-h06a4308_224 

The following packages will be DOWNGRADED:

  intel-openmp                      2023.1.0-hdb19cb5_46306 --&gt; 2022.1.0-h9e868ea_3769 
  pytorch-mutex                                    1.0-cuda --&gt; 1.0-cpu 
  smmap                                  6.0.0-pyhd8ed1ab_1 --&gt; 5.0.0-pyhd8ed1ab_0 


Proceed ([y]/n)?
</code></pre>
<p>But <strong>why</strong>?<br>
In the past I had this problem all the time leading to removing torch and reinstalling it again with the cuda version.</p>
<p>How can I get rid of this problem?<br>
If a new cuda build is available, then it should update, otherwise no.</p>

Eduardo_Lawson: <p>I would suggest to try:</p>
<pre><code class="lang-auto">conda update pytorch
</code></pre>
<p>I prefer to always use this way because conda make thing messy easily. And with that you can see exactly wich packages and versions you will be updating or downloading.</p>