Why 'torch.cuda.is_available()' still returned 'False' even I installed CUDA 9.0.176.....Help

Hi,

I just got a very strange problem:

I used the commands: “print(torch. version )
print(torch.version.cuda)
print(torch.bac:sob:kends.cudnn.version())”, the output were:

0.4.1.post2 (PyTorch version)
9.0.176 (CUDA version)
7.1.2 (cuDNN version)

I also used the “nvcc --version”, the results were:
Capture4

It was very strange, it seems that the CUDA version installed in Linux system is 9.0.176, and the CUDA that the PyTorch needed is also 9.0.176, but, the “cuda.is_available()” still returns " False ".

Could anyone help me with this?:sob: Many thanks!

Environment

  • PyTorch Version (e.g., 1.0): 0.4.1.post2
  • OS (e.g., Linux): Linux
  • Python version: 3.6.5 : : Anaconda, Inc.
  • CUDA/cuDNN version: 9.0.176 (CUDA version); 7.1.2 (cuDNN version)
1 Like

Can you try PyTorch 1.0.0, i.e. the latest version of PyTorch?

Also, is the nvidia driver the latest version on your machine?

Hi Smth,

Many thansk for your help. As I am using the University’s HPC machine-I don’t have permission to install any software unless report this issue to staff and they may update it after Christmas holiday.:sob:

In addition, I also use "nvidia-smi’ command to check the NVIDIA driver version, however, it shown: command not found… I am not sure the version of NVIDIA driver.

May I ask if this issue mainly caused by the incompatible versions?

Thanks.

Hi Smth,

Thanks for your reply. May I ask if there is any other possible solution for this?

Thanks.

Hi Smth,

Many thansk for your help. As I am using the University’s HPC machine-I don’t have permission to install any software unless report this issue to staff and they may update it after Christmas holiday.:sob:

In addition, I also use "nvidia-smi’ command to check the NVIDIA driver version, however, it shown: command not found… I am not sure the version of NVIDIA driver.

May I ask if this issue mainly caused by the incompatible versions?

Thanks.

One solution is to try the CUDA8 version of PyTorch that you can install by selecting it from https://pytorch.org

torch.cuda.is_available() can return false if you dont have a new enough NVIDIA driver that your CUDA version needs.

1 Like

Hi Smth,

Many thanks for your help. I will try it.:slightly_smiling_face:

Hello,
I am facing the same problem and tried all the options discussed here, But did not work. Can somebody please help me to solve this problem.

OS: linux
pytorchVesion: 1.0.1
Python version : 3.7.3
Cuda : 9.0.176
Driver vesion: 396.24

Thank you

@TMY
Answered here.

1 Like

really helped a lot! after upgrading to the latest NVIDIA driver, torch.cuda.is_available() returns True!