update: this post might still be of interest to someone, but we have just updated README to indicate that your system installed cuda version no longer matters, i.e. just install pytorch-nightly with cuda92 at the moment no matter what (as long as you have NVIDIA GPU that is)
Let me show the correct and the incorrect pytorch cuda build version installation and how you can tell which one is correct.
So currently on my system with correctly installed cuda92, I get:
$ python -c 'import fastai; fastai.show_install(0)'
[...]
torch cuda : 9.2.148
nvcc cuda : 9.2.148
[...]
You can see that the installed 'torch` package was built against the correct cuda.
Now observe this:
I uninstalled all critical conda/pip fastai-v1 related packages:
conda uninstall -y fastai pytorch-nightly cuda92 torchvision-nightly
pip uninstall -y fastai torch-nightly torchvision-nightly
and on purpose installed the wrong cuda90 (when my system’s cuda is cuda92):
conda install -y -c pytorch pytorch-nightly cuda90
conda install -y -c fastai torchvision-nightly
conda install -y -c fastai fastai
notice that conda had no complaints!
eh voila:
$ python -c 'import fastai; fastai.show_install(0)'
[...]
torch cuda : 9.0.176
nvcc cuda : 9.2.148
[...]
now we know what the problem is. You can see that the installed 'torch` package was built against the wrong cuda build.
You can also tell which pytorch
conda build you have via:
$ conda list pytorch-nightly
pytorch-nightly 1.0.0.dev20181009 py3.6_cuda9.0.176_cudnn7.1.2_0 pytorch
so you can see it’s a cuda-9.0.176
build! This is a wrong build for my cuda-9.2 system.
I couldn’t find how to get the same level of information from pip, other than a hackish:
$ pip show -f torch_nightly | grep cudart
torch/lib/libcudart-72ec04ea.so.9.2
so you can tell from the library version that I have pytorch w/ cuda 9.2 installed with pip.
When you try to uninstall the wrong packages, please note, that with conda it’s not enough to:
conda uninstall -y cuda92
You must do:
conda uninstall -y pytorch-nightly cuda92
In the case of pip
it’s enough to do:
pip uninstall -y torch-nightly
and then re-installing the correct version.
and yes, it’s very confusing that pip
and conda
pytorch packages have different names.
p.s. I used -y
a lot in the examples, which just tells the programs not to wait for confirmation to install/uninstall things and to just proceed without asking for confirmation. Feel free to remove the -y
when you do your own experiments.