Trying to install pytorch with GPU

Hi,I have a system with NVIDIA driver 384.13 and Cuda 9.0 installed
The output of the following command :cat /usr/local/cuda/version.txt
is CUDA Version 9.0.176
However when I try to install pytorch using
`conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

the installation finishes ,but when I run the code
python -c ‘import torch; print(torch.rand(2,3).cuda())’
I get the following message
Assertion error torch not compiled with CUDA enabled
Any ideas on how to work around this issue.
I would also like to point out that I might have to migrate to a system where Cuda 8 is installed ,so I am sure that when I execute the command
` ```
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=8.0 -c pytorch

I tried a pip based installation
pip install torch===1.5.0 torchvision===0.6.0 -f
However this gives me an error:

The NVIDIA driver on your system is too old (found version 9000).
Please update your GPU driver by downloading and installing a new
version from the URL:
Alternatively, go to: to install
a PyTorch version that has been compiled with your version
of the CUDA driver.

So i guess the option is here to figure out which version of pytorch is compatible with 9000,and what version python does it support.Currently I am using python 3.8 and I also have a 3.7 environment.

I suggest u download your pytorch version from the pytorch website (select ur cuda version and it will generate a link to whl file )
Just pip install link.

Hi. Are you installing pytorch in a conda environment?

No I install mine with pip but on the the pytorch website, theirs an option for conda Installation

pip is an option but I would definitely go with conda installation if working with environments, which I recommend?

@sparshgarg23, maybe try conda installation with an environment.

As henry said using pip to install pytorch worked.I had to do some digging to find the relevant version.Seems cuda 9 uses pytorch 1.1 and torchvision 0.3

1 Like