Cholesky decomposition with Cuda

I want to Cholesky decompose a matrix. It works fine on my CPU but when I move the matrix to my GPU the function fails with the following error:

import torch
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
cov = torch.eye(2).to("cuda")                                                                                                                                                                                                                                                        
torch.cholesky(cov) 
THCudaCheck FAIL file=/pytorch/aten/src/THC/generic/THCTensorMathPairwise.cu line=196 error=11 : invalid argument
Traceback (most recent call last):
  File "cuda_mvn_test.py", line 35, in <module>
    torch.cholesky(cov)
RuntimeError: cuda runtime error (11) : invalid argument at /pytorch/aten/src/THC/generic/THCTensorMathPairwise.cu:196

My system:

Nvidia driver version: 410.79
Cuda version: 10.0
torch version 1.0.1.post2

I had my mate test it on his system and it worked, so it’s something nasty going on.

The issue was that my pip’s torch installation default to Cuda 9. With correct torch package it works fine.

1 Like