diff --git a/.github/workflows/spack-test.yaml b/.github/workflows/spack-test.yaml index 742235cd..c631f910 100644 --- a/.github/workflows/spack-test.yaml +++ b/.github/workflows/spack-test.yaml @@ -16,8 +16,16 @@ jobs: backend: - name: nvcc image: gcc + compiler: nvcc_wrapper kokkos: +cuda +wrapper cuda_arch=90 kokkos_fft: device_backend=cufft + spack_path: "" + - name: rocm + image: rocm + compiler: hipcc + kokkos: +rocm amdgpu_target=gfx90a + kokkos_fft: device_backend=hipfft + spack_path: spack-configs/rocm steps: - name: Free Disk Space (Ubuntu) @@ -32,15 +40,17 @@ jobs: - name: Clone and install spack run: | docker run -v ${{ github.workspace }}:/work ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}:latest \ - bash -c "git clone --depth=2 --branch=v1.0.1 https://github.com/spack/spack.git" + bash -c "git clone --depth=2 --branch=v1.0.2 https://github.com/spack/spack.git" - name: Configure and build with CMake run: | docker run -v ${{ github.workspace }}:/work ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}:latest \ bash -c "source spack/share/spack/setup-env.sh && \ + export SPACK_USER_CONFIG_PATH=${{ matrix.backend.spack_path }} && \ + spack compiler find && \ spack spec kokkos-fft ${{ matrix.backend.kokkos_fft }} +tests ^kokkos ${{ matrix.backend.kokkos }} && \ spack install kokkos-fft ${{ matrix.backend.kokkos_fft }} +tests ^kokkos ${{ matrix.backend.kokkos }} && \ spack load kokkos kokkos-fft && \ cd install_test/as_library && \ - cmake -B build && \ + cmake -D CMAKE_CXX_COMPILER=${{ matrix.backend.compiler }} -B build && \ cmake --build build -j 4" diff --git a/docker/rocm/Dockerfile b/docker/rocm/Dockerfile index b87c2d94..05c51e39 100644 --- a/docker/rocm/Dockerfile +++ b/docker/rocm/Dockerfile @@ -16,23 +16,24 @@ RUN apt-get update && apt-get install -y \ hipfft \ rocfft \ libfftw3-dev \ + python3 \ + gfortran \ $ADDITIONAL_PACKAGES \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -ENV FFTWDIR "/usr" - -ENV PATH=/opt/rocm/bin:$PATH -ENV LD_LIBRARY_PATH /opt/rocm/hipfft/lib:$LD_LIBRARY_PATH -ENV CMAKE_PREFIX_PATH /opt/rocm/hip/:/opt/rocm/:$CMAKE_PREFIX_PATH +ENV FFTWDIR=/usr \ + CMAKE_DIR=/opt/cmake \ + PATH=/opt/rocm/bin:$PATH \ + LD_LIBRARY_PATH=/opt/rocm/hipfft/lib:$LD_LIBRARY_PATH \ + CMAKE_PREFIX_PATH=/opt/rocm/hip/:/opt/rocm/:$CMAKE_PREFIX_PATH RUN git config --global --add safe.directory "*" # Install newer CMake manually ARG CMAKE_VERSION=3.23.2 -ENV CMAKE_DIR=/opt/cmake RUN CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-linux-x86_64.sh && \ CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ diff --git a/spack-configs/rocm/packages.yaml b/spack-configs/rocm/packages.yaml new file mode 100644 index 00000000..77cc72fb --- /dev/null +++ b/spack-configs/rocm/packages.yaml @@ -0,0 +1,134 @@ +# SPDX-FileCopyrightText: (C) The kokkos-fft development team, see COPYRIGHT.md file +# +# SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception + +packages: + llvm-amdgpu: + buildable: false + externals: + - spec: llvm-amdgpu@6.2.0 + prefix: /opt/rocm + extra_attributes: + compilers: + c: /opt/rocm/bin/amdclang + cxx: /opt/rocm/bin/amdclang++ + hip: + buildable: false + externals: + - spec: hip@6.2.0 + prefix: /opt/rocm-6.2.0 + hipfft: + buildable: false + externals: + - spec: hipfft@6.2.0 + prefix: /opt/rocm-6.2.0 + hipblas: + buildable: false + externals: + - spec: hipblas@6.2.0 + prefix: /opt/rocm-6.2.0 + hipcub: + buildable: false + externals: + - spec: hipcub@6.2.0 + prefix: /opt/rocm-6.2.0 + hipfort: + buildable: false + externals: + - spec: hipfort@6.2.0 + prefix: /opt/rocm-6.2.0 + hipify-clang: + buildable: false + externals: + - spec: hipify-clang@6.2.0 + prefix: /opt/rocm-6.2.0 + hiprand: + buildable: false + externals: + - spec: hiprand@6.2.0 + prefix: /opt/rocm-6.2.0 + hipsolver: + buildable: false + externals: + - spec: hipsolver@6.2.0 + prefix: /opt/rocm-6.2.0 + hipsparse: + buildable: false + externals: + - spec: hipsparse@6.2.0 + prefix: /opt/rocm-6.2.0 + hsa-rocr-dev: + buildable: false + externals: + - spec: hsa-rocr-dev@6.2.0 + prefix: /opt/rocm-6.2.0 + hsakmt-roct: + buildable: false + externals: + - spec: hsakmt-roct@6.2.0 + prefix: /opt/rocm-6.2.0 + miopen-hip: + buildable: false + externals: + - spec: miopen-hip@6.2.0 + prefix: /opt/rocm-6.2.0 + rccl: + buildable: false + externals: + - spec: rccl@6.2.0 + prefix: /opt/rocm-6.2.0 + rocalution: + buildable: false + externals: + - spec: rocalution@6.2.0 + prefix: /opt/rocm-6.2.0 + rocfft: + buildable: false + externals: + - spec: rocfft@6.2.0 + prefix: /opt/rocm-6.2.0 + rocprim: + buildable: false + externals: + - spec: rocprim@6.2.0 + prefix: /opt/rocm-6.2.0 + rocblas: + buildable: false + externals: + - spec: rocblas@6.2.0 + prefix: /opt/rocm-6.2.0 + roctracer-dev: + buildable: false + externals: + - spec: roctracer-dev@6.2.0 + prefix: /opt/rocm-6.2.0 + rocsparse: + buildable: false + externals: + - spec: rocsparse@6.2.0 + prefix: /opt/rocm-6.2.0 + rocsolver: + buildable: false + externals: + - spec: rocsolver@6.2.0 + prefix: /opt/rocm-6.2.0 + rocrand: + buildable: false + externals: + - spec: rocrand@6.2.0 + prefix: /opt/rocm-6.2.0 + rocprofiler-dev: + buildable: false + externals: + - spec: rocprofiler-dev@6.2.0 + prefix: /opt/rocm-6.2.0 + python: + buildable: false + externals: + - spec: python@3.12.3+bz2+crypt+ctypes+dbm+lzma+pyexpat~pythoncmd+readline+sqlite3+ssl~tkinter+uuid+zlib + prefix: /usr + cmake: + buildable: false + externals: + - spec: cmake@3.23.2 + prefix: /opt/cmake