From 9e1290a25c0215141a1e0bd8c3645a639d12c5e7 Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Thu, 18 Jan 2024 03:57:22 +0900 Subject: [PATCH] Add CI for Intel (fails because oneMKL missing) --- .github/workflows/cmake.yml | 45 +++++++++++++++++++++++++++ docker/intel/Dockerfile | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 docker/intel/Dockerfile diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4fc7f865..aa2cd9f7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -125,6 +125,51 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CMAKE_CXX_COMPILER}} \ -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_${{env.architecture}}=ON -DBUILD_TESTING=ON ${{matrix.backend.option}} + - name: Build + # Build your program with the given configuration + run: | + docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake --build build_${{matrix.backend.name}} --config ${{env.BUILD_TYPE}} -j 2 + + build_intel: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + env: + #backends: HIP HIP_HOST_DEVICE + architecture: INTEL_PVC + CMAKE_CXX_COMPILER: icpx + container: intel_env + + strategy: + matrix: + backend: [ {name: INTEL, option: ""}, {name: INTEL_HOST_DEVICE, option: "-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON"} ] + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.2.0 + with: { tool-cache: true, large-packages: false } + + - name: Checkout built branch + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Update submodules + run: git submodule update --remote --recursive + + - name: Build docker + run: docker build -t ${{ env.container }} docker/intel + + - name: Configure CMake for SYCL backend + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: | + docker run -v ${{github.workspace}}:/work ${{ env.container }} cmake -B build_${{matrix.backend.name}} \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CMAKE_CXX_COMPILER}} \ + -DCMAKE_CXX_STANDARD=17 -DKokkos_ENABLE_SYCL=ON -DKokkos_ARCH_${{env.architecture}}=ON -DBUILD_TESTING=ON ${{matrix.backend.option}} + - name: Build # Build your program with the given configuration run: | diff --git a/docker/intel/Dockerfile b/docker/intel/Dockerfile new file mode 100644 index 00000000..ff683aaa --- /dev/null +++ b/docker/intel/Dockerfile @@ -0,0 +1,62 @@ +ARG BASE=nvidia/cuda:11.7.1-devel-ubuntu22.04 +FROM $BASE + +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + +RUN apt-get update && apt-get install -y \ + bc \ + wget \ + ccache \ + ninja-build \ + python3 \ + git \ + libfftw3-dev \ + libomp-dev \ + && \ + apt-get clean && \ + git config --global --add safe.directory '*' && \ + rm -rf /var/lib/apt/lists/* + +RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ + KEYDUMP_FILE=keydump && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ + wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ + gpg --import ${KEYDUMP_FILE} && \ + gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ + rm ${KEYDUMP_FILE}* + +ARG CMAKE_VERSION=3.23.2 +ARG build_dir=/tmp/build + +ENV CMAKE_DIR=/opt/cmake +RUN CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-linux-x86_64.sh && \ + mkdir -p ${build_dir} && mkdir -p ${CMAKE_DIR} \ + cd ${build_dir} && \ + wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_SCRIPT} && \ + sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ + cd ${HOME} && rm -rf ${build_dir} +ENV PATH=${CMAKE_DIR}/bin:$PATH + +RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB && \ + apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB && \ + echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ + apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0" && \ + apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.0.0 && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN wget https://cloud.cees.ornl.gov/download/oneapi-for-nvidia-gpus-2023.0.0-linux.sh && \ + chmod +x oneapi-for-nvidia-gpus-2023.0.0-linux.sh && \ + ./oneapi-for-nvidia-gpus-2023.0.0-linux.sh -y && \ + rm oneapi-for-nvidia-gpus-2023.0.0-linux.sh + +RUN wget https://registrationcenter-download.intel.com/akdlm/irc_nas/19133/l_oneDPL_p_2022.0.0.25335.sh &&\ + chmod +x ./l_oneDPL_p_2022.0.0.25335.sh && \ + ./l_oneDPL_p_2022.0.0.25335.sh -a -s --eula accept && \ + rm l_oneDPL_p_2022.0.0.25335.sh + +WORKDIR /work +ENV FFTWDIR "/usr" +RUN . /opt/intel/oneapi/setvars.sh --include-intel-llvm +ENV PATH=${CMAKE_DIR}/bin:/opt/intel/oneapi/compiler/latest/linux/bin:$PATH +CMD ["bash"] \ No newline at end of file