Hello Alex!



 aclifton314:

For my particular gpu, I was able to get the gpu and cuda to work together (as evident from calling the deviceQuery binary installed whenever I installed cuda). This gpu, which is a cuda capability 2.0, works with cuda 8.
pip install torch==1.0.0 torchvision==0.2.1

then tested pytorch to see if it could find and identify my gpu:
>>> torch.cuda.current_device()
/home/user/.local/lib/python3.6/site-packages/torch/cuda/__init__.py:117: UserWarning:
    Found GPU0 Quadro 4000 which is of cuda capability 2.0.
    PyTorch no longer supports this GPU because it is too old.

At this point, I am assuming that cuda, my gpu, and this older version of pytorch are all playing nicely. However, when I go to train my model I get that RuntimeError I posted originally (copied below):
RuntimeError: cuda runtime error (48) : no kernel image is available for execution on the device at /pytorch/aten/src/THC/generic/THCTensorMath.cu:238



I don’t remember in detail how things unfolded when I got an old
build of pytorch to work with my old gpu.  However, my understanding
of this (which could well be wrong) is that it is perfectly possible for
you to have your cuda version / cuda driver work properly with
your gpu, and have your version of pytorch work properly with your
cuda driver, but have pytorch not work with the specific compute
capability of your gpu.
I believe that a given cuda version / cuda driver typically works with
a range of compute capabilities.
In your case, your version of pytorch explicitly warns you that it needs
a higher compute capability.
So my interpretation is that yes, in a sense, pytorch and cuda and your
gpu are working together, and pytorch correctly recognizes your gpu.
But your version of pytorch knows that it uses some post-capability-2.0
gpu computation features, and warns you of this.  (You could argue
that pytorch could simply say “no gpu” at this point, but it chooses to
admit that there is a recognized gpu, but warns you it’s not good enough.)
Then when you actually try to use the gpu (or at least some specific
“kernel” that uses an unsupported feature), you get the runtime error.
My recollection and understanding is that somewhere in the pytorch
code is the required cuda compute capability, but that this has not
be systematically recorded for the various pytorch builds.  So you can
either try installing a build and see what it thinks of your cpu, or if
you can somehow match up a build to the version of the source from
which it was built, you could look in the code to check the required
compute capability.
What I did when I wanted to use pytorch with my old gpu was to keep
trying older and older archived pytorch builds until I found one that
worked.
But the bottom line is torch.cuda.is_available() == True is not
equivalent to “this pytorch works with this gpu.”
Have fun.
K. Frank