This error might be raised e.g. if you’ve upgraded your driver(s) without a restart.
I’m also a bit confused about the output mentioning that CUDA10.2 was used to build PyTorch, but the runtime version points to 10.1, so there might also be a CUDA mismatch on your machine?