Try restarting your PC and immediately check if cuda is available. For me, if I use my laptop for long enough without using/checking for cuda, then PyTorch is unable to find it. So, I need to restart my pc.

Restart PC
conda activate testcuda
import torch
torch.cuda.is_available()

Try this and see if it works.