Limit build parallelism to reduce OOM situations
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -1,10 +1,20 @@
|
|||||||
# syntax=docker/dockerfile:1.6
|
# syntax=docker/dockerfile:1.6
|
||||||
|
|
||||||
|
# Limit build parallelism to reduce OOM situations
|
||||||
|
ARG BUILD_JOBS=16
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# STAGE 1: Base Image (Installs Dependencies)
|
# STAGE 1: Base Image (Installs Dependencies)
|
||||||
# =========================================================
|
# =========================================================
|
||||||
FROM nvidia/cuda:13.1.0-devel-ubuntu24.04 AS base
|
FROM nvidia/cuda:13.1.0-devel-ubuntu24.04 AS base
|
||||||
|
|
||||||
|
# Build parallemism
|
||||||
|
ARG BUILD_JOBS
|
||||||
|
ENV MAX_JOBS=${BUILD_JOBS}
|
||||||
|
ENV CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_JOBS}
|
||||||
|
ENV NINJAFLAGS="-j${BUILD_JOBS}"
|
||||||
|
ENV MAKEFLAGS="-j${BUILD_JOBS}"
|
||||||
|
|
||||||
# Set non-interactive frontend to prevent apt prompts
|
# Set non-interactive frontend to prevent apt prompts
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user