CUDA error , while checking cuda in system

/home/kash/pytorch/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 /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0

why is this error showing
when i installed first time there is no error it show cuda (torch.cuda.is_available())
now showing this error
Driver Version: 450.80.02
CUDA Version: 11.0

Your system might be in a bad state and PyTorch is unable to detect the GPUs.
Did you upgrade any drivers or installed a CUDA toolkit without rebooting?
Are you able to run any other CUDA applications?

no bro i cant access my gpu on another app(blender) also…what should i do…
i installed using terminal
sudo apt install -y nvidia-driver nvidia-cuda-toolkit
please tell me how to install

±----------------------------------------------------------------------------+
| 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 GeForce GTX 1650 On | 00000000:01:00.0 Off | N/A |
| N/A 39C P8 2W / N/A | 6MiB / 3911MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1003 G /usr/lib/xorg/Xorg 4MiB |
±----------------------------------------------------------------------------+

Bro in nvidia-smi it show cuda version 11.0…but nvidia-cuda-toolkit is 11.1.smthg…is that a problem ?

Getting similar error… Please let me know how to resolve this. Output of collect_env.py is as follows.

Collecting environment information…
/home/XXXXX/.local/lib/python3.7/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 /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
PyTorch version: 1.7.1
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 16.04.7 LTS (x86_64)
GCC version: (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Clang version: Could not collect
CMake version: version 3.18.1

Python version: 3.7 (64-bit runtime)
Is CUDA available: False
CUDA runtime version: 10.1.105
GPU models and configuration:
GPU 0: GeForce RTX 2080 Ti
GPU 1: GeForce RTX 2080 Ti
GPU 2: GeForce RTX 2080 Ti
GPU 3: GeForce RTX 2080 Ti

Nvidia driver version: 460.39
cuDNN version: Probably one of the following:
/opt/arrayfire/lib64/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.6.0.21
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/local/cuda-10.0/lib64/libcudnn.so.7
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.14.6
[pip3] torch==1.7.1
[pip3] torchaudio==0.7.2
[pip3] torchfile==0.1.0
[pip3] torchlibrosa==0.0.4
[pip3] torchtext==0.6.0
[pip3] torchvision==0.8.2
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] magma-cuda110 2.5.2 1 pytorch
[conda] mkl 2019.4 243
[conda] mkl-include 2020.2 256
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.0.14 py37ha843d7b_0
[conda] mkl_random 1.1.0 py37hd6b4f25_0
[conda] numpy 1.17.2 py37haad9e8e_0
[conda] numpy-base 1.17.2 py37hde5b4d6_0
[conda] numpydoc 0.9.1 py_0
[conda] pytorch 1.7.1 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch
[conda] torchaudio 0.5.0a0+ac5dd79 pypi_0 pypi
[conda] torchfile 0.1.0 pypi_0 pypi
[conda] torchvision 0.8.2 py37_cu101 pytorch

This error might be raised e.g. if you’ve upgraded your driver(s) without a restart.
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?