Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.cuda.is_available() is false after CUDA 9.0.176 installed. Could anyone help me with this? Thanks! #15612

Closed
Dee-Ma opened this issue Dec 29, 2018 · 12 comments

Comments

@Dee-Ma
Copy link

Dee-Ma commented Dec 29, 2018

🐛 Bug

Hi,

I just got a very strange problem:

I used the commands: "print(torch.version)
print(torch.version.cuda)
print(torch.backends.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? 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)
@soumith
Copy link
Member

soumith commented Dec 29, 2018

@soumith soumith closed this as completed Dec 29, 2018
@Dee-Ma
Copy link
Author

Dee-Ma commented Dec 29, 2018 via email

@xiaokongkong
Copy link

I met the same problem with you. Now, I find the solution.
Environment :
OS (e.g., Linux): Linux
Python version: Python 3.6.7 : : Anaconda, Inc.

as the steps descripted by https://pytorch.org/

PyTorch Build : Preview(Nightly)
Your OS: Linux
Package: Pip
Language: Python3.6
CUDA: 8.0 (maybe 9.0 is also OK, you can select your own version)
then, the command will appear:

pip install numpy torchvision_nightly
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html

After running above commands successfully,

>>> import torch
>>> torch.cuda.is_available()
True

@yagamimisa
Copy link

I met the same problem with you. Now, I find the solution.
Environment :
OS (e.g., Linux): Linux
Python version: Python 3.6.7 : : Anaconda, Inc.

as the steps descripted by https://pytorch.org/

PyTorch Build : Preview(Nightly)
Your OS: Linux
Package: Pip
Language: Python3.6
CUDA: 8.0 (maybe 9.0 is also OK, you can select your own version)
then, the command will appear:

pip install numpy torchvision_nightly
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html

After running above commands successfully,

>>> import torch
>>> torch.cuda.is_available()
True

This works for me. Thank you.

@greentec
Copy link

greentec commented Jul 16, 2019

I am using cuda 9.0, so I changed cu80 to cu90
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html
and it worked. Thank you.

@zhangqipeng99
Copy link

I am using cuda 9.0, so I changed cu80 to cu90
pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html
and it worked. Thank you.

thanks you very much !!!

@Zhizh1
Copy link

Zhizh1 commented Oct 16, 2019

my torch version is 1.3.0, torchvision version is 0.4.1, when i use "print(torch.version.cuda)
print(torch.backends.cudnn.version()",the output are 10.1.243 and 7603 separately,I use this command “cat /usr/local/cuda/version.txt ”to see my cuda version,the output is 9.0.176.
I fellowed yagamimisa‘s steps and changed cu80 to cu90,but it didn't work for me.
anyone meet this problem?

@soumith
Copy link
Member

soumith commented Oct 17, 2019

@Zhizh1 those steps are outdated. we provide cuda 9.2 and 10.1 binaries as of today. If you upgrade your nvidia driver on your system, you should be good

@wuwuwuxxx
Copy link

wuwuwuxxx commented Nov 5, 2019

I have two machines, one is 1080ti, the other is tesla v100 pcie, the environment is the same: driver version 430.40, cuda 10.1, pytorch 1.3, torchvision 0.4.1. Both nvidia-smi works fine. torch.cuda.is_available() returns false on v100, but true on 1080ti.
any advice on this problem?

@wuwuwuxxx
Copy link

@wuwuwuxxx V100 needs atleast CUDA 10

cuda 10.1 already, installed through conda cudatoolkit, should I install cuda 10 lib in a nvidia way?

@Jasdent
Copy link

Jasdent commented Feb 6, 2020

This is what I got

>>> torch.version.cuda
'10.1.243'
>>> torch.cuda.is_available()
False
~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

I also played around DeepIn, in which some of the message show:

Preparing to unpack .../00-ocl-icd-libopencl1_2.2.11-1ubuntu1_i386.deb ...
Unpacking ocl-icd-libopencl1:i386 (2.2.11-1ubuntu1) ...
Selecting previously unselected package linux-libc-dev:i386.
Preparing to unpack .../01-linux-libc-dev_4.15.0-76.86_i386.deb ...
Unpacking linux-libc-dev:i386 (4.15.0-76.86) ...
Selecting previously unselected package libc6-dev:i386.
Preparing to unpack .../02-libc6-dev_2.27-3ubuntu1_i386.deb ...
Unpacking libc6-dev:i386 (2.27-3ubuntu1) ...
Selecting previously unselected package binfmt-support.
Preparing to unpack .../03-binfmt-support_2.1.8-2_amd64.deb ...
Unpacking binfmt-support (2.1.8-2) ...
Selecting previously unselected package libice6:i386.
Preparing to unpack .../04-libice6_2%3a1.0.9-2_i386.deb ...
Unpacking libice6:i386 (2:1.0.9-2) ...
Selecting previously unselected package libsm6:i386.
Preparing to unpack .../05-libsm6_2%3a1.2.2-1_i386.deb ...
Unpacking libsm6:i386 (2:1.2.2-1) ...
Selecting previously unselected package libxt6:i386.
Preparing to unpack .../06-libxt6_1%3a1.1.5-1_i386.deb ...
Unpacking libxt6:i386 (1:1.1.5-1) ...
Selecting previously unselected package libatk1.0-0:i386.
Preparing to unpack .../07-libatk1.0-0_2.28.1-1_i386.deb ...
Unpacking libatk1.0-0:i386 (2.28.1-1) ...
Selecting previously unselected package libgdk-pixbuf2.0-0:i386.
Preparing to unpack .../08-libgdk-pixbuf2.0-0_2.36.11-2_i386.deb ...

is it the problem that these selection arise from new operations affect cuda ? (like, changing the reference)

@CITIZENDOT
Copy link

CITIZENDOT commented Jul 12, 2020

Make Sure your NVIDIA Driver is latest,
My system specs:
Ubuntu 18.04 64bit
Langauge: python3

I also got same issue after torch installation, But after a bit searching, I installed latest NVIDIA drivers,Check here.

After that, It returned True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants