facebookresearch / esm

Evolutionary Scale Modeling (esm): Pretrained language models for proteins
MIT License
3.26k stars 643 forks source link

Error installing OpenFold #573

Closed DaRinker closed 1 year ago

DaRinker commented 1 year ago

I'm following the installation instructions (installing all this in a custom conda environment on a shared computing resource) Everything has gone well up until the OpenFold installation step.

Bug description After I run the command: (esm_gpu)$ pip install 'openfold @ git+https://github.com/aqlaboratory/openfold.git@4b41059694619831a7db195b7e0988fc4ff3a307' I get the error:


Collecting openfold@ git+https://github.com/aqlaboratory/openfold.git@4b41059694619831a7db195b7e0988fc4ff3a307
  Cloning https://github.com/aqlaboratory/openfold.git (to revision 4b41059694619831a7db195b7e0988fc4ff3a307) to /tmp/pip-install-ijszxkv5/openfold_9c0f532345174527be994f0e05bd4f36
  Running command git clone --quiet https://github.com/aqlaboratory/openfold.git /tmp/pip-install-ijszxkv5/openfold_9c0f532345174527be994f0e05bd4f36
  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) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ijszxkv5/openfold_9c0f532345174527be994f0e05bd4f36/setup.py", line 56, in <module>
          _, bare_metal_major, _ = get_cuda_bare_metal_version(CUDA_HOME)
        File "/tmp/pip-install-ijszxkv5/openfold_9c0f532345174527be994f0e05bd4f36/setup.py", line 40, in get_cuda_bare_metal_version
          raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True)
      TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Not sure what to do here? Anybody have any suggestions of how to fix? Thank you

EDIT: Looks like it has to do with my CUDA installation (or lack of one!) Loading in CUDA fixed the error.

lm-jkominek commented 11 months ago

Since I also run into this exact issue myself today, I wanted to leave a solution for posterity. If you're using conda/mamba, then you need to install cudatoolkit-dev from the conda-forge channel, because the standard cudatoolkit (listed in the yml file in the repo) is runtime-only and doesn't come with nvcc which is needed here.

CoditoDTU commented 6 months ago

Hi @DaRinker I am currently trying to install OpenFold in my virtualVM and stumbled upon exactly the same error as you. I wanted to know what did you exactly mean by loading CUDA? I have already installed nvcc and the cudatoolkit-dev @lm-jkominek mentioned but it has not worked UnU].