From ca001c61e0ff1fe3c500f00ed288e049dc96529b Mon Sep 17 00:00:00 2001 From: blegouix Date: Sun, 1 Mar 2026 11:45:25 +0100 Subject: [PATCH 1/6] wip --- AGENTS.md | 5 +++-- docker/{similie => similie_env}/Dockerfile | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename docker/{similie => similie_env}/Dockerfile (100%) diff --git a/AGENTS.md b/AGENTS.md index 0c9eca0..3548420 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,9 +9,10 @@ SPDX-License-Identifier: MIT - Clone with `git clone --recurse-submodules git@github.com:blegouix/similie.git` or any similar commande which suits the network configuration. Be sure to pull the submodules recursively. # Build environment -- **Requirement:** Build and use the `docker/similie/Dockerfile` image before compiling or running tests. Do not build on the host directly. If `docker` is not installed, install it first (refer to the online documentation). +- **Requirement:** Always build and run in the `docker/similie_env/Dockerfile` image that you call "similie_env:latest". You'll need to make a copy of similie inside the container before compiling it. - Configure `CMake` for CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. - Compile as usual once configured (`make -jN_PROC` from `build`). ## Run tests -- From `build`, run `ctest` +- Always run tests inside the `docker/similie/Dockerfile` image. +- From `build` in the container, run `ctest`. diff --git a/docker/similie/Dockerfile b/docker/similie_env/Dockerfile similarity index 100% rename from docker/similie/Dockerfile rename to docker/similie_env/Dockerfile From a53025c55f009a36d1045653bf23466a8f1e18c1 Mon Sep 17 00:00:00 2001 From: blegouix Date: Sun, 1 Mar 2026 12:06:25 +0100 Subject: [PATCH 2/6] wip --- AGENTS.md | 5 ++--- docker/similie_env/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3548420..9550cf4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,10 +9,9 @@ SPDX-License-Identifier: MIT - Clone with `git clone --recurse-submodules git@github.com:blegouix/similie.git` or any similar commande which suits the network configuration. Be sure to pull the submodules recursively. # Build environment -- **Requirement:** Always build and run in the `docker/similie_env/Dockerfile` image that you call "similie_env:latest". You'll need to make a copy of similie inside the container before compiling it. +- **Requirement:** Check if all the necessary dependencies listed in `docker/similie_env/Dockerfile` are available in the current environment (in particular `nvcc` and `openmpi`). If not, build and run in the `docker/similie_env/Dockerfile` image that you call "similie_env:latest". You'll need to mount the `similie/` folder before compiling it. - Configure `CMake` for CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. - Compile as usual once configured (`make -jN_PROC` from `build`). ## Run tests -- Always run tests inside the `docker/similie/Dockerfile` image. -- From `build` in the container, run `ctest`. +- From `build`, first recompile then run `ctest`. diff --git a/docker/similie_env/Dockerfile b/docker/similie_env/Dockerfile index 16e9cc5..41fcf0e 100644 --- a/docker/similie_env/Dockerfile +++ b/docker/similie_env/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE = nvidia/cuda:13.1.1-cudnn-devel-ubuntu24.04 +ARG BASE_IMAGE=nvidia/cuda:13.1.1-cudnn-devel-ubuntu24.04 FROM $BASE_IMAGE # SPDX-FileCopyrightText: 2026 Baptiste Legouix From 331b179642f771ec05648022f267cfca284ae440 Mon Sep 17 00:00:00 2001 From: blegouix Date: Sat, 28 Mar 2026 13:32:43 +0100 Subject: [PATCH 3/6] wip --- docker/similie_env/Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docker/similie_env/Dockerfile b/docker/similie_env/Dockerfile index 41fcf0e..d3bf694 100644 --- a/docker/similie_env/Dockerfile +++ b/docker/similie_env/Dockerfile @@ -52,8 +52,13 @@ RUN apt install -y libfftw3-dev # LAPACKE RUN apt install -y liblapacke-dev +# Thrust +RUN if [ "${BACKEND}" = "cuda" ]; then \ + apt install -y libthrust-dev; \ +fi + # Ginkgo -RUN git clone -b v1.8.0 --depth 1 https://github.com/ginkgo-project/ginkgo.git +RUN git clone -b v1.11.0 --depth 1 https://github.com/ginkgo-project/ginkgo.git RUN if [ "${BACKEND}" = "cpu" ]; then \ cmake -DCMAKE_BUILD_TYPE=Release \ -DGINKGO_BUILD_OMP=ON \ @@ -66,8 +71,8 @@ RUN if [ "${BACKEND}" = "cpu" ]; then \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_CUDA_HOST_COMPILER=g++ \ -DCMAKE_BUILD_TYPE=Release \ - -DGINKGO_CUDA_ARCHITECTURES=70 \ -DGINKGO_BUILD_CUDA=ON \ + -DGINKGO_CUDA_ARCHITECTURES=89 \ -DGINKGO_BUILD_TESTS=OFF \ -DGINKGO_BUILD_EXAMPLES=OFF \ -DGINKGO_BUILD_BENCHMARKS=OFF \ @@ -76,7 +81,7 @@ RUN if [ "${BACKEND}" = "cpu" ]; then \ echo "ERROR: BACKEND must be 'cpu' or 'cuda' (got: '${BACKEND}')" >&2; \ exit 1; \ fi -RUN cmake --build ginkgo/build -j 8 +RUN cmake --build ginkgo/build -j 4 RUN cmake --install ginkgo/build # PDI @@ -91,3 +96,6 @@ EOF RUN wget -O /usr/share/keyrings/pdidev-archive-automatic.gpg https://repo.pdi.dev/ubuntu/pdidev-archive-keyring.gpg RUN apt update RUN apt install -y libpdi-dev pdiplugin-all + +# Sympy +RUN apt install -y python3-sympy From 6a3daf8607f6c463bc9baf0de110d07ac6831284 Mon Sep 17 00:00:00 2001 From: blegouix Date: Sat, 28 Mar 2026 13:43:45 +0100 Subject: [PATCH 4/6] wip --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 9550cf4..3e3f75c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,7 @@ SPDX-License-Identifier: MIT # Build environment - **Requirement:** Check if all the necessary dependencies listed in `docker/similie_env/Dockerfile` are available in the current environment (in particular `nvcc` and `openmpi`). If not, build and run in the `docker/similie_env/Dockerfile` image that you call "similie_env:latest". You'll need to mount the `similie/` folder before compiling it. +- **CUDA in Docker:** When building or running the CUDA backend inside Docker, start the container with `--gpus all` so the NVIDIA driver and GPU devices are exposed in the container. - Configure `CMake` for CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. - Compile as usual once configured (`make -jN_PROC` from `build`). From d6e158dafaa643c57250d616eebae41c13556f3d Mon Sep 17 00:00:00 2001 From: blegouix Date: Sat, 28 Mar 2026 14:55:32 +0100 Subject: [PATCH 5/6] wip --- AGENTS.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3e3f75c..89c4172 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,14 +5,16 @@ SPDX-License-Identifier: MIT # AGENTS.md for SimiLie + + # Clone - Clone with `git clone --recurse-submodules git@github.com:blegouix/similie.git` or any similar commande which suits the network configuration. Be sure to pull the submodules recursively. # Build environment -- **Requirement:** Check if all the necessary dependencies listed in `docker/similie_env/Dockerfile` are available in the current environment (in particular `nvcc` and `openmpi`). If not, build and run in the `docker/similie_env/Dockerfile` image that you call "similie_env:latest". You'll need to mount the `similie/` folder before compiling it. +- **Requirement:** By default (no particular contradictory instructions), build and run in the `docker/similie_env/Dockerfile` image that you call `similie_env:latest`. You'll need to mount the `similie/` folder before compiling it. Compile directly in the host environment only if specifically asked for (if so, check if all the necessary dependencies listed in `docker/similie_env/Dockerfile` are available in the current environment, in particular `nvcc` and `openmpi`). - **CUDA in Docker:** When building or running the CUDA backend inside Docker, start the container with `--gpus all` so the NVIDIA driver and GPU devices are exposed in the container. -- Configure `CMake` for CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. -- Compile as usual once configured (`make -jN_PROC` from `build`). +- **Configure CMake:** For CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. +- **Compile:** As usual once configured (`make -jN_PROC` from the `build/` folder). Never exceed N_PROC=8. Be sure to compile in the `build/` for CUDA backend and `build_cpu/` for CPU backend. ## Run tests - From `build`, first recompile then run `ctest`. From 3d37fc59e3a0b29e6ae6f48594554107ea76238b Mon Sep 17 00:00:00 2001 From: blegouix Date: Sat, 28 Mar 2026 14:57:25 +0100 Subject: [PATCH 6/6] wip --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 89c4172..df4be1e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,7 +12,9 @@ SPDX-License-Identifier: MIT # Build environment - **Requirement:** By default (no particular contradictory instructions), build and run in the `docker/similie_env/Dockerfile` image that you call `similie_env:latest`. You'll need to mount the `similie/` folder before compiling it. Compile directly in the host environment only if specifically asked for (if so, check if all the necessary dependencies listed in `docker/similie_env/Dockerfile` are available in the current environment, in particular `nvcc` and `openmpi`). +- **Mount path in Docker:** If you reuse an existing `build/` or `build_cpu/` directory from the host, mount the repository in Docker at the same absolute path as on the host. Otherwise CMake may fail because the cached source/build paths no longer match. - **CUDA in Docker:** When building or running the CUDA backend inside Docker, start the container with `--gpus all` so the NVIDIA driver and GPU devices are exposed in the container. +- **Git safe.directory in Docker:** Some vendored submodules query Git metadata during CMake. If Docker reports "detected dubious ownership" on the mounted repository or its submodules, add temporary `git config --global --add safe.directory ` entries inside the container for the repository and the relevant submodules before building. - **Configure CMake:** For CPU with `cmake -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_OPENMP=ON -B build -S .` or for CUDA with `cmake -DCMAKE_CXX_COMPILER=$PWD/vendor/ddc/vendor/kokkos/bin/nvcc_wrapper -DCMAKE_BUILD_TYPE=Debug -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_=ON -B build -S .`. Of course replace `` with the arch namecode which suits the GPU. - **Compile:** As usual once configured (`make -jN_PROC` from the `build/` folder). Never exceed N_PROC=8. Be sure to compile in the `build/` for CUDA backend and `build_cpu/` for CPU backend.