UnsatisfiableError when installing specific versions of pytorch and cudatoolkit

username: ydawei
cooked: <p>Hi,</p>
<p>I would like to install pytorch version 0.4.1 with cuda 8.0 with python 3.6.<br>
When I run <code>conda info pytorch</code>, there is one block as follows:</p>
<pre><code class="lang-auto">pytorch 0.4.1 py36_cuda8.0.61_cudnn7.1.2_1
------------------------------------------
file name   : pytorch-0.4.1-py36_cuda8.0.61_cudnn7.1.2_1.tar.bz2
name        : pytorch
version     : 0.4.1
build string: py36_cuda8.0.61_cudnn7.1.2_1
build number: 1
channel     : https://conda.anaconda.org/pytorch/linux-64
size        : 391.6 MB
arch        : x86_64
constrains  : ()
features    : cuda80
license     : BSD 3-Clause
license_family: BSD
md5         : 4a9f893e6ff0de7e7e3055d3eb5b6ba0
platform    : linux
subdir      : linux-64
timestamp   : 1532582636355
url         : https://conda.anaconda.org/pytorch/linux-64/pytorch-0.4.1-py36_cuda8.0.61_cudnn7.1.2_1.tar.bz2
dependencies:
    cffi
    cudatoolkit 8.*
    mkl &gt;=2018
    ninja
    numpy &gt;=1.11
    python &gt;=3.6,&lt;3.7.0a0
</code></pre>
<p>However, when I run <code>conda install -c pytorch pytorch=0.4.1 cudatoolkit=8</code> I got the following error:</p>
<pre><code class="lang-auto">Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - cudatoolkit=8
  - pytorch=0.4.1
Use "conda info &lt;package&gt;" to see the dependencies for each package.
</code></pre>
<p>Additional information:<br>
when I run <code>conda search pytorch=0.4.1</code>, I got</p>
<pre><code class="lang-auto">Loading channels: done
# Name                  Version           Build  Channel             
pytorch                   0.4.1 py27_cuda8.0.61_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py27_cuda9.0.176_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py27_cuda9.2.148_cudnn7.1.4_1  pytorch             
pytorch                   0.4.1  py27ha74772b_0  pkgs/main           
pytorch                   0.4.1 py35_cuda8.0.61_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py35_cuda9.0.176_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py35_cuda9.2.148_cudnn7.1.4_1  pytorch             
pytorch                   0.4.1  py35ha74772b_0  pkgs/main           
pytorch                   0.4.1 py36_cuda8.0.61_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py36_cuda9.0.176_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py36_cuda9.2.148_cudnn7.1.4_1  pytorch             
pytorch                   0.4.1  py36ha74772b_0  pkgs/main           
pytorch                   0.4.1 py37_cuda8.0.61_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py37_cuda9.0.176_cudnn7.1.2_1  pytorch             
pytorch                   0.4.1 py37_cuda9.2.148_cudnn7.1.4_1  pytorch             
pytorch                   0.4.1  py37ha74772b_0  pkgs/main
</code></pre>
<p>But running <code>conda install -c pytorch pytorch=0.4.1=py36_cuda8.0.61_cudnn7.1.2_1</code> yields PackageNotFoundError, while <code>conda install -c pytorch pytorch=0.4.1=py36_cuda9.0.176_cudnn7.1.2_1</code> does not have any problem.</p>
<p>Can anybody help through this?<br>
Many thanks.</p>

username: smth
cooked: <p>as mentioned on the pytorch website, if you want to install with cudatoolkit 8.0, use</p>
<pre><code class="lang-auto">conda install pytorch cuda80 -c pytorch
</code></pre>

username: Muhammad_Maaz
cooked: <p>Hi <a class="mention" href="/u/smth">@smth</a>,</p>
<p>I am trying to install PyTorch v0.4.1 with Cuda 10 on Ubuntu 18.04 for Python 3.6. I am building it from source and getting the following message. Is there any solution that you know? I would really appreciate your response. Thanks</p>
<p>[ 71%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/generated/caffe2_gpu_generated_THCTensorMathCompareTByte.cu.o<br>
/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/aten/src/THC/THCAtomics.cuh(100): error: cannot overload functions distinguished by return type alone</p>
<p>/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/aten/src/THC/THCAtomics.cuh(123): error: return value type does not match the function type</p>
<p>2 errors detected in the compilation of “/tmp/tmpxft_00006653_00000000-6_THCTensorScatterGather.cpp1.ii”.<br>
CMake Error at caffe2_gpu_generated_THCTensorScatterGather.cu.o.Release.cmake:279 (message):<br>
Error generating file<br>
/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCTensorScatterGather.cu.o</p>
<p>caffe2/CMakeFiles/caffe2_gpu.dir/build.make:9994: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/<strong>/aten/src/THC/caffe2_gpu_generated_THCTensorScatterGather.cu.o’ failed<br>
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/</strong>/aten/src/THC/caffe2_gpu_generated_THCTensorScatterGather.cu.o] Error 1<br>
make[2]: *** Waiting for unfinished jobs…<br>
/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/aten/src/THC/THCAtomics.cuh(100): error: cannot overload functions distinguished by return type alone</p>
<p>/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/aten/src/THC/THCAtomics.cuh(123): error: return value type does not match the function type</p>
<p>2 errors detected in the compilation of “/tmp/tmpxft_00006699_00000000-6_THCTensorIndex.cpp1.ii”.<br>
CMake Error at caffe2_gpu_generated_THCTensorIndex.cu.o.Release.cmake:279 (message):<br>
Error generating file<br>
/home/maaz/mmaaz60/pytorch_from_source/pytorch-0.4.1/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCTensorIndex.cu.o</p>
<p>caffe2/CMakeFiles/caffe2_gpu.dir/build.make:8536: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/<strong>/aten/src/THC/caffe2_gpu_generated_THCTensorIndex.cu.o’ failed<br>
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/</strong>/aten/src/THC/caffe2_gpu_generated_THCTensorIndex.cu.o] Error 1<br>
CMakeFiles/Makefile2:923: recipe for target ‘caffe2/CMakeFiles/caffe2_gpu.dir/all’ failed<br>
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2<br>
Makefile:140: recipe for target ‘all’ failed<br>
make: *** [all] Error 2<br>
Failed to run ‘bash tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 nanopb libshm gloo THD c10d’</p>

username: ptrblck
cooked: <p>Solved <a href="https://discuss.pytorch.org/t/cant-install-pytorch0-4-1-from-source/80446/5">here</a>.<br>
Please don’t double post as users might be unaware of the solution and might try to solve your issue again.</p>