-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
executable file
·38 lines (28 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04 AS base
WORKDIR /workspace
COPY . /workspace/lightx2v/
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# 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
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/*
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
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple \
&& pip install -r /workspace/lightx2v/requirements.txt
# Install again separately to bypass the version conflict check
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple \
&& pip install transformers==4.45.2
# install flash-attention 2
RUN cd lightx2v/3rd/flash-attention && pip install --no-cache-dir -v -e .
# install flash-attention 3, only if hopper
RUN cd lightx2v/3rd/flash-attention/hopper && pip install --no-cache-dir -v -e .