From 1464202d7839750be4aa1c3694201077aa0797b5 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 18 Sep 2025 11:50:36 +0800 Subject: [PATCH] . --- Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4c807ff1a..0ebb798ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -143,6 +143,7 @@ ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 LANG=C.UTF-8 LC_ALL=C.UTF- RUN apt-get update && apt-get install -y --no-install-recommends \ gcc g++ build-essential ninja-build cuda-compiler-12-6 \ + libcupti-dev cuda-cupti-12-6 \ python3 python3-dev python3-pip python3-distutils curl ca-certificates \ libopenblas-dev libgomp1 libcupti-dev libnuma1 libopenmpi-dev openmpi-bin libnuma-dev libpng16-16 libjpeg8 \ libnccl2=2.22.3-1+cuda12.6 && \ @@ -170,6 +171,10 @@ RUN ls -lh /tmp/wheels || true && \ RUN python3 -m pip install --no-deps xgrammar==0.1.24 +RUN echo "/usr/local/cuda/extras/CUPTI/lib64" > /etc/ld.so.conf.d/cupti.conf && ldconfig +# 保险起见,再加一行环境变量(有些基础镜像不把 extras 加入 ld.so.conf): +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:${LD_LIBRARY_PATH} + ############################################################################### # Stage 2 ─ runtime:极简运行镜像,仅离线安装 wheel ############################################################################### @@ -180,6 +185,7 @@ ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 LANG=C.UTF-8 LC_ALL=C.UTF- RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ build-essential ninja-build cuda-compiler-12-6\ python3 python3-dev python3-pip python3-distutils curl ca-certificates \ + libcupti-dev cuda-cupti-12-6 \ libopenblas-dev libgomp1 libcupti-dev libnuma1 libopenmpi-dev openmpi-bin libnuma-dev libpng16-16 libjpeg8 libnccl2=2.22.3-1+cuda12.6 && \ rm -rf /var/lib/apt/lists/* && \ python3 -m pip install --no-cache-dir --upgrade pip @@ -212,6 +218,12 @@ RUN ls -lh /tmp/wheels && \ # ✅ 安装 Prometheus client RUN python3 -m pip install --no-cache-dir prometheus_client RUN python3 -m pip install --no-deps xgrammar==0.1.24 + +RUN echo "/usr/local/cuda/extras/CUPTI/lib64" > /etc/ld.so.conf.d/cupti.conf && ldconfig +# 保险起见,再加一行环境变量(有些基础镜像不把 extras 加入 ld.so.conf): +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:${LD_LIBRARY_PATH} + + # ✅ 设置多进程 metrics 收集目录(用于 MultiProcessCollector) ENV PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus