From 749158367ae00f981896a10dbad4992d318b3ff6 Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Fri, 16 Dec 2022 18:17:11 +0100 Subject: [PATCH] Update the CI versions (#75) * Clean up the CI version * Fix the CUDA versions * Update the CI versions * Fix PyTorch installation * Update the installation * Fix the installation * Clean up dependencies * Fix the CMake config dir of PyTorch * Update to CUDA 11.7 * Update cuda-toolkit action --- .github/workflows/ci.yml | 55 +++++++++++++++++++++++++++------------- README.md | 2 +- environment.yml | 4 +-- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb5ac5d..f2b1d52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,37 +15,53 @@ defaults: jobs: build: + name: ${{ matrix.name }} runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: include: + # Oldest supported versions - - enable_cuda: true + - name: Linux (CUDA 10.2, Python 3.7, PyTorch 1.11) + enable_cuda: true cuda: "10.2.89" - gcc: "8.5.0" + gcc: "8.5.*" nvcc: "10.2" - python: "3.7" - pytorch: "1.11.0" - # Latest supported versions - - enable_cuda: true + python: "3.7.*" + pytorch: "1.11.*" + + # Older supported versions + - name: Linux (CUDA 11.2, Python 3.9, PyTorch 1.11) + enable_cuda: true cuda: "11.2.2" - gcc: "10.3.0" + gcc: "10.3.*" nvcc: "11.2" - python: "3.10" - pytorch: "1.11.0" - # Without CUDA - - enable_cuda: false - gcc: "10.3.0" - python: "3.10" - pytorch: "1.11.0" + python: "3.9.*" + pytorch: "1.11.*" + + # Latest supported versions (with CUDA) + - name: Linux (CUDA 11.7, Python 3.10, PyTorch 1.12) + enable_cuda: true + cuda: "11.7.0" + gcc: "10.3.*" + nvcc: "11.7" + python: "3.10.*" + pytorch: "1.12.*" + + # Latest supported versions (without CUDA) + - name: Linux (no CUDA, Python 3.10, PyTorch 1.12) + enable_cuda: false + gcc: "10.3.*" + python: "3.10.*" + pytorch: "1.12.*" steps: - name: Check out uses: actions/checkout@v2 - name: Install CUDA Toolkit - uses: Jimver/cuda-toolkit@v0.2.4 + uses: Jimver/cuda-toolkit@v0.2.8 with: cuda: ${{ matrix.cuda }} if: ${{ matrix.enable_cuda }} @@ -63,7 +79,7 @@ jobs: sed -i -e "/cudatoolkit/c\ - cudatoolkit ${{ matrix.cuda }}" \ -e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \ -e "/nvcc_linux-64/c\ - nvcc_linux-64 ${{ matrix.nvcc }}" \ - -e "/python/c\ - python ${{ matrix.python }}.*" \ + -e "/python/c\ - python ${{ matrix.python }}" \ -e "/pytorch-gpu/c\ - pytorch-gpu ${{ matrix.pytorch }}" \ environment.yml @@ -73,7 +89,7 @@ jobs: sed -i -e "/cudatoolkit/c\ # - cudatoolkit" \ -e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \ -e "/nvcc_linux-64/c\ # - nvcc_linux-64" \ - -e "/python/c\ - python ${{ matrix.python }}.*" \ + -e "/python/c\ - python ${{ matrix.python }}" \ -e "/pytorch-gpu/c\ - pytorch-cpu ${{ matrix.pytorch }}" \ environment.yml @@ -82,6 +98,9 @@ jobs: - name: Install dependencies run: mamba env create -n nnpops -f environment.yml + env: + # Needed to install pytorch-gpu on a machine without a GPU + CONDA_OVERRIDE_CUDA: ${{ matrix.nvcc }} - name: List conda environment run: | @@ -94,7 +113,7 @@ jobs: mkdir build && cd build cmake .. \ -DENABLE_CUDA=${{ matrix.enable_cuda }} \ - -DTorch_DIR=$CONDA_PREFIX/lib/python${{ matrix.python }}/site-packages/torch/share/cmake/Torch \ + -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX make install diff --git a/README.md b/README.md index 23358c1..41029c3 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ $ conda activate nnpops ```bash $ mkdir build && cd build $ cmake .. \ - -DTorch_DIR=$CONDA_PREFIX/lib/python3.9/site-packages/torch/share/cmake/Torch \ + -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX $ make install ``` diff --git a/environment.yml b/environment.yml index 67dad34..e2caabf 100644 --- a/environment.yml +++ b/environment.yml @@ -3,12 +3,12 @@ channels: dependencies: - cmake >=3.20 - cudatoolkit 11.2.2 - - gxx_linux-64 10.3.0 + - gxx_linux-64 10.3.* - make - mdtraj - nvcc_linux-64 11.2 - torchani 2.2.2 - pytest - python 3.10.* - - pytorch-gpu 1.11.0 + - pytorch-gpu 1.12.* - sysroot_linux-64 2.17 \ No newline at end of file