diff --git a/ci/Dockerfile-cuda12.0 b/ci/Dockerfile-cuda12.0 new file mode 100644 index 0000000..03b4dbb --- /dev/null +++ b/ci/Dockerfile-cuda12.0 @@ -0,0 +1,8 @@ +FROM nvidia/cuda:12.0.0-devel-ubuntu22.04 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python3 \ + python3-pip \ + python3-venv \ + cmake && \ + rm -rf /var/lib/apt/lists/* diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 39c1307..3f9b01a 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent none options { - disableConcurrentBuilds() + disableConcurrentBuilds(abortPrevious: true) buildDiscarder(logRotator(numToKeepStr: '8', daysToKeepStr: '20')) timeout(time: 1, unit: 'HOURS') } @@ -9,14 +9,13 @@ pipeline { stage('CUDA Tests') { agent { dockerfile { - filename 'ci/docker/Dockerfile-cuda11.8' + filename 'ci/Dockerfile-cuda12.0' args '--gpus 2' label 'docker && v100' } } environment { HOME = "$WORKSPACE" - PYBIN = "/opt/python/cp39-cp39/bin" LIBRARY_PATH = "$WORKSPACE/finufft/build" LD_LIBRARY_PATH = "$WORKSPACE/finufft/build" } @@ -36,22 +35,23 @@ pipeline { echo $HOME ls ''' - sh '''#!/bin/bash -ex + sh label: "build CUFINUFFT", script: '''#!/bin/bash -ex cd finufft # v100 cuda arch cuda_arch="70" - - cmake -B build . -DFINUFFT_USE_CUDA=ON \ - -DFINUFFT_USE_CPU=OFF \ - -DFINUFFT_BUILD_TESTS=OFF \ - -DCMAKE_CUDA_ARCHITECTURES="$cuda_arch" \ - -DBUILD_TESTING=ON + mkdir build cd build - make -j4 + cmake .. -DFINUFFT_USE_CUDA=ON \ + -DFINUFFT_USE_CPU=OFF \ + -DFINUFFT_BUILD_TESTS=OFF \ + -DCMAKE_CUDA_ARCHITECTURES="$cuda_arch" \ + -DBUILD_TESTING=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo + cmake --build . -j 4 ''' - sh '${PYBIN}/python3 -m venv $HOME' - sh '''#!/bin/bash -ex + sh 'python3 -m venv $HOME' + sh label: "set up virtual environment", script: '''#!/bin/bash -ex source $HOME/bin/activate python3 -m pip install --upgrade pip # we could also move pytorch install inside docker @@ -59,8 +59,10 @@ pipeline { python3 -m pip install finufft/python/cufinufft python3 -m pip install -e .[dev] # can make [dev,cuda] once cufinufft released? - - python3 -m pytest -k "cuda" tests/ --cov -v --error-for-skips --durations=20 + ''' + sh label: "run tests", script: '''#!/bin/bash -ex + source $HOME/bin/activate + python3 -m pytest -k "cuda" tests/ --cov -v --error-for-skips ''' } } diff --git a/ci/docker/Dockerfile-cuda11.8 b/ci/docker/Dockerfile-cuda11.8 deleted file mode 100644 index 4e61fb4..0000000 --- a/ci/docker/Dockerfile-cuda11.8 +++ /dev/null @@ -1,57 +0,0 @@ -# Based on https://github.com/flatironinstitute/finufft/blob/master/tools/cufinufft/docker/cuda11.2/Dockerfile-x86_64 - -FROM quay.io/pypa/manylinux2014_x86_64 -LABEL maintainer "Brian Ward" - -ENV CUDA_MAJOR 11 -ENV CUDA_MINOR 8 -ENV CUDA_DASH_VERSION ${CUDA_MAJOR}-${CUDA_MINOR} -ENV CUDA_DOT_VERSION ${CUDA_MAJOR}.${CUDA_MINOR} - -# ---- The following block adds layers for CUDA --- # -# base -RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \ - curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \ - echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict - - -COPY ci/docker/cuda.repo /etc/yum.repos.d/cuda.repo - -# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a -RUN yum install -y \ - cuda-cudart-${CUDA_DASH_VERSION} \ - cuda-compat-${CUDA_DASH_VERSION} && \ - ln -s cuda-${CUDA_DOT_VERSION} /usr/local/cuda - -# nvidia-docker 1.0 -RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \ - echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf - -ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 - -# nvidia-container-runtime -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility -ENV NVIDIA_REQUIRE_CUDA "cuda>=${CUDA_DOT_VERSION} brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441" - -# runtime -RUN yum install -y \ - cuda-libraries-${CUDA_DASH_VERSION} \ - cuda-nvtx-${CUDA_DASH_VERSION} \ - cuda-cudart-devel-${CUDA_DASH_VERSION} \ - cuda-libraries-devel-${CUDA_DASH_VERSION} \ - cuda-nvprof-${CUDA_DASH_VERSION} \ - cuda-nvcc-${CUDA_DASH_VERSION} - -ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs - -# /CUDA # - -# CUDA 11 doesn't work on gcc/g++ newer than v9 -RUN yum install -y \ - devtoolset-9-gcc \ - devtoolset-9-gcc-c++ \ - cmake && \ - rm -rf /var/cache/yum/* - -ENV PATH /opt/rh/devtoolset-9/root/usr/bin:${PATH} diff --git a/ci/docker/cuda.repo b/ci/docker/cuda.repo deleted file mode 100644 index ba2cba6..0000000 --- a/ci/docker/cuda.repo +++ /dev/null @@ -1,6 +0,0 @@ -[cuda] -name=cuda -baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64 -enabled=1 -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA