Dockerfile 1.55 KB
Newer Older
helloyongyang's avatar
helloyongyang committed
1
2
FROM nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04 AS base

Dongz's avatar
Dongz committed
3
WORKDIR /workspace
helloyongyang's avatar
helloyongyang committed
4

5
6
COPY . /workspace/lightx2v/

helloyongyang's avatar
helloyongyang committed
7
8
9
10
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

Dongz's avatar
Dongz committed
11
12
13
# use tsinghua source
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list \
    && sed -i 's|http://security.ubuntu.com/ubuntu/|https://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list
helloyongyang's avatar
helloyongyang committed
14

Dongz's avatar
Dongz committed
15
16
17
18
19
20
21
22
RUN apt-get update && apt install -y software-properties-common  \
    && add-apt-repository ppa:deadsnakes/ppa \
    && apt-get update \
    && apt-get install -y vim tmux zip unzip wget git cmake build-essential \
     curl libibverbs-dev ca-certificates iproute2 \
     ffmpeg libsm6 libxext6 \
    && apt-get install -y python3.11 python3.11-venv python3.11-dev python3-pip \
    && apt-get clean && rm -rf /var/lib/apt/lists/*
helloyongyang's avatar
helloyongyang committed
23

Dongz's avatar
Dongz committed
24
25
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
    && update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
helloyongyang's avatar
helloyongyang committed
26

Dongz's avatar
Dongz committed
27
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple \
28
    && pip install packaging ninja vllm torch torchvision diffusers transformers==4.45.2 \
Dongz's avatar
Dongz committed
29
     tokenizers accelerate safetensors opencv-python numpy imageio imageio-ffmpeg \
helloyongyang's avatar
helloyongyang committed
30
     einops loguru sgl-kernel qtorch ftfy easydict
helloyongyang's avatar
helloyongyang committed
31

Dongz's avatar
Dongz committed
32
# install flash-attention 2
33
RUN cd lightx2v/3rd/flash-attention && pip install --no-cache-dir -v -e .
helloyongyang's avatar
helloyongyang committed
34

Dongz's avatar
Dongz committed
35
# install flash-attention 3, only if hopper
36
RUN cd lightx2v/3rd/flash-attention/hopper && pip install --no-cache-dir -v -e .