From 467c637366a5216d057c6064b8268bd09f4f02c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pulido?= Date: Thu, 14 Oct 2021 14:26:23 -0400 Subject: [PATCH] Running examples with GPU using docker container. (#874) * Doc. Running examples with GPU using docker container. Co-authored-by: Mike Henry <11765982+mikemhenry@users.noreply.github.com> * wording fix --- docker/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docker/README.md b/docker/README.md index 8312a7266..57dc1dd27 100644 --- a/docker/README.md +++ b/docker/README.md @@ -39,3 +39,23 @@ All differences are within tolerance. ``` Note: `perses` currently works best on a single GPU. See the documentation [here](https://docs.docker.com/config/containers/resource_constraints/#access-an-nvidia-gpu) for how to specify a single GPU on a multi-GPU system. + +## Running perses examples from the container in GPUs using CUDA + +If you plan to use our docker container and CUDA/GPUs, quick instructions to get the examples running are as follows. + +We have our examples with minimalistic setups to satisfy our current continuous integration (CI) workflow. To get more "realistic" simulations we recommend making the following modifications. + +1) Clone the repository (say it lives in `$HOME/repos/perses`) with `git clone https://github.com/choderalab/perses.git` + +2) Modify the `run_neq_distrib_flattened.py` inside each of the examples (e.g. `examples/kinase-neq-switching/run_neq_distrib_flattened.py`) you want to run: +- Change the platform name to 'CUDA '(it is CPU by default to satisfy our continuous integration). Should be in line 21 in the script. +- (recommended) You might want to change the nsteps_eq and nsteps_neq (number of steps for equilibrium and nonequilibrium, respectively) to a larger value. Something around 250000 steps (1ns in time) for each should be okay. These should be lines 17 and 18 in the scripts. +- (recommended) Please change the save frequency or else you would be storing A LOT! The actual value depends on what you actually want to see, but please do change it if you increase the number of steps as in the previous item. + +3) Run our latest docker container and execute an example. + For example for the kinase-neq-switching example, you would do something like: +```bash +docker run -it --rm --gpus device=0 --mount type=bind,source=$HOME/.OpenEye/,target=/openeye/,readonly --mount type=bind,source=$HOME/repos/perses/examples/,target=/mnt/ -w /mnt/kinase-neq-switching choderalab/perses:0.9.2 python run_neq_distrib_flattened.py + ``` +Of importance there are the paths to the OpenEye license file (in this example is `$HOME/.OpenEye/`), path to the examples directory in perses (`$HOME/repos/perses/examples/`) and the actual example subdirectory example you want to run (`/mnt/kinase-neq-switching`)