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: https://pytorch.org/

Command:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

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

Reinstalling:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

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.

I also have this problem when the cuda version is 11.8, when using the python -m torch.utils.collect_env, it shows the following information:


I think PyTorch installed the GPU version, but I do not know why this problem happens.
Hi, @ptrblck , could you give me some advice?

Thanks!!!

I’m not familiar with POWER9 binaries and don’t know if the current PyTorch binary builds support it.

Maybe Cuda 11.7 or some lower cuda versions are suitable for power PC architecture?