Skip to content

Commit 405222c

Browse files
authored
fix: limit rust build parallel jobs (NVIDIA#366)
1 parent c396fa3 commit 405222c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

container/Dockerfile.tensorrt_llm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ COPY Cargo.lock /workspace/
9090
COPY rust-toolchain.toml /workspace/
9191

9292
ARG CARGO_BUILD_JOBS
93+
# Set CARGO_BUILD_JOBS to 16 if not provided
94+
# This is to prevent cargo from building $(nproc) jobs in parallel,
95+
# which might exceed the number of opened files limit.
96+
ENV CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-16}
9397

9498
ENV CARGO_TARGET_DIR=/workspace/target
9599

container/Dockerfile.vllm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ COPY components /workspace/components
262262
COPY launch /workspace/launch
263263

264264
ARG CARGO_BUILD_JOBS
265+
# Set CARGO_BUILD_JOBS to 16 if not provided
266+
# This is to prevent cargo from building $(nproc) jobs in parallel,
267+
# which might exceed the number of opened files limit.
268+
ENV CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-16}
265269

266270
ENV CARGO_TARGET_DIR=/workspace/target
267271

0 commit comments

Comments
 (0)