Cuda.is_available() throws False

I am using PyTorch on XPS 15 with GTX1050Ti and CUDA 10.1

I installed pytorch using the command:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

However, cuda.is_available() throws False. I dug into the issue and figured out that pytorch can indeed find the right cuda library cudart64_101 but I also get the followng assertion error:
AssertionError(“Torch not compiled with CUDA enabled”)

This seems inconsistent. Can someone help me get this to work?

Also see:

Your local CUDA installation won’t be used, if you install the binaries, as they ship with their own CUDA, cudnn etc.

Did you see, which PyTorch binary (with which CUDA version) was installed?
Also, which driver version are you using locally?

As I mentioned, I used this command:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
to install pytorch

EDIT: I removed the local installation of cuda. I removed pytorch, torchvision and cudatoolkit. Then I did a clean install of pytorch using the above command and still the cuda is avaliable throws false. Any suggestions would be helpful

Sure, but which output did conda give after running the command?

Here’s what I get:

EDIT: That right there is the problem!
I need:

pytorch-1.3.1-py3.7_cuda101_cudnn7_0 
torchvision-0.4.2-py37_cu101 
cudatoolkit=10.1

but when I run:

conda install pytorch-1.3.1-py3.7_cuda101_cudnn7_0 torchvision-0.4.2-py37_cu101 cudatoolkit=10.1 -c pytorch

it doesn’t work

EDIT2:
I manually downloaded the correct versions and used the following command:

conda install pytorch-1.3.1-py3.7_cuda101_cudnn7_0.tar.bz2 torchvision-0.4.2-py37_cu101.tar.bz2 cudatoolkit-10.1.168-0.tar.bz2 ninja-1.9.0-py37h74a9793_0.tar.bz2

and now it works. I think the command on the pytorch website might be broken. How do I report this?

OS: Windows
PyTorch version: 1.4 print(torch.version)
How you installed PyTorch (conda, pip, source): conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
Python version: 3.7.1 (installed previously)
CUDA/cuDNN version: 10.1/7.6 (installed previously using NVidia instructions)
GPU models and configuration: NVIDIA Geforce GTX 1050

import torch
print(torch.cuda.is_available())

FALSE

print(torch.backends.cudnn.version())
7605

(Cudnn installed previously using NVidia instructions)

nvcc --version
Cuda compilation tools, release 10.1, V10.1.105

NVIDIA-SMI
Driver Version 445.75 (installed previously using NVidia instructions)

Then you are probably using the cpu version of PyTorch. Please uninstall cpuonly and PyTorch, and try again.

I did that. I went further and uninstalled all python, conda and everything else I couldn’t live without on my computer. Then I installed miniconda and pytorch. per pytorch install instructions, conda did not install the VC runtime, but once I got that on, I was finally able to get a true value from torch.cuda.is_available().

(See https://github.com/pytorch/pytorch/issues/32916#issuecomment-611857832)