From d505286312e104ba7e034c0f287a3ed77f535e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 16:20:22 +0100 Subject: [PATCH 01/22] add CI --- .github/workflows/CI.yml | 138 ++++++++++++++++++++ devtools/conda-envs/build-macos-latest.yml | 15 +++ devtools/conda-envs/build-ubuntu-latest.yml | 23 ++++ devtools/scripts/install_cuda.sh | 44 +++++++ devtools/scripts/install_macos_sdk.sh | 31 +++++ 5 files changed, 251 insertions(+) create mode 100644 .github/workflows/CI.yml create mode 100644 devtools/conda-envs/build-macos-latest.yml create mode 100644 devtools/conda-envs/build-ubuntu-latest.yml create mode 100644 devtools/scripts/install_cuda.sh create mode 100644 devtools/scripts/install_macos_sdk.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..f8c0a0b --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,138 @@ +name: CI + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + schedule: + # Nightly tests run on master by default: + # Scheduled workflows run on the latest commit on the default or base branch. + # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) + - cron: "0 0 * * *" + + +jobs: + unix: + runs-on: ${{ matrix.os }} + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Linux CPU/CUDA Python 3.6 + python-version: "3.6" + os: ubuntu-latest + gcc-version: "9" + cuda-version: "10.0" + cdt-name: cos6 # cuda 11+ requires cos7 + CMAKE_FLAGS: | + -DPLUMED_BUILD_CUDA_LIB=ON \ + -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ + -DEXTRA_COMPILE_FLAGS="-L/usr/local/cuda/lib64/stubs -Wl,-rpath,/usr/local/cuda/lib64/stubs -Wl,-rpath-link,/usr/local/cuda/lib64/stubs" + + - name: MacOS Intel CPU/OpenCL Python 3.9 + python-version: "3.9" + os: macos-latest + cuda-version: "" + CMAKE_FLAGS: "" + + steps: + - uses: actions/checkout@v2 + + - name: "Patch conda env (if needed)" + if: startsWith(matrix.os, 'ubuntu') + run: | + sed -i -e "s/@CDT_NAME@/${{ matrix.cdt-name }}/g" \ + -e "s/@GCC_VERSION@/${{ matrix.gcc-version }}.*/g" \ + -e "s/@CUDATOOLKIT_VERSION@/${{ matrix.cuda-version }}.*/g" \ + devtools/conda-envs/build-${{ matrix.os }}.yml + + - uses: conda-incubator/setup-miniconda@v2 + name: "Prepare base dependencies" + with: + python-version: ${{ matrix.python-version }} + activate-environment: build + environment-file: devtools/conda-envs/build-${{ matrix.os }}.yml + auto-activate-base: false + channels: conda-forge + + - name: "Install CUDA on Ubuntu (if needed)" + if: matrix.cuda-version != '' + env: + CUDA_VERSION: ${{ matrix.cuda-version }} + run: source devtools/scripts/install_cuda.sh + + - name: "Set SDK on MacOS (if needed)" + if: startsWith(matrix.os, 'macos') + run: source devtools/scripts/install_macos_sdk.sh + + - name: "Conda info" + shell: bash -l {0} + run: | + conda info -a + conda list + + - name: Patch Plumed's Lepton location + shell: bash -l {0} + run: | + test -d ${CONDA_PREFIX}/include/plumed/lepton && mv ${CONDA_PREFIX}/include/plumed/lepton ${CONDA_PREFIX}/include/plumed/lepton.bak + + - name: "Configure build with CMake" + shell: bash -l {0} + run: | + mkdir build + cd build + + SHLIB_EXT=".so" + if [[ ${{ matrix.os }} == macos-* ]]; then + SHLIB_EXT=".dylib" + fi + + cmake .. ${CMAKE_ARGS} \ + -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DOPENMM_DIR=${CONDA_PREFIX} \ + -DPLUMED_INCLUDE_DIR=${CONDA_PREFIX}/include/plumed \ + -DPLUMED_LIBRARY_DIR=${CONDA_PREFIX}/lib \ + -DPLUMED_BUILD_OPENCL_LIB=ON \ + -DOPENCL_INCLUDE_DIR=${CONDA_PREFIX}/include \ + -DOPENCL_LIBRARY=${CONDA_PREFIX}/lib/libOpenCL${SHLIB_EXT} \ + ${{ matrix.CMAKE_FLAGS }} + + - name: "Build" + shell: bash -l {0} + run: | + cd build + make -j2 install + make -j2 PythonInstall + + - name: "Test" + shell: bash -l {0} + run: | + cd build + set +e + summary="" + exitcode=0 + for f in Test*; do + echo "::group::$f" + summary+="\n${f}: " + if [[ $f == *Cuda* || $f == *OpenCL* ]]; then + echo "Skipping $f..." + summary+="Skipped" + continue + fi + echo "Running $f..." + ./${f} + thisexitcode=$? + if [[ $thisexitcode == 0 ]]; then summary+="OK"; else summary+="FAILED"; fi + ((exitcode+=$thisexitcode)) + echo "::endgroup::" + done + echo "-------" + echo "Summary" + echo "-------" + echo -e "${summary}" + exit $exitcode diff --git a/devtools/conda-envs/build-macos-latest.yml b/devtools/conda-envs/build-macos-latest.yml new file mode 100644 index 0000000..00d0c8c --- /dev/null +++ b/devtools/conda-envs/build-macos-latest.yml @@ -0,0 +1,15 @@ +name: build +channels: +- conda-forge +dependencies: +# build +- cmake +- make +- compilers +# host +- python +- pip +- swig +- openmm +- plumed >=2.7 +- khronos-opencl-icd-loader diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml new file mode 100644 index 0000000..4c66e87 --- /dev/null +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -0,0 +1,23 @@ +name: build +channels: +- conda-forge +dependencies: +# build +- cmake +- make +- gcc_linux-64 @GCC_VERSION@ +- gxx_linux-64 @GCC_VERSION@ +- libx11-common-@CDT_NAME@-x86_64 +- libx11-@CDT_NAME@-x86_64 +- mesa-dri-drivers-@CDT_NAME@-x86_64 +- mesa-dri1-drivers-@CDT_NAME@-x86_64 +- mesa-libgl-@CDT_NAME@-x86_64 +- mesa-libgl-devel-@CDT_NAME@-x86_64 +# host +- python +- pip +- swig +- openmm +- plumed >=2.7 +- ocl-icd +- cudatoolkit @CUDATOOLKIT_VERSION@ \ No newline at end of file diff --git a/devtools/scripts/install_cuda.sh b/devtools/scripts/install_cuda.sh new file mode 100644 index 0000000..48e741c --- /dev/null +++ b/devtools/scripts/install_cuda.sh @@ -0,0 +1,44 @@ +# This script install CUDA on Ubuntu-based systemws +# It uses the Nvidia repos for Ubuntu 18.04, which as of Dec 2020 +# includes packages for CUDA 10.0, 10.1, 10.2, 11.0, 11.1, 11.2 +# Future versions might require an updated repo (maybe Ubuntu 20) +# It expects a $CUDA_VERSION environment variable set to major.minor (e.g. 10.0) + +set -euxo pipefail + +# Enable retrying +echo 'APT::Acquire::Retries "5";' | sudo tee /etc/apt/apt.conf.d/80-retries + +sudo wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries 5 \ + -O /etc/apt/preferences.d/cuda-repository-pin-600 \ + https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin +sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" +sudo apt-get update -qq + +CUDA_APT=${CUDA_VERSION/./-} +## cufft changed package names in CUDA 11 +if [[ ${CUDA_VERSION} == 10.* ]]; then CUFFT="cuda-cufft"; else CUFFT="libcufft"; fi +sudo apt-get install -y \ + libgl1-mesa-dev cuda-compiler-${CUDA_APT} \ + cuda-drivers cuda-driver-dev-${CUDA_APT} \ + cuda-cudart-${CUDA_APT} cuda-cudart-dev-${CUDA_APT} \ + ${CUFFT}-${CUDA_APT} ${CUFFT}-dev-${CUDA_APT} \ + cuda-nvprof-${CUDA_APT} tree +sudo apt-get clean + +if [[ ! -d /usr/local/cuda ]]; then + sudo ln -s /usr/local/cuda-${CUDA_VERSION} /usr/local/cuda +fi + +if [[ -f /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so ]]; then + sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1 +fi + +export CUDA_HOME="/usr/local/cuda" +export CUDA_PATH="/usr/local/cuda" +export PATH="${CUDA_HOME}/bin:${PATH}" + +echo "CUDA_HOME=${CUDA_HOME}" >> ${GITHUB_ENV} +echo "CUDA_PATH=${CUDA_PATH}" >> ${GITHUB_ENV} +echo "PATH=${PATH}" >> ${GITHUB_ENV} diff --git a/devtools/scripts/install_macos_sdk.sh b/devtools/scripts/install_macos_sdk.sh new file mode 100644 index 0000000..85b1616 --- /dev/null +++ b/devtools/scripts/install_macos_sdk.sh @@ -0,0 +1,31 @@ +# Install an older MacOS SDK +# This should guarantee OpenMM builds with extended compatibility across MacOS versions +# Adapted from conda-forge-ci-setup scripts: +# * https://github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/dde296e/recipe/run_conda_forge_build_setup_osx +# * https://github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/dde296e/recipe/download_osx_sdk.sh +# +# Some possible updates might involve upgrading the download link to future MacOS releases (10.15 to something else), +# depending on the version provided by the CI + +OSX_SDK_DIR="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs" +export MACOSX_DEPLOYMENT_TARGET=10.9 +export MACOSX_SDK_VERSION=10.9 + +export CMAKE_OSX_SYSROOT="${OSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" + +if [[ ! -d ${CMAKE_OSX_SYSROOT}} ]]; then + echo "Downloading ${MACOSX_SDK_VERSION} sdk" + curl -L -O --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 40 --retry-connrefused --retry-all-errors \ + https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz + tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "$(dirname ${CMAKE_OSX_SYSROOT})" +fi + +if [[ "$MACOSX_DEPLOYMENT_TARGET" == 10.* ]]; then +# set minimum sdk version to our target +plutil -replace MinimumSDKVersion -string ${MACOSX_SDK_VERSION} $(xcode-select -p)/Platforms/MacOSX.platform/Info.plist +plutil -replace DTSDKName -string macosx${MACOSX_SDK_VERSION}internal $(xcode-select -p)/Platforms/MacOSX.platform/Info.plist +fi + +echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" >> ${GITHUB_ENV} +echo "CMAKE_OSX_SYSROOT=${MACOSX_DEPLOYMENT_TARGET}" >> ${GITHUB_ENV} +echo "CMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}" >> ${GITHUB_ENV} \ No newline at end of file From 8af524aff746b55449c8c94bde2d9720dad5c029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 16:30:34 +0100 Subject: [PATCH 02/22] find Tests? --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f8c0a0b..2271b54 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -113,6 +113,7 @@ jobs: shell: bash -l {0} run: | cd build + find . -name "Test*" set +e summary="" exitcode=0 From fbdbea568378c9dc7e7ac2871054fce718dab5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 17:37:35 +0100 Subject: [PATCH 03/22] find tests --- .github/workflows/CI.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2271b54..a051449 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -112,20 +112,25 @@ jobs: - name: "Test" shell: bash -l {0} run: | - cd build - find . -name "Test*" set +e + cd build + if [[ ${{ matrix.os }} == ubuntu-* ]]; then + test_files=$(find . -name "Test*" -executable -type f) + else + test_files=$(find . -name "Test*" -perm +0111 -type f) + fi summary="" exitcode=0 - for f in Test*; do - echo "::group::$f" - summary+="\n${f}: " - if [[ $f == *Cuda* || $f == *OpenCL* ]]; then - echo "Skipping $f..." + for f in $test_files; do + fn=$(basename $f) + echo "::group::$fn" + summary+="\n${fn}: " + if [[ $fn == *Cuda* || $f == *OpenCL* ]]; then + echo "Skipping $fn..." summary+="Skipped" continue fi - echo "Running $f..." + echo "Running $fn..." ./${f} thisexitcode=$? if [[ $thisexitcode == 0 ]]; then summary+="OK"; else summary+="FAILED"; fi From bf28093515efdbb0f5826b2f702d18048fe516f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 17:45:42 +0100 Subject: [PATCH 04/22] close skipped groups too --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a051449..1f23cf8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -128,6 +128,7 @@ jobs: if [[ $fn == *Cuda* || $f == *OpenCL* ]]; then echo "Skipping $fn..." summary+="Skipped" + echo "::endgroup::" continue fi echo "Running $fn..." From 552c084d6a80f813e74c02cf2266fef6c8d5d7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 17:51:25 +0100 Subject: [PATCH 05/22] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ddcecc2..95156ab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![GH Actions Status](https://github.com/openmm/openmm-plumed/workflows/CI/badge.svg)](https://github.com/openmm/openmm-plumed/actions?query=branch%3Amaster+workflow%3ACI) +[![Conda](https://img.shields.io/conda/v/conda-forge/openmm-plumed.svg)](https://anaconda.org/conda-forge/openmm-plumed) +[![Anaconda Cloud Badge](https://anaconda.org/conda-forge/openmm-plumed/badges/downloads.svg)](https://anaconda.org/conda-forge/openmm-plumed) + OpenMM PLUMED Plugin ===================== From d79a3b85be833e34a82ba077ed5d11e131cb7d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 19:39:19 +0100 Subject: [PATCH 06/22] try pocl for opencl tests --- .github/workflows/CI.yml | 2 +- devtools/conda-envs/build-macos-latest.yml | 1 + devtools/conda-envs/build-ubuntu-latest.yml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1f23cf8..0dfaaf8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: fn=$(basename $f) echo "::group::$fn" summary+="\n${fn}: " - if [[ $fn == *Cuda* || $f == *OpenCL* ]]; then + if [[ $fn == *Cuda* ]]; then echo "Skipping $fn..." summary+="Skipped" echo "::endgroup::" diff --git a/devtools/conda-envs/build-macos-latest.yml b/devtools/conda-envs/build-macos-latest.yml index 00d0c8c..a443802 100644 --- a/devtools/conda-envs/build-macos-latest.yml +++ b/devtools/conda-envs/build-macos-latest.yml @@ -13,3 +13,4 @@ dependencies: - openmm - plumed >=2.7 - khronos-opencl-icd-loader +- pocl diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml index 4c66e87..cadc3c8 100644 --- a/devtools/conda-envs/build-ubuntu-latest.yml +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -20,4 +20,5 @@ dependencies: - openmm - plumed >=2.7 - ocl-icd -- cudatoolkit @CUDATOOLKIT_VERSION@ \ No newline at end of file +- cudatoolkit @CUDATOOLKIT_VERSION@ +- pocl \ No newline at end of file From 28c92548a29e0100f6832f1fbb82f099a3f736b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 19:48:52 +0100 Subject: [PATCH 07/22] try oclgrind --- devtools/conda-envs/build-ubuntu-latest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml index cadc3c8..cb5880e 100644 --- a/devtools/conda-envs/build-ubuntu-latest.yml +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -21,4 +21,4 @@ dependencies: - plumed >=2.7 - ocl-icd - cudatoolkit @CUDATOOLKIT_VERSION@ -- pocl \ No newline at end of file +- oclgrind From b2d87a00810123ca229e6d8e401fa9b387a8e746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 20:04:08 +0100 Subject: [PATCH 08/22] debug opencl platforms on Linux --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0dfaaf8..839589e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -109,6 +109,11 @@ jobs: make -j2 install make -j2 PythonInstall + - name: "Debug platforms" + shell: bash -l {0} + run: | + python -m simtk.testInstallation + - name: "Test" shell: bash -l {0} run: | From 23e3deb433c5645bae687d31c0dc02846511cb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 20:13:34 +0100 Subject: [PATCH 09/22] more debugging --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 839589e..d9d2a0e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -112,7 +112,9 @@ jobs: - name: "Debug platforms" shell: bash -l {0} run: | + set +e python -m simtk.testInstallation + python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" - name: "Test" shell: bash -l {0} From b229774df2eeb2f268a48bcaac4aeed835d94058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 20:23:26 +0100 Subject: [PATCH 10/22] pocl should work --- devtools/conda-envs/build-ubuntu-latest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml index cb5880e..4fb1a35 100644 --- a/devtools/conda-envs/build-ubuntu-latest.yml +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -21,4 +21,4 @@ dependencies: - plumed >=2.7 - ocl-icd - cudatoolkit @CUDATOOLKIT_VERSION@ -- oclgrind +- pocl From 138a672d1cbd760c373cf31457541d63615774ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 20:41:51 +0100 Subject: [PATCH 11/22] Rename jobs --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d9d2a0e..3e747a3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: include: - - name: Linux CPU/CUDA Python 3.6 + - name: Linux CPU CUDA 10.0 Python 3.6 python-version: "3.6" os: ubuntu-latest gcc-version: "9" @@ -33,7 +33,7 @@ jobs: -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ -DEXTRA_COMPILE_FLAGS="-L/usr/local/cuda/lib64/stubs -Wl,-rpath,/usr/local/cuda/lib64/stubs -Wl,-rpath-link,/usr/local/cuda/lib64/stubs" - - name: MacOS Intel CPU/OpenCL Python 3.9 + - name: MacOS Intel CPU OpenCL Python 3.9 python-version: "3.9" os: macos-latest cuda-version: "" From 264e9587335f7c44c9a5731ef35ec159b98ed8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 20:42:41 +0100 Subject: [PATCH 12/22] print ldd info --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3e747a3..a5bbf30 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -109,12 +109,14 @@ jobs: make -j2 install make -j2 PythonInstall - - name: "Debug platforms" + - name: "Debug OpenCL on Linux" shell: bash -l {0} + if: startsWith(matrix.os, 'ubuntu') run: | set +e python -m simtk.testInstallation python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" + find build -name TestOpenCLPlumedForce -type f -exec ldd {} \; - name: "Test" shell: bash -l {0} From e4ad862ae82195a14709fe92ccde72cc821b0d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 21:41:17 +0100 Subject: [PATCH 13/22] drop cmake_args --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a5bbf30..a12345b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -91,8 +91,9 @@ jobs: SHLIB_EXT=".dylib" fi - cmake .. ${CMAKE_ARGS} \ + cmake .. \ -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ + -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \ -DCMAKE_BUILD_TYPE=Release \ -DOPENMM_DIR=${CONDA_PREFIX} \ -DPLUMED_INCLUDE_DIR=${CONDA_PREFIX}/include/plumed \ From faad7db851506676c47b3d2fac3e6b065e5581e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 21:57:30 +0100 Subject: [PATCH 14/22] remove Nvidia's opencl --- devtools/scripts/install_cuda.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devtools/scripts/install_cuda.sh b/devtools/scripts/install_cuda.sh index 48e741c..bab49f5 100644 --- a/devtools/scripts/install_cuda.sh +++ b/devtools/scripts/install_cuda.sh @@ -35,6 +35,9 @@ if [[ -f /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so ]]; then sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1 fi +# Remove Nvidia's OpenCL +sudo rm -rf /usr/local/cuda-${CUDA_VERSION}/lib64/libOpenCL.* /usr/local/cuda-${CUDA_VERSION}/include/CL /etc/OpenCL/vendors/nvidia.icd + export CUDA_HOME="/usr/local/cuda" export CUDA_PATH="/usr/local/cuda" export PATH="${CUDA_HOME}/bin:${PATH}" From 0b2d1880551d6c190cc71e2faae9cd96c788301a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 22:15:09 +0100 Subject: [PATCH 15/22] remove debug steps --- .github/workflows/CI.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a12345b..b450d68 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -110,15 +110,6 @@ jobs: make -j2 install make -j2 PythonInstall - - name: "Debug OpenCL on Linux" - shell: bash -l {0} - if: startsWith(matrix.os, 'ubuntu') - run: | - set +e - python -m simtk.testInstallation - python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" - find build -name TestOpenCLPlumedForce -type f -exec ldd {} \; - - name: "Test" shell: bash -l {0} run: | From 44075d5d45a48c64a8166220ab74e4b8999bbe33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Mon, 1 Feb 2021 23:06:05 +0100 Subject: [PATCH 16/22] leave some useful debugging --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b450d68..c25f321 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -110,6 +110,11 @@ jobs: make -j2 install make -j2 PythonInstall + - name: "Plugin information" + shell: bash -l {0} + run: | + python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" + - name: "Test" shell: bash -l {0} run: | From d3b8a30f070836881836f7f12a09404f2cdf7109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 12:54:46 +0100 Subject: [PATCH 17/22] add python tests runner --- .github/workflows/CI.yml | 8 +++++++- devtools/conda-envs/build-macos-latest.yml | 2 ++ devtools/conda-envs/build-ubuntu-latest.yml | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c25f321..85b4e83 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -115,7 +115,7 @@ jobs: run: | python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')" - - name: "Test" + - name: "Test C++" shell: bash -l {0} run: | set +e @@ -149,3 +149,9 @@ jobs: echo "-------" echo -e "${summary}" exit $exitcode + + - name: "Test Python" + shell: bash -l {0} + run: | + cd python/tests + pytest -v Test* diff --git a/devtools/conda-envs/build-macos-latest.yml b/devtools/conda-envs/build-macos-latest.yml index a443802..4e9818e 100644 --- a/devtools/conda-envs/build-macos-latest.yml +++ b/devtools/conda-envs/build-macos-latest.yml @@ -14,3 +14,5 @@ dependencies: - plumed >=2.7 - khronos-opencl-icd-loader - pocl +# test +- pytest diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml index 4fb1a35..0095bc4 100644 --- a/devtools/conda-envs/build-ubuntu-latest.yml +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -22,3 +22,5 @@ dependencies: - ocl-icd - cudatoolkit @CUDATOOLKIT_VERSION@ - pocl +# test +- pytest From 3285d1d2114e2e409e5ecbbfefc1422993830db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 12:55:18 +0100 Subject: [PATCH 18/22] bump cuda to 11.2 --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 85b4e83..a7578e3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,8 +26,8 @@ jobs: python-version: "3.6" os: ubuntu-latest gcc-version: "9" - cuda-version: "10.0" - cdt-name: cos6 # cuda 11+ requires cos7 + cuda-version: "11.2" + cdt-name: cos7 # cuda 11+ requires cos7 CMAKE_FLAGS: | -DPLUMED_BUILD_CUDA_LIB=ON \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ From 24439467bf7fbb65ba0014f4994c7583d1b70c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 13:05:47 +0100 Subject: [PATCH 19/22] cos6? --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a7578e3..bee81f5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,7 +27,7 @@ jobs: os: ubuntu-latest gcc-version: "9" cuda-version: "11.2" - cdt-name: cos7 # cuda 11+ requires cos7 + cdt-name: cos6 CMAKE_FLAGS: | -DPLUMED_BUILD_CUDA_LIB=ON \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ From 46cc15b7e3d1a65e3a212eda4edcfc2e66e03a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 13:13:22 +0100 Subject: [PATCH 20/22] mesa-dri depends on mesa-dri1, no need to specify both --- .github/workflows/CI.yml | 2 +- devtools/conda-envs/build-ubuntu-latest.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bee81f5..5587094 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,7 +27,7 @@ jobs: os: ubuntu-latest gcc-version: "9" cuda-version: "11.2" - cdt-name: cos6 + cdt-name: cos7 # CentOS sysroot: cuda 10.x needs cos6, 11+ needs cos7 CMAKE_FLAGS: | -DPLUMED_BUILD_CUDA_LIB=ON \ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ diff --git a/devtools/conda-envs/build-ubuntu-latest.yml b/devtools/conda-envs/build-ubuntu-latest.yml index 0095bc4..d9431c9 100644 --- a/devtools/conda-envs/build-ubuntu-latest.yml +++ b/devtools/conda-envs/build-ubuntu-latest.yml @@ -10,7 +10,6 @@ dependencies: - libx11-common-@CDT_NAME@-x86_64 - libx11-@CDT_NAME@-x86_64 - mesa-dri-drivers-@CDT_NAME@-x86_64 -- mesa-dri1-drivers-@CDT_NAME@-x86_64 - mesa-libgl-@CDT_NAME@-x86_64 - mesa-libgl-devel-@CDT_NAME@-x86_64 # host From fd5e2a752e08bfb834c953b0c5a2f3669b8eda6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 13:31:33 +0100 Subject: [PATCH 21/22] 11.2 not yet deployed on CF --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5587094..9a52df9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,7 +26,7 @@ jobs: python-version: "3.6" os: ubuntu-latest gcc-version: "9" - cuda-version: "11.2" + cuda-version: "11.0" cdt-name: cos7 # CentOS sysroot: cuda 10.x needs cos6, 11+ needs cos7 CMAKE_FLAGS: | -DPLUMED_BUILD_CUDA_LIB=ON \ From beea1b645282172190026d26ef5d019c1ed25b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Wed, 3 Feb 2021 15:07:50 +0100 Subject: [PATCH 22/22] fix job name --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9a52df9..cc25c05 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: include: - - name: Linux CPU CUDA 10.0 Python 3.6 + - name: Linux CPU CUDA 11.0 Python 3.6 python-version: "3.6" os: ubuntu-latest gcc-version: "9"