CI: limit NVHPC build parallelism to avoid OOM kills

libeigen/eigen!2353

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-03-28 16:10:04 -07:00
parent f928a9f534
commit 49a137ca24
2 changed files with 10 additions and 1 deletions

View File

@@ -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 ##################################################################

View File

@@ -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}