-
Notifications
You must be signed in to change notification settings - Fork 26
PySAGES installation notes
Collections of recipes for installing PySAGES.
Requirements:
- A git installation
- A conda installation (consider using miniforge instead of miniconda)
- CUDA (optional) if you have a Nvidia GPU
Steps:
- Create new conda environment
conda create -n pysages
- Activate your conda environment
conda activate pysages
- Install hoomd
or if you have a GPU
conda install -c conda-forge hoomd
conda install -c conda-forge hoomd=*=*gpu*
- Get and build hoomd-dlext
git clone https://github.com/SSAGESLabs/hoomd-dlext cd hoomd-dlext ./build.sh
Load required modules:
module load python/anaconda-2021.05
module load gcc/10.2.0 cmake/3.15 cuda/11.2 eigen/3.3
Steps:
-
Create a conda environment
conda create -n pysages
source activate pysages
-
Install HOOMD required libraries
conda install -c conda-forge pybind11
conda install python=3.8 #[Downgrade for numba. If pybind11 installs python=3.10; numba installation may fail.]
-
Download HOOMD source
curl -O https://glotzerlab.engin.umich.edu/Downloads/hoomd/hoomd-v2.9.7.tar.gz tar -zxvf hoomd-v2.9.7.tar.gz cd hoomd-v2.9.7.tar.gz mkdir build cd build
-
Install HOOMD
PYTHON_EXECUTABLE=$(which python3) HOOMD_ROOT=$(${PYTHON_EXECUTABLE} -c 'import site; print(site.getsitepackages()[0])')` cmake ../ \ -DCMAKE_INSTALL_PREFIX=$HOOMD_ROOT \ -DCOPY_HEADERS=ON \ -DENABLE_CUDA=ON \ -DCMAKE_C_COMPILER=/software/gcc-10.2.0-el7-x86_64/bin/gcc\ -DCMAKE_CXX_COMPILER=/software/gcc-10.2.0-el7-x86_64/bin/g++ make -j 10 # On an interactive GPU node. make install
-
Install HOOMD-dlext [currently minimum version is 3.16 (can be installed using source code or conda environment easily); midway2 max version is 3.15]
git clone https://github.com/SSAGESLabs/hoomd-dlext source build.sh # Edit cuda path to cuda/11.2 on midway2
-
Install other required libraries and JAX
conda install numpy numba
conda install -c conda-forge cupy
conda install gsd matplotlib
pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
-
Install PySAGES
git clone pysages cd to pysages pip install .
Requirements:
- A git installation
- A conda installation
Steps:
- Create new conda environment
conda create -n pysages python=3
- Activate your conda environment
conda activate pysages
- Install OpenMM
conda install -c conda-forge openmm
- Install other required libraries and JAX
conda install -c conda-forge clang_osx-64 conda install -c conda-forge clangxx_osx-64 conda install -c conda-forge swig conda install -c conda-forge plum-dispatch conda install -c fastai fastcore conda install -c conda-forge numba pip install jax pip install jaxlib pip install --upgrade jaxlib
- Install openmm-dlext
git clone https://github.com/pabloferz/openmm-dlext cd openmm-dlext cmake -S . -B build cmake --build build --target install
- Install PySAGES
git clone https://github.com/SSAGESLabs/PySAGES.git cd PySAGES pip install .
Load required modules:
module load python/intel-2020.up1
module load gcc/10.2.0 cuda/11.2
Steps:
-
Create a conda environment
conda create -n pysages-openmm
source activate pysages-openmm
-
Install OpenMM using conda
conda install -c omnia openmm
-
Install jaxlib and jax cuda with pip
pip install jaxlib
pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
-
Download and install cmake/3.16 (may take few min)
wget https://cmake.org/files/v3.16/cmake-3.16.0.tar.gz tar -zxvf cmake-3.16.0.tar.gz mkdir installed-files cmakeLocation=$(pwd) ./configure --prefix=$cmakeLocation/installed-files make install
-
Install OpenMM-dlext [currently minimum version is 3.16]
git clone https://github.com/SSAGESLabs/openmm-dlext.git $cmakeLocation/installed-files/bin/cmake -S . -B build $cmakeLocation/installed-files/bin/cmake --build build --target install
-
Install PySAGES
git clone pysages cd to pysages pip install .
-
If it doesn't work, upgrade python (if prompted, upgrade openmm), then rerun jaxlib
conda install python=3.9.10
pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
-
Re-install openmm-dlext.
cd openmm-dlext rm -f -r build $cmakeLocation/installed-files/bin/cmake -S . -B build $cmakeLocation/installed-files/bin/cmake --build build --target install
-
Re-install PySAGES
cd pysages pip install .
-
install cupy
conda install cupy
This is a summary of this discussion and this discussion.
Steps:
-
Load the modules:
module load python/anaconda-2021.05 module load pysages
-
Then, if you want to use your own version of PySAGES, that environment can be cloned an modified with the following:
conda create --clone pysages-0.4.0 --name mypysages # clone the env conda activate mypysages cd PySAGES # move to your local version of github.com/SSAGESLabs/PySAGES pip install -e . # run inside pysages directory to get latest dev in editable mode pip install --upgrade jaxlib
-
Then you are ready to submit PySAGES jobs.
NOTE. In case you encounter aNo GPU/TPU found, falling back to CPU
error, upgrading bothjax
andjaxlib
by using the following command (see here for details) should solve that:pip install --upgrade pip ### OLDER (seems not to work anymore) ### # Installs the wheel compatible with Cuda 11.4+ and cudnn 8.2+ (deprecated). ### pip install "jax[cuda11_cudnn82]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html # CUDA 11 installation (this works as of 2023-08-01) # Note: wheels only available on linux. pip install --upgrade "jax[cuda11_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html