Did you install the PyTorch binaries? If so, you don’t need a system CUDA installation, since CUDA already ships with PyTorch?
You can check if with print(torch.version.cuda).
I think your driver might be too old, if your PyTorch binaries shipped with a newer CUDA version than 9.1 (which is most likely the case). Have a look at this table 1.4k to see the compatibility, and try to update your driver.