Did you update PyTorch or could it have been updated/downgraded accidentally by another package?
I would recommend to create a new virtual environment and reinstall the latest PyTorch + CUDA package to check, if your current Python environment might have been broken somehow.