Torch.cuda.is_available() return "False" and other error message

Hi All
My OS is Ubuntu2204 ,and I want to use pytorch to do a project.
these are my Environmental parameters:
OS : ubuntu2204
GPU: A100
CUDA: 11.8
pytorch: 2.2.1+cu118

nvidia-smi:
±----------------------------------------------------------------------------+
| NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8 |
|-------------------------------±---------------------±---------------------+
| 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 NVIDIA A100-SXM… Off | 00000000:0F:00.0 Off | On |
| N/A 33C P0 47W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 1 NVIDIA A100-SXM… Off | 00000000:15:00.0 Off | On |
| N/A 33C P0 50W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 2 NVIDIA A100-SXM… Off | 00000000:51:00.0 Off | On |
| N/A 32C P0 48W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 3 NVIDIA A100-SXM… Off | 00000000:54:00.0 Off | On |
| N/A 34C P0 56W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 4 NVIDIA A100-SXM… Off | 00000000:8D:00.0 Off | On |
| N/A 36C P0 54W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 5 NVIDIA A100-SXM… Off | 00000000:92:00.0 Off | On |
| N/A 36C P0 56W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 6 NVIDIA A100-SXM… Off | 00000000:D6:00.0 Off | On |
| N/A 38C P0 60W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+
| 7 NVIDIA A100-SXM… Off | 00000000:DA:00.0 Off | On |
| N/A 38C P0 57W / 400W | 0MiB / 81920MiB | N/A Default |
| | | Enabled |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| MIG devices: |
±-----------------±---------------------±----------±----------------------+
| GPU GI CI MIG | Memory-Usage | Vol| Shared |
| ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG|
| | | ECC| |

After I finished all installation, when using torch.__version__ in the Python interpreter ,it returns ‘2.2.1’. However, when using torch.cuda.is_available() , it returns false and other error message. How can I fix these problem?

Also I have two questions:

  1. If I install cuda-12.0 ,which pytorch version should I install ? 2.2.1+cu121 or 2.2.1+cu118 ?
  2. If My driver version is 520.61.05 ,then I want to install nvidia-fabricmanager , which verison should I install ? fabricmanager-515 or fabricmanager-525 ? (because I can’t find version 520 in apt install)

Thanks ALL