google-deepmind / alphafold

Open source code for AlphaFold.
Apache License 2.0
12.27k stars 2.2k forks source link

no module named openmm #737

Open DrJesseHansen opened 1 year ago

DrJesseHansen commented 1 year ago

Hello,

We are running Alphafold 2.3.1 on a Linux HPC through SLURM submission. The databases were downloaded to our cluster for AF2 to run correctly. We were able to successfully run 2.2.4, but with 2.3.1 we are now receiving the error below.

We usually aim to submit to the GPU with the most memory, specs: Nvidia A40 (8 GPUs per node) with AMD EPYC 7452 32-core processor, 128 threads, 64 cores, 1024 RAM. However we have tried submitting to other GPUs and same issue.

I have tried adding loading different modules of openmm (e.g. openmm/7.5.1) with the job submission script but that does not change anything.

Any input would be appreciated! Thank you.

Job submission script:

#!/bin/bash

#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem=200GB

#SBATCH --time=48:00:00
#SBATCH --no-requeue

#SBATCH --partition=gpu
#SBATCH --gres=gpu:1

MY_PROTEIN_PATH=/(fullpath)/sequence.fasta

echo $HOSTNAME

module purge
module load alphafold/2.3.1

export OPENMM_CUDA_COMPILER=$(which nvcc)
export TF_FORCE_UNIFIED_MEMORY=1
export XLA_PYTHON_CLIENT_MEM_FRACTION="4.0"

python3 /mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/alphafold-2.3.1/run_alphafold.py \
    --model_preset=multimer \
    --fasta_paths=$MY_PROTEIN_PATH \
    --output_dir=$(dirname $MY_PROTEIN_PATH) \
    --data_dir=/nfs/scistore14/rcsb/alphafold.databases/ \
    --mgnify_database_path=/nfs/scistore14/rcsb/alphafold.databases/mgnify/mgy_clusters_2022_05.fa \
    --template_mmcif_dir=/nfs/scistore14/rcsb/alphafold.databases.v2/pdb_mmcif/mmcif_files/ \
    --max_template_date=2023-05-14 \
    --obsolete_pdbs_path=/nfs/scistore14/rcsb/alphafold.databases.v2/pdb_mmcif/obsolete.dat \
    --use_gpu_relax=true \
    --bfd_database_path=/nfs/scistore14/rcsb/alphafold.databases/bfd/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt \
        --uniref30_database_path=/nfs/scistore14/rcsb/alphafold.databases/uniref30/UniRef30_2021_03 \
    --uniref90_database_path=/nfs/scistore14/rcsb/alphafold.databases/uniref90/uniref90.fasta \
    --pdb_seqres_database_path=/nfs/scistore14/rcsb/alphafold.databases/pdb_seqres/pdb_seqres.txt \
    --uniprot_database_path=/nfs/scistore14/rcsb/alphafold.databases/uniprot/uniprot.fasta

SLURM job output:

Usage:
    python
/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/alphafold-2.3.1/run_alphafold.py
--help
    python
/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/alphafold-2.3.1/run_alphafold.py
--data_dir=/nfs/scistore14/rcsb/alphafold.databases/ ...    

Traceback (most recent call last):
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/alphafold-2.3.1/run_alphafold.py", line 39, in <module>
    from alphafold.relax import relax
  File "/nfs/scistore07/clustersw/debian/bullseye/cuda11.2/alphafold/2.3.1/alphafold-2.3.1/alphafold/relax/relax.py", line 18, in <module>
    from alphafold.relax import amber_minimize
  File "/nfs/scistore07/clustersw/debian/bullseye/cuda11.2/alphafold/2.3.1/alphafold-2.3.1/alphafold/relax/amber_minimize.py", line 25, in <module>
    from alphafold.relax import cleanup
  File "/nfs/scistore07/clustersw/debian/bullseye/cuda11.2/alphafold/2.3.1/alphafold-2.3.1/alphafold/relax/cleanup.py", line 22, in <module>
    import pdbfixer
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/lib/python3.9/site-packages/pdbfixer-1.8.1-py3.9.egg/pdbfixer/__init__.py", line 2, in <module>
    from .pdbfixer import PDBFixer
  File "/mnt/nfs/clustersw/Debian/bullseye/cuda/11.2/alphafold/2.3.1/lib/python3.9/site-packages/pdbfixer-1.8.1-py3.9.egg/pdbfixer/pdbfixer.py", line 35, in <module>
    import openmm as mm
ModuleNotFoundError: No module named 'openmm'
smturzo commented 1 year ago

Wondering if you have already tried creating conda/virtual environment or pip in installing openmm? something like this: conda install -c conda-forge openmm

For pip installation it is something like this pip install openmm

Link to installation for openmm below: conda - https://anaconda.org/conda-forge/openmm pip - https://pypi.org/project/openmm/

ichxw commented 8 months ago

Have you solved this issue?

Got the same issue here with openmm 7.5.1. After upgrading to openmm 8, it will throw out another error: ModuleNotFoundError: No module named 'simtk.openmm.app.internal.