Same problem here:
I had torch working for Cuda 11.0. Then upgraded to 11.1 (system update) and I am getting the exact error.
“/usr/lib/python3.8/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at …/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0”
Here is some info which might help you figure out the problem:
PyTorch version: 1.7.0
Is debug build: Yes
CUDA used to build PyTorch: 11.1
OS: Manjaro Linux
GCC version: (GCC) 10.2.0
CMake version: version 3.18.4
Python version: 3.8
Is CUDA available: No
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce RTX 2070
Nvidia driver version: 450.80.02
cuDNN version: Probably one of the following:
/usr/lib/libcudnn.so.8.0.5
/usr/lib/libcudnn_adv_infer.so.8.0.5
/usr/lib/libcudnn_adv_train.so.8.0.5
/usr/lib/libcudnn_cnn_infer.so.8.0.5
/usr/lib/libcudnn_cnn_train.so.8.0.5
/usr/lib/libcudnn_ops_infer.so.8.0.5
/usr/lib/libcudnn_ops_train.so.8.0.5
/usr/lib/libcudnn_static.a
Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect
Having the same issue. Any update how to solve it?
I am having CUDA 11.0 and Nvidia driver 450.80.02.
±----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version: 11.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 Off | 00000000:3B:00.0 Off | 0 |
| N/A 22C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+
Cuda.available is returning False. Any help would be appreciated!!!
I hape the same problem when my Ubuntu 20.04 hibernates. When it wakes up, torch.cuda.is_available() returns False and I have to reboot the system. There is any other way to avoid rebooting?
Yes, if this problem appears after a reboot, it is usually caused by an update that took place since your last reboot, either nvidia driver, or linux kernel.
sudo apt -y install linux-headers-$(uname -r)
If it gives an error and asks you to run apt --fix-broken install , do that instead. Then reboot, and all is well.