From 49a137ca2468e4f30afe10c2ceb285ac1843cf9a Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Sat, 28 Mar 2026 16:10:04 -0700 Subject: [PATCH] CI: limit NVHPC build parallelism to avoid OOM kills libeigen/eigen!2353 Co-authored-by: Rasmus Munk Larsen --- ci/build.linux.gitlab-ci.yml | 3 +++ ci/scripts/build.linux.script.sh | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/build.linux.gitlab-ci.yml b/ci/build.linux.gitlab-ci.yml index e0075eaa8..63b905dc5 100644 --- a/ci/build.linux.gitlab-ci.yml +++ b/ci/build.linux.gitlab-ci.yml @@ -172,6 +172,9 @@ build:linux:x86-64:nvhpc-26.1:default: EIGEN_CI_CXX_COMPILER: nvc++ EIGEN_CI_INSTALL: "" EIGEN_CI_CROSS_INSTALL: "" + # NVHPC's compiler frontend is very memory-hungry with template-heavy code. + # Limit parallelism to avoid OOM kills from the kernel. + EIGEN_CI_BUILD_JOBS: "8" ######## CUDA ################################################################## diff --git a/ci/scripts/build.linux.script.sh b/ci/scripts/build.linux.script.sh index d00edbfda..38e43ab94 100755 --- a/ci/scripts/build.linux.script.sh +++ b/ci/scripts/build.linux.script.sh @@ -23,7 +23,13 @@ fi # out of resources. In that case, keep trying to build the remaining # targets (k0), then try to build again with a single thread (j1) to minimize # resource use. -cmake --build . ${target} -- -k0 || cmake --build . ${target} -- -k0 -j1 +# EIGEN_CI_BUILD_JOBS can be set to limit parallelism for memory-hungry +# compilers (e.g. NVHPC). +jobs="" +if [[ -n "${EIGEN_CI_BUILD_JOBS}" ]]; then + jobs="-j${EIGEN_CI_BUILD_JOBS}" +fi +cmake --build . ${target} -- -k0 ${jobs} || cmake --build . ${target} -- -k0 -j1 # Return to root directory. cd ${rootdir}