UnsatisfiableError when installing specific versions of pytorch and cudatoolkit


I would like to install pytorch version 0.4.1 with cuda 8.0 with python 3.6.
When I run conda info pytorch, there is one block as follows:

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
    cudatoolkit 8.*
    mkl >=2018
    numpy >=1.11
    python >=3.6,<3.7.0a0

However, when I run conda install -c pytorch pytorch=0.4.1 cudatoolkit=8 I got the following error:

Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - cudatoolkit=8
  - pytorch=0.4.1
Use "conda info <package>" to see the dependencies for each package.

Additional information:
when I run conda search pytorch=0.4.1, I got

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

But running conda install -c pytorch pytorch=0.4.1=py36_cuda8.0.61_cudnn7.1.2_1 yields PackageNotFoundError, while conda install -c pytorch pytorch=0.4.1=py36_cuda9.0.176_cudnn7.1.2_1 does not have any problem.

Can anybody help through this?
Many thanks.

as mentioned on the pytorch website, if you want to install with cudatoolkit 8.0, use

conda install pytorch cuda80 -c pytorch

Hi @smth,

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

[ 71%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/generated/caffe2_gpu_generated_THCTensorMathCompareTByte.cu.o
/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

/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

2 errors detected in the compilation of “/tmp/tmpxft_00006653_00000000-6_THCTensorScatterGather.cpp1.ii”.
CMake Error at caffe2_gpu_generated_THCTensorScatterGather.cu.o.Release.cmake:279 (message):
Error generating file

caffe2/CMakeFiles/caffe2_gpu.dir/build.make:9994: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir//aten/src/THC/caffe2_gpu_generated_THCTensorScatterGather.cu.o’ failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/
/aten/src/THC/caffe2_gpu_generated_THCTensorScatterGather.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs…
/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

/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

2 errors detected in the compilation of “/tmp/tmpxft_00006699_00000000-6_THCTensorIndex.cpp1.ii”.
CMake Error at caffe2_gpu_generated_THCTensorIndex.cu.o.Release.cmake:279 (message):
Error generating file

caffe2/CMakeFiles/caffe2_gpu.dir/build.make:8536: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir//aten/src/THC/caffe2_gpu_generated_THCTensorIndex.cu.o’ failed
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/
/aten/src/THC/caffe2_gpu_generated_THCTensorIndex.cu.o] Error 1
CMakeFiles/Makefile2:923: recipe for target ‘caffe2/CMakeFiles/caffe2_gpu.dir/all’ failed
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed
make: *** [all] Error 2
Failed to run ‘bash tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 nanopb libshm gloo THD c10d’

Solved here.
Please don’t double post as users might be unaware of the solution and might try to solve your issue again.