Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed (Openfold, CUDA issues) #228

Open
Moricant opened this issue May 24, 2024 · 8 comments
Open

Installation failed (Openfold, CUDA issues) #228

Moricant opened this issue May 24, 2024 · 8 comments

Comments

@Moricant
Copy link

I've been trying to get this installed but it consistently fails at installing Openfold. Following the readme (I had to manually install the packages listed in environment.yml) it all works OK until I try to install Openfold. This appears to be the key error:

`  nvcc fatal   : Unsupported gpu architecture 'compute_89'`

I then tried the instructions from #180 and ended up with Openfold installation failing again, with this error:

        File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/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
      PyTorch (11.7). Please make sure to use the same CUDA versions.

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for openfold
  Running setup.py clean for openfold
Failed to build openfold
ERROR: Could not build wheels for openfold, which is required to install pyproject.toml-based projects

Full outputs follow.

@Moricant
Copy link
Author

Full error output from first attempt:

Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
Looking in links: https://pytorch-geometric.com/whl/torch-1.13.1+cu117.html
Collecting git+https://github.com/aqlaboratory/openfold.git@4b41059694619831a7db195b7e0988fc4ff3a307
Cloning https://github.com/aqlaboratory/openfold.git (to revision 4b41059694619831a7db195b7e0988fc4ff3a307) to /tmp/pip-req-build-f4m3pp8g
Running command git clone --filter=blob:none --quiet https://github.com/aqlaboratory/openfold.git /tmp/pip-req-build-f4m3pp8g
Running command git rev-parse -q --verify 'sha^4b41059694619831a7db195b7e0988fc4ff3a307'
Running command git fetch -q https://github.com/aqlaboratory/openfold.git 4b41059694619831a7db195b7e0988fc4ff3a307
Running command git checkout -q 4b41059694619831a7db195b7e0988fc4ff3a307
Resolved https://github.com/aqlaboratory/openfold.git to commit 4b41059694619831a7db195b7e0988fc4ff3a307
Preparing metadata (setup.py) ... done
Building wheels for collected packages: openfold
Building wheel for openfold (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [212 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/openfold
copying openfold/config.py -> build/lib.linux-x86_64-cpython-39/openfold
copying openfold/init.py -> build/lib.linux-x86_64-cpython-39/openfold
creating build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/outer_product_mean.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/dropout.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/triangular_attention.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/torchscript.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/primitives.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/model.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/evoformer.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/triangular_multiplicative_update.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/structure_module.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/msa.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/template.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/pair_transition.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/heads.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/init.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/embedders.py -> build/lib.linux-x86_64-cpython-39/openfold/model
creating build/lib.linux-x86_64-cpython-39/openfold/resources
copying openfold/resources/init.py -> build/lib.linux-x86_64-cpython-39/openfold/resources
creating build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/parsers.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/errors.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_transforms.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/input_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/mmcif_parsing.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_modules.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/templates.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/feature_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/init.py -> build/lib.linux-x86_64-cpython-39/openfold/data
creating build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/tensor_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/logger.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/chunk_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/loss.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/argparse.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/exponential_moving_average.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/suppress_output.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/validation_metrics.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/callbacks.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/superimposition.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/trace_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/import_weights.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/feats.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/seed.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/checkpointing.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/rigid_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/init.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/lr_schedulers.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
creating build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/protein.py -> build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/residue_constants.py -> build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/init.py -> build/lib.linux-x86_64-cpython-39/openfold/np
creating build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/hhsearch.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/utils.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/kalign.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/hhblits.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/jackhmmer.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/init.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
creating build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
copying openfold/utils/kernel/attention_core.py -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
copying openfold/utils/kernel/init.py -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
creating build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/amber_minimize.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/utils.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/cleanup.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/relax.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/init.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
running egg_info
creating openfold.egg-info
writing openfold.egg-info/PKG-INFO
writing dependency_links to openfold.egg-info/dependency_links.txt
writing top-level names to openfold.egg-info/top_level.txt
writing manifest file 'openfold.egg-info/SOURCES.txt'
reading manifest file 'openfold.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'openfold.egg-info/SOURCES.txt'
/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/command/build_py.py:207: _Warning: Package 'openfold.utils.kernel.csrc' is absent from the packages configuration.
!!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'openfold.utils.kernel.csrc' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'openfold.utils.kernel.csrc' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'openfold.utils.kernel.csrc' to be distributed and are
          already explicitly excluding 'openfold.utils.kernel.csrc' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  creating build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/compat.h -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda.cpp -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/compat.h -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda.cpp -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  running build_ext
  building 'attn_core_inplace_cuda' extension
  creating /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39
  creating /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold
  creating /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils
  creating /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel
  creating /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  Emitting ninja build file /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/build.ninja...
  Compiling objects...
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  [1/2] /home/apps/anaconda3/envs/diffdock/bin/nvcc  -I/tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/ -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/TH -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/THC -I/home/apps/anaconda3/envs/diffdock/include -I/home/apps/anaconda3/envs/diffdock/include/python3.9 -c -c /tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -o /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc/softmax_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -std=c++14 -maxrregcount=50 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda -gencode arch=compute_89,code=sm_89 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=attn_core_inplace_cuda -D_GLIBCXX_USE_CXX11_ABI=0
  FAILED: /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc/softmax_cuda_kernel.o
  /home/apps/anaconda3/envs/diffdock/bin/nvcc  -I/tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/ -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/TH -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/THC -I/home/apps/anaconda3/envs/diffdock/include -I/home/apps/anaconda3/envs/diffdock/include/python3.9 -c -c /tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -o /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc/softmax_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 --use_fast_math -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -std=c++14 -maxrregcount=50 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda -gencode arch=compute_89,code=sm_89 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=attn_core_inplace_cuda -D_GLIBCXX_USE_CXX11_ABI=0
  nvcc fatal   : Unsupported gpu architecture 'compute_89'
  [2/2] c++ -MMD -MF /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc/softmax_cuda.o.d -pthread -B /home/apps/anaconda3/envs/diffdock/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/apps/anaconda3/envs/diffdock/include -fPIC -O2 -isystem /home/apps/anaconda3/envs/diffdock/include -fPIC -I/tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/ -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/TH -I/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/include/THC -I/home/apps/anaconda3/envs/diffdock/include -I/home/apps/anaconda3/envs/diffdock/include/python3.9 -c -c /tmp/pip-req-build-f4m3pp8g/openfold/utils/kernel/csrc/softmax_cuda.cpp -o /tmp/pip-req-build-f4m3pp8g/build/temp.linux-x86_64-cpython-39/openfold/utils/kernel/csrc/softmax_cuda.o -O3 -DVERSION_GE_1_1 -DVERSION_GE_1_3 -DVERSION_GE_1_5 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=attn_core_inplace_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1900, in _run_ninja_build
      subprocess.run(
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/subprocess.py", line 528, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-f4m3pp8g/setup.py", line 74, in <module>
      setup(
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/__init__.py", line 104, in setup
      return distutils.core.setup(**attrs)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 91, in run
      _build_ext.run(self)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
      self.build_extensions()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
      build_ext.build_extensions(self)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
      self._build_extensions_serial()
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
      self.build_extension(ext)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 252, in build_extension
      _build_ext.build_extension(self, ext)
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
      objects = self.compiler.compile(
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1573, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "/home/apps/anaconda3/envs/diffdock/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1916, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for openfold
Running setup.py clean for openfold
Failed to build openfold
ERROR: Could not build wheels for openfold, which is required to install pyproject.toml-based projects

@Moricant
Copy link
Author

Full output from second attempt:

Collecting openfold@ git+https://github.com/aqlaboratory/openfold.git@4b41059694619831a7db195b7e0988fc4ff3a307
Cloning https://github.com/aqlaboratory/openfold.git (to revision 4b41059694619831a7db195b7e0988fc4ff3a307) to /tmp/pip-install-jbp541x2/openfold_505a5225e2ba4112a59f2eb35c36361c
Running command git clone --filter=blob:none --quiet https://github.com/aqlaboratory/openfold.git /tmp/pip-install-jbp541x2/openfold_505a5225e2ba4112a59f2eb35c36361c
Running command git rev-parse -q --verify 'sha^4b41059694619831a7db195b7e0988fc4ff3a307'
Running command git fetch -q https://github.com/aqlaboratory/openfold.git 4b41059694619831a7db195b7e0988fc4ff3a307
Running command git checkout -q 4b41059694619831a7db195b7e0988fc4ff3a307
Resolved https://github.com/aqlaboratory/openfold.git to commit 4b41059694619831a7db195b7e0988fc4ff3a307
Preparing metadata (setup.py) ... done
Building wheels for collected packages: openfold
Building wheel for openfold (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [179 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/openfold
copying openfold/config.py -> build/lib.linux-x86_64-cpython-39/openfold
copying openfold/init.py -> build/lib.linux-x86_64-cpython-39/openfold
creating build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/outer_product_mean.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/dropout.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/triangular_attention.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/torchscript.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/primitives.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/model.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/evoformer.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/triangular_multiplicative_update.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/structure_module.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/msa.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/template.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/pair_transition.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/heads.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/init.py -> build/lib.linux-x86_64-cpython-39/openfold/model
copying openfold/model/embedders.py -> build/lib.linux-x86_64-cpython-39/openfold/model
creating build/lib.linux-x86_64-cpython-39/openfold/resources
copying openfold/resources/init.py -> build/lib.linux-x86_64-cpython-39/openfold/resources
creating build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/parsers.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/errors.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_transforms.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/input_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/mmcif_parsing.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_modules.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/templates.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/feature_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/data_pipeline.py -> build/lib.linux-x86_64-cpython-39/openfold/data
copying openfold/data/init.py -> build/lib.linux-x86_64-cpython-39/openfold/data
creating build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/tensor_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/logger.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/chunk_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/loss.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/argparse.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/exponential_moving_average.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/suppress_output.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/validation_metrics.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/callbacks.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/superimposition.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/trace_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/import_weights.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/feats.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/seed.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/checkpointing.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/rigid_utils.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/init.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
copying openfold/utils/lr_schedulers.py -> build/lib.linux-x86_64-cpython-39/openfold/utils
creating build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/protein.py -> build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/residue_constants.py -> build/lib.linux-x86_64-cpython-39/openfold/np
copying openfold/np/init.py -> build/lib.linux-x86_64-cpython-39/openfold/np
creating build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/hhsearch.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/utils.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/kalign.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/hhblits.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/jackhmmer.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
copying openfold/data/tools/init.py -> build/lib.linux-x86_64-cpython-39/openfold/data/tools
creating build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
copying openfold/utils/kernel/attention_core.py -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
copying openfold/utils/kernel/init.py -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel
creating build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/amber_minimize.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/utils.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/cleanup.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/relax.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
copying openfold/np/relax/init.py -> build/lib.linux-x86_64-cpython-39/openfold/np/relax
running egg_info
creating openfold.egg-info
writing openfold.egg-info/PKG-INFO
writing dependency_links to openfold.egg-info/dependency_links.txt
writing top-level names to openfold.egg-info/top_level.txt
writing manifest file 'openfold.egg-info/SOURCES.txt'
reading manifest file 'openfold.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'openfold.egg-info/SOURCES.txt'
/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/command/build_py.py:207: _Warning: Package 'openfold.utils.kernel.csrc' is absent from the packages configuration.
!!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'openfold.utils.kernel.csrc' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'openfold.utils.kernel.csrc' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'openfold.utils.kernel.csrc' to be distributed and are
          already explicitly excluding 'openfold.utils.kernel.csrc' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  creating build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/compat.h -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda.cpp -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/compat.h -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda.cpp -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  copying openfold/utils/kernel/csrc/softmax_cuda_kernel.cu -> build/lib.linux-x86_64-cpython-39/openfold/utils/kernel/csrc
  running build_ext
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-jbp541x2/openfold_505a5225e2ba4112a59f2eb35c36361c/setup.py", line 74, in <module>
      setup(
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/__init__.py", line 104, in setup
      return distutils.core.setup(**attrs)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 91, in run
      _build_ext.run(self)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
      self.build_extensions()
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 499, in build_extensions
      _check_cuda_version(compiler_name, compiler_version)
    File "/home/apps/anaconda3/envs/diffdock_test/lib/python3.9/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
  PyTorch (11.7). Please make sure to use the same CUDA versions.

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for openfold
Running setup.py clean for openfold
Failed to build openfold
ERROR: Could not build wheels for openfold, which is required to install pyproject.toml-based projects

@lzygitk7
Copy link

same here

...
...
...
RuntimeError:
  The detected CUDA version (12.4) mismatches the version that was used to compile
  PyTorch (11.7). Please make sure to use the same CUDA versions.

by running
pip install 'openfold @ git+https://github.com/aqlaboratory/openfold.git', while my cuda-runtime in related conda env is 11.7
Does anyone have any idea?

@sangeeta97
Copy link

First install these torch libraries
torch 1.13.0
torch-cluster 1.6.0+pt113cu117
torch_geometric 2.0.4
torch-scatter 2.0.9
torch-sparse 0.6.15+pt113cu117
torch-spline-conv 1.2.1+pt113cu117
torchmetrics 0.11.0

then run pip install openfold @ git+https://github.com/aqlaboratory/openfold.git@103d0370ad9ce07579c20fa9c889a632f9b16618

This worked for me.

@Zinc-X
Copy link

Zinc-X commented Sep 20, 2024

Using an early verison of openfold solved my same problem.
By pip install openfold@git+https://github.com/aqlaboratory/openfold.git@cf177c0c4a19bec0c380ff9758a18061c3248f85

@YangPH0624
Copy link

Using an early verison of openfold solved my same problem. By pip install openfold@git+https://github.com/aqlaboratory/openfold.git@cf177c0c4a19bec0c380ff9758a18061c3248f85

it works for me

@raga-rob
Copy link

raga-rob commented Oct 19, 2024

Using an early verison of openfold solved my same problem. By pip install openfold@git+https://github.com/aqlaboratory/openfold.git@cf177c0c4a19bec0c380ff9758a18061c3248f85

it works for me

How do you make it work after pip+git installation? I was able to successfully install it using:

pip install openfold@git+https://github.com/aqlaboratory/openfold.git@cf177c0c4a19bec0c380ff9758a18061c3248f85

After installation, I was able to identify a folder automatically installed in "python3.12/site-packages/openfold" with "data" "model" "np" "__ pychache__" "utils" folders in it together with a "config.py" and "__ init__.py" files, but apparently there are no other "run scripts" in the folder and from here on I can't find a way to use openfold.

How would you proceed after successful pip install using this early version?

Thanks for your help

@vaclavhanzl
Copy link

Current pl_upgrades branch of OpenFold with my PR496 fix works for me (installing just OpenFold, not DiffDock, but it may help in general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants