Do you have cudnn installed on the machine while installing?
During the installation there are prints of the cuda version that is detected and the cudnn version that is detected as well.
If your cudnn is at the same place as cuda then it should work fine.
If you won’t want to use cudnn and don’t have it installed, I guess you can set torch.backends.cudnn.enabled=False.