Colab RuntimeError: "CUDA error: invalid device function"

Google colab notebook comes packaged with PyTorch and GPU support – see this related SO answer, and then you should go change notebook runtime to GPU from CPU (from the top Colab menubar).

Yet trying to train a model from GPyTorch always fails on

/usr/local/lib/python3.6/dist-packages/gpytorch/utils/cholesky.py in psd_safe_cholesky(A, upper, out, jitter)
     19     """
     20     try:
---> 21         L = torch.cholesky(A, upper=upper, out=out)
     22         # TODO: Remove once fixed in pytorch (#16780)
     23         if A.dim() > 2 and A.is_cuda:

RuntimeError: CUDA error: invalid device function

Why?

Relevant info:

import torch
torch.cuda.is_available()

True
print(torch.__version__)
print(gpytorch.__version__)
print(torch.backends.cudnn.version())

1.3.0+cu100
0.3.6
7603

Could you post a code snippet to reproduce this issue?

Running this GPyTorch notebook will do the trick.