Had a similar problem as well.
Make sure your cuda version and server’s driver are compatible:

https://docs.nvidia.com/deploy/cuda-compatibility/index.html#abstract 7
On linux you can easily see that by typing nvidia-smi on terminal.
I had to downgrade my pytorch installation, since I couldn’t update the driver (not sudo).