Dockerfile 1.2 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 \
lvhan028's avatar
lvhan028 committed
4
5
6
    rapidjson-dev libgoogle-glog-dev gdb  \
    && rm -rf /var/lib/apt/lists/*

7
RUN python3 -m pip install --no-cache-dir torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
8
RUN python3 -m pip install --no-cache-dir cmake packaging
lvhan028's avatar
lvhan028 committed
9
10

ENV NCCL_LAUNCH_MODE=GROUP
11

12
13
# Should be in the lmdeploy root directory when building docker image
COPY . /opt/lmdeploy
14

15
16
17
WORKDIR /opt/lmdeploy

RUN cd /opt/lmdeploy &&\
18
    python3 -m pip install --no-cache-dir -r requirements.txt &&\
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    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 .. &&\
    python3 -m pip install . &&\
    rm -rf build

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