HI,
I would first check if nvidia-smi works? Do you see your gpus there?
If nvidia-smi fails to connect to the nvidia driver as well, then the “simplest” fix on ubuntu-like machines is to completely uninstall the nvidia drivers and then reinstall them (whichever way you installed them in the first place or google how to do it).
If nvidia-smi works fine, you can start a python shell and do
import torch
torch.cuda.is_available()
torch.rand(10, device="cuda")

Does it work? does it return True and a cuda tensor?