Raise an error "Cuda that does not match the version used to compile Pytorch binaries" when install apex

Compiling cuda extensions with
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2019 NVIDIA Corporation
    Built on Fri_Feb__8_19:08:17_PST_2019
    Cuda compilation tools, release 10.1, V10.1.105
    from /usr/local/cuda/bin

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-hreb_nq5/setup.py", line 64, in <module>
      File "/tmp/pip-req-build-hreb_nq5/setup.py", line 54, in check_cuda_torch_binary_vs_bare_metal
        "https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  "
    RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 10.0.130.

But only find pytorch with cuda10.0 in official website

  • How can I get pytorch with cuda10.1?
1 Like

You can compile it from source.

If you are using CUDA10.1 locally, you could try to remove the additional minor version check in this line of code. It’s usually not recommended, but you can give it a shot.

If you encounter any issues, you would have to install the matching CUDA version locally (10.0 in your case).