Why can’t I use pytorch-GPU?

I installed pytorch and cuda with

conda install pytorch torchvision cudatoolkit=10.1 

but when I call torch.cuda.is_available(),it returns False. Why? Is there anything else that should be installed?


In nvidia-smi, it states that you have CUDA 10.2.
You might have some conflicts between your libraries.
You want to make sure that you have the cuda version that matches pytorch.

Also you can try to use cuda in pytorch by doing torch.rand(1).cuda() to see if the error message hints at what is not correct.

Thanks for the reply.
I re-installed NVIDIA-driver version 10.1, and I checked all versions.
But It still doesn’t work.:cry:

Could you post the log of the conda install please?
The local CUDA installation should not be a problem, as the binaries ship with their own CUDA and cudnn libs.

1 Like