Files
aigc-apps-EasyAnimate/Dockerfile.ds
T
2024-04-23 10:27:25 +08:00

46 lines
2.2 KiB
Docker

FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive
RUN rm -r /etc/apt/sources.list.d/
RUN apt-get update -y && apt-get install -y \
libgl1 libglib2.0-0 google-perftools \
sudo wget git git-lfs vim tig pkg-config libcairo2-dev \
telnet curl net-tools iputils-ping wget jq \
python3-pip python-is-python3 python3.10-venv tzdata lsof && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
# add all extensions
RUN apt-get update -y && apt-get install -y zip && \
rm -rf /var/lib/apt/lists/*
RUN pip install wandb tqdm GitPython==3.1.32 Pillow==9.5.0 setuptools --upgrade -i https://mirrors.aliyun.com/pypi/simple/
# reinstall torch to keep compatible with xformers
RUN pip uninstall -qy torch torchvision && \
pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118
RUN pip uninstall -qy xfromers && pip install xformers==0.0.24 --index-url https://download.pytorch.org/whl/cu118
# install requirements
COPY ./requirements.txt /root/requirements.txt
RUN pip install -r /root/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
RUN rm -rf /root/requirements.txt
# vllm does not release compiled binaries with CUDA 11.8 and PyTorch >= 2.2.0.
# build vllm-0.3.3-torch2.2.0-cu118 from source with NVIDIA Driver 525.105.17.
RUN wget https://pai-aigc-photog.oss-cn-hangzhou.aliyuncs.com/easyanimate/package/vllm-0.3.3-torch2.2.0-cu118.zip && \
unzip vllm-0.3.3-torch2.2.0-cu118.zip && rm vllm-0.3.3-torch2.2.0-cu118.zip
# https://docs.vllm.ai/en/latest/getting_started/installation.html#build-from-source
RUN export MAX_JOBS=1 && export CUDA_HOME=/usr/local/cuda && export PATH="${CUDA_HOME}/bin:$PATH" && \
cd vllm/ && pip install -e . --extra-index-url https://download.pytorch.org/whl/cu118
RUN pip install auto-gptq==0.6.0 --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
RUN pip install sglang[srt] func_timeout pandas>=2.0.0 -i https://mirrors.aliyun.com/pypi/simple/
# fix version
RUN pip install outlines==0.0.34 transformers==4.37.2 -i https://mirrors.aliyun.com/pypi/simple/
ENV PYTHONUNBUFFERED 1
ENV NVIDIA_DISABLE_REQUIRE 1
WORKDIR /root/