diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0b50a90bd87b710c116d9e8b1c62ca345072cf1..36578fae99a9faee0d3f279c029a4b33375b4923 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,13 +8,13 @@ stages: - test env:bionic: - image: keckj/hysop:ubuntu_bionic + image: keckj/hysop:ubuntu_bionic_cuda stage: env script: - "sh ci/scripts/version.sh" config:bionic: - image: keckj/hysop:ubuntu_bionic + image: keckj/hysop:ubuntu_bionic_cuda stage: configure script: - "sh ci/scripts/config.sh $CI_PROJECT_DIR/build/gcc-7 $CI_PROJECT_DIR/install/gcc-7 gcc-7 g++-7 gfortran-7" @@ -26,7 +26,7 @@ config:bionic: - $CI_PROJECT_DIR/build build:bionic: - image: keckj/hysop:ubuntu_bionic + image: keckj/hysop:ubuntu_bionic_cuda stage: build script: - "sh ci/scripts/build.sh $CI_PROJECT_DIR/build/gcc-7 gcc-7 g++-7 gfortran-7" @@ -38,7 +38,7 @@ build:bionic: - $CI_PROJECT_DIR/build install:bionic: - image: keckj/hysop:ubuntu_bionic + image: keckj/hysop:ubuntu_bionic_cuda stage: install script: - "sh ci/scripts/install.sh $CI_PROJECT_DIR/build/gcc-7 $CI_PROJECT_DIR/install/gcc-7" @@ -49,7 +49,7 @@ install:bionic: - $CI_PROJECT_DIR/install test:bionic: - image: keckj/hysop:ubuntu_bionic + image: keckj/hysop:ubuntu_bionic_cuda stage: test script: - "sh ci/scripts/test.sh $CI_PROJECT_DIR/install/gcc-7 $CI_PROJECT_DIR/hysop $CI_PROJECT_DIR/cache" diff --git a/ci/docker_images/ubuntu/bionic_cuda/Dockerfile b/ci/docker_images/ubuntu/bionic_cuda/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8395630a8df5b446c5f0ad65cb5f41a35dfbc40d --- /dev/null +++ b/ci/docker_images/ubuntu/bionic_cuda/Dockerfile @@ -0,0 +1,221 @@ +# Test docker for gitlab-ci +FROM nvidia/cuda:9.2-devel-ubuntu18.04 +MAINTAINER Jean-Baptiste.Keck@imag.fr + +# upgrade initial image +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update +RUN apt-get full-upgrade -y + +# get build tools and required libraries +RUN apt-get install -y expat +RUN apt-get install -y unzip +RUN apt-get install -y xz-utils +RUN apt-get install -y automake +RUN apt-get install -y libtool +RUN apt-get install -y pkg-config +RUN apt-get install -y cmake +RUN apt-get install -y git +RUN apt-get install -y vim +RUN apt-get install -y ssh +RUN apt-get install -y gcc +RUN apt-get install -y gfortran +RUN apt-get install -y cython +RUN apt-get install -y swig +RUN apt-get install -y lsb-core +RUN apt-get install -y cpio +RUN apt-get install -y libnuma1 +RUN apt-get install -y libpciaccess0 +RUN apt-get install -y libreadline-dev +RUN apt-get install -y libboost-all-dev +RUN apt-get install -y libblas-dev +RUN apt-get install -y liblapack-dev +RUN apt-get install -y libcgal-dev +RUN apt-get install -y libatlas-base-dev +RUN apt-get install -y libopenblas-dev +RUN apt-get install -y libgfortran3 +RUN apt-get install -y libgcc1 +RUN apt-get install -y libopenmpi-dev +RUN apt-get install -y libhdf5-openmpi-dev +RUN apt-get install -y libfftw3-dev +RUN apt-get install -y libfftw3-mpi-dev +RUN apt-get install -y libgmp-dev +RUN apt-get install -y libmpfr-dev +RUN apt-get install -y libmpc-dev +RUN apt-get install -y libsparsehash-dev +RUN apt-get install -y libcairo-dev +RUN apt-get install -y libcairomm-1.0-dev +RUN apt-get install -y python +RUN apt-get install -y python-dev +RUN apt-get install -y python-pip +RUN apt-get install -y python-tk +RUN apt-get install -y opencl-headers +RUN apt-get install -y ocl-icd-libopencl1 +RUN apt-get install -y clinfo + +# python packages +RUN pip install --upgrade pip +RUN pip install --upgrade setuptools +RUN pip install --upgrade backports.weakref +RUN pip install --upgrade cffi +RUN pip install --upgrade wheel +RUN pip install --upgrade pytest +RUN pip install --upgrade numpy +RUN pip install --upgrade scipy +RUN pip install --upgrade sympy +RUN pip install --upgrade matplotlib +RUN pip install --upgrade mpi4py +RUN pip install --upgrade sphinx +RUN pip install --upgrade h5py +RUN pip install --upgrade gmpy2 +RUN pip install --upgrade psutil +RUN pip install --upgrade py-cpuinfo +RUN pip install --upgrade Mako +RUN pip install --upgrade subprocess32 +RUN pip install --upgrade editdistance +RUN pip install --upgrade portalocker +RUN pip install --upgrade colors.py +RUN pip install --upgrade tee +RUN pip install --upgrade primefac +RUN pip install --upgrade pycairo +RUN pip install --upgrade weave +RUN pip install --upgrade argparse_color_formatter + +# scitools (python-scitools does not exist on ubuntu:bionic) +RUN cd /tmp \ + && git clone https://github.com/hplgit/scitools \ + && cd scitools \ + && pip install . \ + && cd - \ + && rm -Rf /tmp/scitools + +# patchelf +RUN cd /tmp \ + && git clone https://github.com/NixOS/patchelf \ + && cd patchelf \ + && ./bootstrap.sh \ + && ./configure \ + && make \ + && make install \ + && cd - \ + && rm -Rf /tmp/patchelf + +RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ + && echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main' >> /etc/apt/sources.list \ + && echo 'deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main' >> /etc/apt/sources.list \ + && apt-get update \ + && apt-get install --assume-yes llvm-3.9 clang-3.9 libllvm3.9 libclang-3.9-dev + +# Intel OpenCl +RUN cd /tmp \ +&& mkdir intel \ +&& cd intel \ +&& wget http://registrationcenter-download.intel.com/akdlm/irc_nas/12556/opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz \ +&& tar -xvzf opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz \ +&& cd opencl_runtime_16.1.2_x64_rh_6.4.0.37 \ +&& ls -la \ +&& sed -i "s/ACCEPT_EULA=decline/ACCEPT_EULA=accept/g" "silent.cfg" \ +&& ./install.sh --silent ./silent.cfg \ +&& cd /tmp \ +&& rm -Rf /tmp/intel + +# Fix OpenCl ICD +RUN ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so +RUN ldconfig + +# pyopencl +RUN cd /tmp \ +&& git clone https://github.com/inducer/pyopencl \ +&& cd pyopencl \ +&& git submodule update --init \ +&& ./configure.py \ +&& make \ +&& pip install --upgrade . \ +&& cd - \ +&& rm -Rf /tmp/pyopencl + +# oclgrind +RUN apt-get install --assume-yes --allow-unauthenticated llvm-6.0 clang-6.0 libllvm6.0 libclang-6.0-dev +RUN cd /tmp \ + && git clone https://github.com/jrprice/Oclgrind \ + && cd Oclgrind \ + && mkdir build \ + && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. \ + && make \ + && make install \ + && cd - \ + && rm -Rf /tmp/Oclgrind + +# clpeak +RUN cd /tmp \ + && git clone https://github.com/krrishnarraj/clpeak \ + && cd clpeak/ \ + && mkdir build \ + && cd build/ \ + && cmake .. \ + && make \ + && mv clpeak /usr/local/bin/ \ + && cd - \ + && rm -Rf /tmp/clpeak + +# clFFT +RUN cd /tmp \ + && ln -s /usr/local/lib /usr/local/lib64 \ + && git clone https://github.com/clMathLibraries/clFFT \ + && cd clFFT \ + && cd src \ + && mkdir build \ + && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. \ + && make \ + && make install \ + && cd - \ + && rm -Rf /tmp/clFFT + +# gpyFFT +RUN cd /tmp \ + && git clone https://github.com/geggo/gpyfft \ + && cd gpyfft \ + && pip install . \ + && cd - \ + && rm -Rf /tmp/gpyfft + +# python graphtools +RUN cd /tmp \ + && wget https://downloads.skewed.de/graph-tool/graph-tool-2.26.tar.bz2 \ + && tar -xvjf graph-tool-2.26.tar.bz2 \ + && cd graph-tool-2.26 \ + && ./autogen.sh \ + && mkdir pycairo   \ + && find /usr/ -name 'pycairo.h' -exec cp {} ./pycairo/pycairo.h \; \ + && CPPFLAGS=-I. ./configure \ + && CPPFLAGS=-I. make -j16 \ + && make install \ + && cd - \ + && rm -Rf /tmp/graph-tool-2.26 + +# clang 6 for hysop build test +RUN apt-get install -y clang + +# pyfftw (with R2R transforms - experimental branch) +RUN cd /tmp \ + && git clone https://github.com/drwells/pyFFTW \ + && cd pyFFTW \ + && git checkout r2r-try-two \ + && pip install . \ + && cd - \ + && rm -Rf /tmp/pyFFTW + +# Fix nvidia opencl icd +RUN echo "/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + +# ensure all libraries are known by the runtime linker +RUN ldconfig + +# clean cached packages +RUN rm -rf /var/lib/apt/lists/* +RUN rm -rf $HOME/.cache/pip/* +RUN rm -rf /tmp/* + +CMD ["/bin/bash"] diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh index 69241ef7077516d7fdcbe21eebad50097155313e..45ea7b30ffa1b61f144ac944f9c8968f199fb0f1 100755 --- a/ci/scripts/test.sh +++ b/ci/scripts/test.sh @@ -52,19 +52,19 @@ python -c 'import hysop; print hysop' #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_advection.py" #python "$HYSOP_DIR/backend/device/codegen/kernels/tests/test_directional_remesh.py" -#python "$HYSOP_DIR/core/arrays/tests/test_array.py" -#$HYSOP_DIR/fields/tests/test_cartesian.sh -#python "$HYSOP_DIR/operator/tests/test_analytic.py" -#python "$HYSOP_DIR/operator/tests/test_transpose.py" -#python "$HYSOP_DIR/operator/tests/test_derivative.py" -#python "$HYSOP_DIR/operator/tests/test_poisson.py" -#python "$HYSOP_DIR/operator/tests/test_poisson_rotational.py" -#python "$HYSOP_DIR/operator/tests/test_solenoidal_projection.py" -#python "$HYSOP_DIR/operator/tests/test_custom_symbolic.py" -#python "$HYSOP_DIR/operator/tests/test_directional_advection.py" -#python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py" -#python "$HYSOP_DIR/operator/tests/test_diffusion.py" -#python "$HYSOP_DIR/operator/tests/test_directional_stretching.py" +python "$HYSOP_DIR/core/arrays/tests/test_array.py" +$HYSOP_DIR/fields/tests/test_cartesian.sh +python "$HYSOP_DIR/operator/tests/test_analytic.py" +python "$HYSOP_DIR/operator/tests/test_transpose.py" +python "$HYSOP_DIR/operator/tests/test_derivative.py" +python "$HYSOP_DIR/operator/tests/test_poisson.py" +python "$HYSOP_DIR/operator/tests/test_poisson_rotational.py" +python "$HYSOP_DIR/operator/tests/test_solenoidal_projection.py" +python "$HYSOP_DIR/operator/tests/test_custom_symbolic.py" +python "$HYSOP_DIR/operator/tests/test_directional_advection.py" +python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py" +python "$HYSOP_DIR/operator/tests/test_diffusion.py" +python "$HYSOP_DIR/operator/tests/test_directional_stretching.py" EXAMPLE_DIR="$HYSOP_DIR/../examples" EXAMPLE_OPTIONS='-maxit 1'