Torch.cuda.is_available() is false for cuda 11.8

I have been struggling with this problem for the last two days yet not resolved.
My torch.cuda.is_available() is always False despite whatever I try. But there is no problem with Tensorflow for the GPU.

My Details:
Cuda Version: 11.8
Cudnn: available for cuda 11.x
python version: 3.10.4
Visual Studio: 2022
OS: Windows 10

Installation Method Used For Pytorch:
Used as mentioned in Pytorch:

pip3 install torch torchvision torchaudio --extra-index-url

Please please please help

Could you post the output of python -m torch.utils.collect_env please?

1 Like

It looks like you are using a CPU build, could you try uninstalling torch and running the command you pasted above again?

1 Like

giving it a try again
Uninstalling with:

pip uninstall torch

pip3 install torch torchvision torchaudio --extra-index-url

This is the latest one…

Thank you all for your kind time and consideration. Solved the issue by following the following steps:

  1. uninstalling cuda 11.8 and installing cuda 11.7
  2. copying all files of cudnn in lib, include and bin to respective folders in cuda
  3. removing the environment and recreating
  4. installing cuda version of pytorch

It’s good to hear you’ve solved the issue.
As can be seen in your screenshots and as @eqy mentioned, you’ve installed the CPU-only PyTorch binary so step 4 was needed.

1 Like

Actuakky, I tried the link for cuda only but I don’t know why the cpu version got installed. I think the fix was at 3.