Dockerfile_cu124 3.12 KB
Newer Older
Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
1
FROM pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel AS base
2
3
4
5
6
7

WORKDIR /app

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
8
ENV LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
9

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
10
11
12
13
RUN apt-get update && apt-get install -y vim tmux zip unzip wget git git-lfs build-essential libibverbs-dev ca-certificates \
    curl iproute2 libsm6 libxext6 kmod ccache libnuma-dev libssl-dev flex bison libgtk-3-dev libpango1.0-dev \
    libsoup2.4-dev libnice-dev libopus-dev libvpx-dev libx264-dev libsrtp2-dev libglib2.0-dev libdrm-dev\
    && apt-get clean && rm -rf /var/lib/apt/lists/* && git lfs install
14

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
15
RUN pip install --no-cache-dir packaging ninja cmake scikit-build-core uv meson ruff pre-commit fastapi uvicorn requests -U
16

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
17
RUN git clone https://github.com/vllm-project/vllm.git -b v0.10.0 && cd vllm \
18
19
20
    && python use_existing_torch.py && pip install -r requirements/build.txt \
    && pip install --no-cache-dir --no-build-isolation -v -e .

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
21
RUN git clone https://github.com/sgl-project/sglang.git -b v0.4.10 && cd sglang/sgl-kernel \
22
23
24
    && make build && make clean

RUN pip install --no-cache-dir diffusers transformers tokenizers accelerate safetensors opencv-python numpy imageio \
Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
25
    imageio-ffmpeg einops loguru qtorch ftfy av decord
26

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
27
RUN conda install conda-forge::ffmpeg=8.0.0 -y && ln -s /opt/conda/bin/ffmpeg /usr/bin/ffmpeg && conda clean -all -y
LiangLiu's avatar
LiangLiu committed
28

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
29
RUN git clone https://github.com/Dao-AILab/flash-attention.git -b v2.8.3 --recursive
30
31
32
33
34

RUN cd flash-attention && python setup.py install && rm -rf build

RUN cd flash-attention/hopper && python setup.py install && rm -rf build

Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
35
RUN git clone https://github.com/ModelTC/SageAttention.git
36

Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
37
RUN cd SageAttention && CUDA_ARCHITECTURES="8.0,8.6,8.9,9.0" EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 pip install --no-cache-dir -v -e .
38

39
40
41
42
RUN git clone https://github.com/KONAKONA666/q8_kernels.git

RUN cd q8_kernels && git submodule init && git submodule update && python setup.py install && rm -rf build

Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# cloud deploy
RUN pip install --no-cache-dir aio-pika asyncpg>=0.27.0 aioboto3>=12.0.0 PyJWT alibabacloud_dypnsapi20170525==1.2.2 redis==6.4.0 tos

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
ENV PATH=/root/.cargo/bin:$PATH

RUN cd /opt \
    && wget https://mirrors.tuna.tsinghua.edu.cn/gnu//libiconv/libiconv-1.15.tar.gz \
    && tar zxvf libiconv-1.15.tar.gz \
    && cd libiconv-1.15 \
    && ./configure \
    && make \
    && make install \
    && rm -rf /opt/libiconv-1.15

RUN cd /opt \
    && git clone https://github.com/GStreamer/gstreamer.git -b 1.24.12 --depth 1 \
    && cd gstreamer \
    && meson setup builddir \
    && meson compile -C builddir \
    && meson install -C builddir \
    && ldconfig \
    && rm -rf /opt/gstreamer

RUN cd /opt \
    && git clone https://github.com/GStreamer/gst-plugins-rs.git -b gstreamer-1.24.12 --depth 1 \
    && cd gst-plugins-rs \
    && cargo build --package gst-plugin-webrtchttp --release \
    && install -m 644 target/release/libgstwebrtchttp.so $(pkg-config --variable=pluginsdir gstreamer-1.0)/ \
    && rm -rf /opt/gst-plugins-rs

RUN ldconfig

76
WORKDIR /workspace