Do you get the same error using dummy CUDA calls like:
torch.cuda.init()
# or
a = torch.randn(1, device='cuda')

Did you update the NVIDIA drivers? If so, I would restart the machine and see, if the error disappears.