Dockerfile 1.33 KB
Newer Older
lvhan028's avatar
lvhan028 committed
1
2
FROM nvcr.io/nvidia/tritonserver:22.12-py3

3
RUN rm /etc/apt/sources.list.d/cuda*.list && apt-get update && apt-get install -y --no-install-recommends \
zhouxiang's avatar
zhouxiang committed
4
5
    rapidjson-dev libgoogle-glog-dev gdb python3.8-venv \
    && rm -rf /var/lib/apt/lists/* && cd /opt && python3 -m venv py38
lvhan028's avatar
lvhan028 committed
6

zhouxiang's avatar
zhouxiang committed
7
8
9
10
11
ENV PATH=/opt/py38/bin:$PATH

RUN python3 -m pip install --no-cache-dir --upgrade pip &&\
    python3 -m pip install --no-cache-dir torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cu118 &&\
    python3 -m pip install --no-cache-dir cmake packaging wheel
lvhan028's avatar
lvhan028 committed
12
13

ENV NCCL_LAUNCH_MODE=GROUP
14

15
16
# Should be in the lmdeploy root directory when building docker image
COPY . /opt/lmdeploy
17

18
19
20
WORKDIR /opt/lmdeploy

RUN cd /opt/lmdeploy &&\
21
    python3 -m pip install --no-cache-dir -r requirements.txt &&\
22
23
24
25
26
27
28
29
30
31
32
33
34
    mkdir -p build && cd build &&\
    cmake .. \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
        -DCMAKE_INSTALL_PREFIX=/opt/tritonserver \
        -DBUILD_PY_FFI=ON \
        -DBUILD_MULTI_GPU=ON \
        -DBUILD_CUTLASS_MOE=OFF \
        -DBUILD_CUTLASS_MIXED_GEMM=OFF \
        -DCMAKE_CUDA_FLAGS="-lineinfo" \
        -DUSE_NVTX=ON &&\
    make -j$(nproc) && make install &&\
    cd .. &&\
zhouxiang's avatar
zhouxiang committed
35
    python3 -m pip install -e . &&\
36
37
38
    rm -rf build

ENV LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH