torch._C._cuda_getDeviceCount() > 0 returns False

How can I fix this? I have NVIDIA GPU.

>>> torch._C._cuda_getDeviceCount() > 0
False
>>> torch.cuda.is_available()
False
$ nvidia-smi
Fri Mar  5 17:28:31 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39       Driver Version: 460.39       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| 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 165...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P8     3W /  N/A |   1168MiB /  3911MiB |     17%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1163      G   /usr/lib/xorg/Xorg                133MiB |
|    0   N/A  N/A      2468      G   /usr/lib/xorg/Xorg                579MiB |
|    0   N/A  N/A      2688      G   /usr/bin/gnome-shell              166MiB |
|    0   N/A  N/A      3101      G   ...gAAAAAAAAA --shared-files      196MiB |
|    0   N/A  N/A    684945      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    684970      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    685042      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    685193      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    687287      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    687389      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A    687497      G   /usr/lib/firefox/firefox            1MiB |
|    0   N/A  N/A   1693707      G   /opt/zoom/zoom                     50MiB |
|    0   N/A  N/A   1710209      G   /usr/lib/firefox/firefox            1MiB |
+-----------------------------------------------------------------------------+
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0

>>> torch.__version__
'1.8.0'


Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on Linux


$ lsb_release -a
LSB Version:	core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

on the download Website, I am noticing you don’t have anything for Cuda 11.2 so what should I do in this case?

This is most likely related to this and this post.
Make sure your driver is successfully installed without any errors, restart the machine, and it should work.
Also note, that you don’t need a local CUDA toolkit installation to execute the PyTorch binaries, as they ship with their own CUDA (cudnn, NCCL, etc.) runtimes.
The local CUDA toolkit is needed, if you want to build custom CUDA extensions or PyTorch from source.