CUDA error , while checking cuda in system

username: saurrav
cooked: <p><strong>/home/kash/pytorch/lib/python3.8/site-packages/torch/cuda/<strong>init</strong>.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 /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() &gt; 0</strong></p>
<p>why is this error showing<br>
when i installed first time there is no error it show cuda (torch.cuda.is_available())<br>
now showing this error<br>
Driver Version: 450.80.02<br>
CUDA Version: 11.0</p>

username: ptrblck
cooked: <p>Your system might be in a bad state and PyTorch is unable to detect the GPUs.<br>
Did you upgrade any drivers or installed a CUDA toolkit without rebooting?<br>
Are you able to run any other CUDA applications?</p>

username: saurrav
cooked: <p>no bro i cant access my gpu on another app(blender) also…what should i do…<br>
i installed using terminal<br>
<strong>sudo apt install -y nvidia-driver nvidia-cuda-toolkit</strong><br>
please tell me how to install</p>

username: saurrav
cooked: <p>±----------------------------------------------------------------------------+<br>
| NVIDIA-SMI 450.80.02    Driver Version: 450.80.02    CUDA Version: 11.0     |<br>
|-------------------------------±---------------------±---------------------+<br>
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |<br>
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |<br>
|                               |                      |               MIG M. |<br>
|===============================+======================+======================|<br>
|   0  GeForce GTX 1650    On   | 00000000:01:00.0 Off |                  N/A |<br>
| N/A   39C    P8     2W /  N/A |      6MiB /  3911MiB |      0%      Default |<br>
|                               |                      |                  N/A |<br>
±------------------------------±---------------------±---------------------+</p>
<p>±----------------------------------------------------------------------------+<br>
| Processes:                                                                  |<br>
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |<br>
|        ID   ID                                                   Usage      |<br>
|=============================================================================|<br>
|    0   N/A  N/A      1003      G   /usr/lib/xorg/Xorg                  4MiB |<br>
±----------------------------------------------------------------------------+</p>

username: saurrav
cooked: <p>Bro in nvidia-smi it show cuda version 11.0…but nvidia-cuda-toolkit is 11.1.smthg…is that a problem ?</p>

username: AnoopCS
cooked: <p>Getting similar error… Please let me know how to resolve this. Output of collect_env.py is as follows.</p>
<p>Collecting environment information…<br>
/home/XXXXX/.local/lib/python3.7/site-packages/torch/cuda/<strong>init</strong>.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  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)<br>
return torch._C._cuda_getDeviceCount() &gt; 0<br>
PyTorch version: 1.7.1<br>
Is debug build: False<br>
CUDA used to build PyTorch: 10.2<br>
ROCM used to build PyTorch: N/A</p>
<p>OS: Ubuntu 16.04.7 LTS (x86_64)<br>
GCC version: (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010<br>
Clang version: Could not collect<br>
CMake version: version 3.18.1</p>
<p>Python version: 3.7 (64-bit runtime)<br>
Is CUDA available: False<br>
CUDA runtime version: 10.1.105<br>
GPU models and configuration:<br>
GPU 0: GeForce RTX 2080 Ti<br>
GPU 1: GeForce RTX 2080 Ti<br>
GPU 2: GeForce RTX 2080 Ti<br>
GPU 3: GeForce RTX 2080 Ti</p>
<p>Nvidia driver version: 460.39<br>
cuDNN version: Probably one of the following:<br>
/opt/arrayfire/lib64/libcudnn.so.7.6.5<br>
/usr/lib/x86_64-linux-gnu/libcudnn.so.6.0.21<br>
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5<br>
/usr/local/cuda-10.0/lib64/libcudnn.so.7<br>
HIP runtime version: N/A<br>
MIOpen runtime version: N/A</p>
<p>Versions of relevant libraries:<br>
[pip3] numpy==1.14.6<br>
[pip3] torch==1.7.1<br>
[pip3] torchaudio==0.7.2<br>
[pip3] torchfile==0.1.0<br>
[pip3] torchlibrosa==0.0.4<br>
[pip3] torchtext==0.6.0<br>
[pip3] torchvision==0.8.2<br>
[conda] blas                      1.0                         mkl<br>
[conda] cudatoolkit               10.1.243             h6bb024c_0<br>
[conda] magma-cuda110             2.5.2                         1    pytorch<br>
[conda] mkl                       2019.4                      243<br>
[conda] mkl-include               2020.2                      256<br>
[conda] mkl-service               2.3.0            py37he904b0f_0<br>
[conda] mkl_fft                   1.0.14           py37ha843d7b_0<br>
[conda] mkl_random                1.1.0            py37hd6b4f25_0<br>
[conda] numpy                     1.17.2           py37haad9e8e_0<br>
[conda] numpy-base                1.17.2           py37hde5b4d6_0<br>
[conda] numpydoc                  0.9.1                      py_0<br>
[conda] pytorch                   1.7.1           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch<br>
[conda] torchaudio                0.5.0a0+ac5dd79          pypi_0    pypi<br>
[conda] torchfile                 0.1.0                    pypi_0    pypi<br>
[conda] torchvision               0.8.2                py37_cu101    pytorch</p>

username: ptrblck
cooked: <p>This error might be raised e.g. if you’ve upgraded your driver(s) without a restart.<br>
I’m also a bit confused about the output mentioning that CUDA10.2 was used to build PyTorch, but the runtime version points to 10.1, so there might also be a CUDA mismatch on your machine?</p>