|
| 1 | +# Copyright (C) 2025 Intel Corporation |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +# ======== Base Stage ======== |
| 5 | +FROM intel/deep-learning-essentials:2025.0.2-0-devel-ubuntu24.04 AS vllm-base |
| 6 | + |
| 7 | +ARG https_proxy |
| 8 | +ARG http_proxy |
| 9 | + |
| 10 | +# Add Intel oneAPI repo and PPA for GPU support |
| 11 | +RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ |
| 12 | + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ |
| 13 | + add-apt-repository -y ppa:kobuk-team/intel-graphics-testing |
| 14 | + |
| 15 | +# Install dependencies and Python 3.10 |
| 16 | +RUN apt-get update -y && \ |
| 17 | + apt-get install -y software-properties-common && \ |
| 18 | + add-apt-repository ppa:deadsnakes/ppa && \ |
| 19 | + apt-get update -y && \ |
| 20 | + apt-get install -y python3.10 python3.10-distutils python3.10-dev && \ |
| 21 | + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \ |
| 22 | + apt-get install -y --no-install-recommends --fix-missing \ |
| 23 | + curl \ |
| 24 | + ffmpeg \ |
| 25 | + git \ |
| 26 | + libsndfile1 \ |
| 27 | + libsm6 \ |
| 28 | + libxext6 \ |
| 29 | + libgl1 \ |
| 30 | + lsb-release \ |
| 31 | + numactl \ |
| 32 | + wget \ |
| 33 | + vim \ |
| 34 | + linux-libc-dev && \ |
| 35 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \ |
| 36 | + # Install Intel GPU runtime packages |
| 37 | + apt-get update -y && \ |
| 38 | + apt-get install -y libze1 libze-dev libze-intel-gpu1 intel-opencl-icd libze-intel-gpu-raytracing && \ |
| 39 | + apt-get install -y intel-oneapi-dpcpp-ct=2025.0.1-17 && \ |
| 40 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
| 41 | + |
| 42 | +WORKDIR /llm |
| 43 | + |
| 44 | +# Set environment variables early |
| 45 | +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/" |
| 46 | + |
| 47 | +# ======= Add oneCCL build ======= |
| 48 | +RUN apt-get update && apt-get install -y \ |
| 49 | + cmake \ |
| 50 | + g++ \ |
| 51 | + && rm -rf /var/lib/apt/lists/* |
| 52 | + |
| 53 | +ENV LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/python3.10/dist-packages/torch/lib:$LD_LIBRARY_PATH" |
| 54 | + |
| 55 | +RUN pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/xpu && \ |
| 56 | + pip install tqdm huggingface_hub modelscope einops transformers==4.53.3 sentencepiece && \ |
| 57 | + apt remove python3-blinker -y |
| 58 | + |
| 59 | +COPY ./patches/qwen_image_for_multi_arc.patch /tmp/ |
| 60 | +COPY ./qwen_image_example.py /llm/qwen-image/ |
| 61 | + |
| 62 | +RUN cd /llm && \ |
| 63 | + git clone https://github.com/modelscope/DiffSynth-Studio.git && \ |
| 64 | + cd ./DiffSynth-Studio && \ |
| 65 | + git checkout 89bf3ce5cfe1ed5a9aa3bd2c2f74da0a82ba84f4 && \ |
| 66 | + git apply /tmp/qwen_image_for_multi_arc.patch && \ |
| 67 | + pip install -e . |
| 68 | + |
| 69 | + |
| 70 | +WORKDIR /llm/qwen-image/ |
0 commit comments