2

I have a conda environment on my Ubuntu 16.04 system.

When I install Pytorch using:

conda install pytorch

and I try and run the script I need, I get the error message:

raise AssertionError("Torch not compiled with CUDA enabled")

From looking at forums, I see that this is because I have installed Pytorch without CUDA support.

I then tried:

conda install -c pytorch torchvision cudatoolkit=10.1 pytorch

but now I get the error:

    from torch.utils.cpp_extension import BuildExtension, CUDAExtension
  File "/home/username/miniconda3/envs/super_resolution/lib/python3.6/site-packages/torch/__init__.py", line 81, in <module>
    from torch._C import *
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found

So it seems that these two installs are installing different versions of Pytorch(?). The first one that seemed to work was Pytorch 1.3.1.

My question: How do I install Pytorch with CUDA enabled, but ensure it is version 1.3.1 so that it works with my system?

1 Answers1

0

You can choose only from a limited selection of pre-built pytorch versions when you use the official anaconda installer at https://pytorch.org/get-started/locally/ (and then choose the cuda option there, of course).

If you want a specific version that is not provided there anymore, you need to install it from source. See an example of how to do that (though for a Windows case, but just to start with) at How to install pytorch (with cuda enabled for a deprecated CUDA cc 3.5 of an old gpu) FROM SOURCE using anaconda prompt on Windows 10?.

questionto42
  • 2,691