1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GENESISが動作するdocker環境の構築

Posted at

はじめに

  • GENESISが動作するdocker環境があまりなかったので作ってみました

流れ

  1. cudaが動くubuntu20.04のイメージを使用
  2. minicondaをインストール
  3. pytorchをインストール (任意)
  4. openbabelやrdkitなど必要なものをインストール
  5. GCCなどのコンパイラのインストール
  6. VMDのインストール (workflowの自動化の時に便利だが任意)
  7. openMPIをソースからインストール (ソースからじゃないとダメ!)
  8. GENESISをインストール

コード

FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04

RUN apt-get update --fix-missing && \
    env DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --autoremove --purge --no-install-recommends -y \
    build-essential \
    bzip2 \
    ca-certificates \
    curl \
    git \
    libcanberra-gtk-module \
    libgtk2.0-0 \
    libx11-6 \
    sudo \
    graphviz \
    vim-nox

# Install miniconda
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN apt-get install -y wget bzip2 ca-certificates \
    libglib2.0-0 libxext6 libsm6 libxrender1 \
    git mercurial subversion
RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh && \
    ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
    echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
    echo "conda activate base" >> ~/.bashrc

#RUN pip install --upgrade pip

RUN mkdir /app
RUN mkdir /work
ADD . /app
WORKDIR /app

#RUN conda update -n base conda
#RUN conda update --all

# T-Zone
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y
RUN apt-get install -y tzdata
ENV TZ=Asia/Tokyo

# Torch / CUDA
RUN conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch 
RUN nvcc -V
RUN python3 -c "import torch; print(torch.cuda.is_available());"

# Chemistry
RUN conda install -c conda-forge openbabel -y
RUN pip install rdkit_pypi
RUN conda install -c conda-forge pdbfixer


# GCC GFORTRAN LAPACK BLAS
RUN apt-get install -y gcc gfortran
RUN apt-get install -y libgsl0-dev liblapack-dev libatlas-base-dev
RUN apt-get install -y libopenblas-base
RUN apt-get install -y libopenblas-dev



RUN apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get install -y sudo

# VMD
WORKDIR /app/src
RUN tar xvzf vmd-1.9.4a57.bin.LINUXAMD64-CUDA102-OptiX650-OSPRay185.opengl.tar.gz
WORKDIR /app/src/vmd-1.9.4a57
RUN ./configure
WORKDIR /app/src/vmd-1.9.4a57/src
RUN make install

# OpenMPI
WORKDIR /app/src
RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.bz2
RUN tar xvfj openmpi-4.1.4.tar.bz2
RUN mkdir /opt/openMPI
WORKDIR /app/src/openmpi-4.1.4
RUN ./configure --prefix=/opt/openMPI CC=gcc CXX=g++ F77=gfortran FC=gfortran
RUN make
RUN make install
ENV PATH=/opt/openMPI/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/openMPI/lib:$LD_LIBRARY_PATH
ENV MANPATH=/opt/openMPI/share/man:$MANPATH
RUN export PATH LD_LIBRARY_PATH MANPATH

# GENESIS
WORKDIR /app/src
RUN tar xvfj genesis-2.0.0.tar.bz2
WORKDIR /app/src/genesis-2.0.0
RUN ./configure -enable-single --enable-gpu
RUN make
RUN make install


1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?