Detected CUDA version (11.7) mismatches the version that was used to compile PyTorch (10.2)

This issue is raised if your local CUDA toolkit (11.7) doesn’t match the used CUDA runtime from PyTorch (10.2).
Since you are using an Ampere GPU you would need to use CUDA >=11.0 and the 10.2 runtime won’t even work.
Make sure to use the PyTorch binaries with CUDA 11 and try to rebuild.
If you are hitting this issue during a build of a 3rd party library, check if they are using a requirement of a specific torch version and are downloading the CUDA 10.2 runtime in the background.

2 Likes