The detected CUDA version (12.0) mismatches the version that was used to compile PyTorch (11.7)

Hi!
I get this runtimeerror when trying to run my code:

File “C:\Users\isakf\anaconda3\envs\fastreg\lib\site-packages\torch\utils\cpp_extension.py”, line 386, in _check_cuda_version
raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
RuntimeError:
The detected CUDA version (12.0) mismatches the version that was used to compile

This message is from the torch.utils.cpp_extension module.

Im struggling to see where I can download the torch version with CUDA 12 enabled.

Do you have any tips?

The PyTorch binaries do not support CUDA 12 yet and you would have to build from source using a locally installed CUDA 12.0 toolkit.

1 Like