Skip to content

Commit

Permalink
Dockerfile.ubi: force using python-installed cuda runtime libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Aug 19, 2024
1 parent f41930e commit 26cfbd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
pip install \
-r requirements-cuda.txt


## Development #################################################################
FROM python-cuda-base AS dev

Expand Down Expand Up @@ -113,7 +114,6 @@ ENV VLLM_INSTALL_PUNICA_KERNELS=1

# Make sure the cuda environment is in the PATH
ENV PATH=/usr/local/cuda/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

# Copy the entire directory before building wheel
COPY vllm vllm
Expand Down Expand Up @@ -145,12 +145,18 @@ RUN ./configure --prefix="/usr/" && make && make check

## Release #####################################################################
FROM python-install AS vllm-openai
ARG PYTHON_VERSION

WORKDIR /workspace

ENV VIRTUAL_ENV=/opt/vllm
ENV PATH=$VIRTUAL_ENV/bin/:$PATH

# force using the python venv's cuda runtime libraries
ENV LD_LIBRARY_PATH="${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/nvidia/cuda_nvrtc/lib:${LD_LIBRARY_PATH}"
ENV LD_LIBRARY_PATH="${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/nvidia/cuda_runtime/lib:${LD_LIBRARY_PATH}"
ENV LD_LIBRARY_PATH="${VIRTUAL_ENV}/lib/python${PYTHON_VERSION}/site-packages/nvidia/nvtx/lib:${LD_LIBRARY_PATH}"

# Triton needs a CC compiler
RUN microdnf install -y gcc \
&& microdnf clean all
Expand Down

0 comments on commit 26cfbd9

Please sign in to comment.