Skip to content
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

Commit e2bb448

Browse files
committed
Update to use upstream IPEX 2.1.30+xpu and add some more environment variables and update some Intel packages to latest.
1 parent 21ae861 commit e2bb448

File tree

1 file changed

+50
-30
lines changed

1 file changed

+50
-30
lines changed

Dockerfile

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
ARG UBUNTU_VERSION=22.04
33
FROM ubuntu:${UBUNTU_VERSION} AS oneapi-lib-installer
44

5+
# Make sure Dockerfile doesn't succeed if there are errors.
6+
RUN ["/bin/sh", "-c", "/bin/bash", "-o", "pipefail", "-c"]
7+
58
# Install prerequisites to install oneAPI runtime libraries.
69
# hadolint ignore=DL3008
710
RUN apt-get update && \
@@ -10,12 +13,10 @@ RUN apt-get update && \
1013
gnupg2 \
1114
gpg-agent \
1215
unzip \
13-
wget && \
14-
apt-get clean && \
15-
rm -rf /var/lib/apt/lists/*
16+
wget
1617

1718
# hadolint ignore=DL4006
18-
RUN no_proxy=$no_proxy wget --progress=dot:giga -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
19+
RUN wget --progress=dot:giga -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
1920
| gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
2021
echo 'deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main' \
2122
| tee /etc/apt/sources.list.d/oneAPI.list
@@ -34,12 +35,11 @@ RUN apt-get update && \
3435
rm -rf /var/lib/apt/lists/*
3536

3637
# Add and prepare Intel Graphics driver index. This is dependent on being able to pass your GPU with a working driver on the host side where the image will run.
37-
ARG DEVICE=arc
3838
# hadolint ignore=DL4006
39-
RUN no_proxy=$no_proxy wget --progress=dot:giga -qO - https://repositories.intel.com/graphics/intel-graphics.key | \
39+
RUN wget --progress=dot:giga -qO - https://repositories.intel.com/graphics/intel-graphics.key | \
4040
gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
4141
# hadolint ignore=DL4006
42-
RUN printf 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy %s\n' "${DEVICE}" | \
42+
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" | \
4343
tee /etc/apt/sources.list.d/intel.gpu.jammy.list
4444

4545
ARG UBUNTU_VERSION=22.04
@@ -59,18 +59,17 @@ ENV DEBIAN_FRONTEND=noninteractive
5959
# Set oneAPI library environment variable
6060
ENV LD_LIBRARY_PATH=/oneapi-lib:/oneapi-lib/intel64:$LD_LIBRARY_PATH
6161

62-
# Install certificate authorities to get access to secure connections to other places for downloads.
62+
# Install certificate authorities to get access to secure connections to other places for downloads and other packages.
6363
# hadolint ignore=DL3008
6464
RUN apt-get update && \
6565
apt-get install -y --no-install-recommends --fix-missing \
6666
ca-certificates \
6767
fonts-noto \
68+
git \
6869
gnupg2 \
6970
gpg-agent \
70-
software-properties-common && \
71-
apt-get upgrade -y --no-install-recommends --fix-missing && \
72-
apt-get clean && \
73-
rm -rf /var/lib/apt/lists/*
71+
software-properties-common \
72+
wget
7473

7574
# Install Python and other associated packages from PPA since default is 3.10
7675
ARG PYTHON=python3.11
@@ -81,10 +80,7 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \
8180
${PYTHON} \
8281
lib${PYTHON} \
8382
python3-pip \
84-
${PYTHON}-venv && \
85-
#python3-venv && \
86-
apt-get clean && \
87-
rm -rf /var/lib/apt/lists/*
83+
${PYTHON}-venv
8884

8985
# Update pip
9086
# hadolint ignore=DL3013
@@ -99,10 +95,10 @@ RUN ln -sf "$(which ${PYTHON})" /usr/local/bin/python && \
9995
ln -sf "$(which ${PYTHON})" /usr/bin/python3
10096

10197
# Sets versions of Level-Zero, OpenCL and memory allocator chosen.
102-
ARG ICD_VER=23.17.26241.33-647~22.04
103-
ARG LEVEL_ZERO_GPU_VER=1.3.26241.33-647~22.04
104-
ARG LEVEL_ZERO_VER=1.11.0-647~22.04
105-
ARG LEVEL_ZERO_DEV_VER=1.11.0-647~22.04
98+
ARG ICD_VER=23.43.27642.40-803~22.04
99+
ARG LEVEL_ZERO_GPU_VER=1.3.27642.40-803~22.04
100+
ARG LEVEL_ZERO_VER=1.14.0-744~22.04
101+
ARG LEVEL_ZERO_DEV_VER=1.14.0-744~22.04
106102
ARG ALLOCATOR=tcmalloc
107103
ENV ALLOCATOR=${ALLOCATOR}
108104
ARG ALLOCATOR_PACKAGE=libgoogle-perftools-dev
@@ -118,9 +114,18 @@ RUN apt-get update && \
118114
intel-opencl-icd=${ICD_VER} \
119115
intel-level-zero-gpu=${LEVEL_ZERO_GPU_VER} \
120116
level-zero=${LEVEL_ZERO_VER} \
121-
level-zero-dev=${LEVEL_ZERO_DEV_VER} && \
122-
apt-get clean && \
123-
rm -rf /var/lib/apt/lists/*
117+
level-zero-dev=${LEVEL_ZERO_DEV_VER}
118+
119+
# Update Compute Runtime to latest version
120+
RUN mkdir neo && \
121+
cd neo && \
122+
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16510.2/intel-igc-core_1.0.16510.2_amd64.deb && \
123+
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16510.2/intel-igc-opencl_1.0.16510.2_amd64.deb && \
124+
wget https://github.com/intel/compute-runtime/releases/download/24.13.29138.7/intel-level-zero-gpu_1.3.29138.7_amd64.deb && \
125+
wget https://github.com/intel/compute-runtime/releases/download/24.13.29138.7/intel-opencl-icd_24.13.29138.7_amd64.deb && \
126+
wget https://github.com/intel/compute-runtime/releases/download/24.13.29138.7/libigdgmm12_22.3.18_amd64.deb && \
127+
dpkg -i *.deb && \
128+
cd ..
124129

125130
# Install Comfy UI/Pytorch dependencies.
126131
# hadolint ignore=DL3008
@@ -130,8 +135,13 @@ RUN apt-get update && \
130135
libgl1 \
131136
libglib2.0-0 \
132137
libgomp1 \
133-
git \
134-
numactl && \
138+
numactl
139+
140+
# Make sure everything is up to date.
141+
# hadolint ignore=DL3008
142+
RUN apt-get update && \
143+
apt-get upgrade -y --no-install-recommends --fix-missing && \
144+
apt-get autoremove -y && \
135145
apt-get clean && \
136146
rm -rf /var/lib/apt/lists/*
137147

@@ -143,26 +153,36 @@ RUN chmod 755 /bin/startup.sh
143153
VOLUME [ "/deps" ]
144154
VOLUME [ "/ComfyUI" ]
145155
VOLUME [ "/models" ]
146-
VOLUME [ "/root/.cache/huggingfacetest" ]
156+
VOLUME [ "/root/.cache/huggingface" ]
147157

148158
# Setup location of Python virtual environment and make sure LD_PRELOAD contains the path of the allocator chosen.
149159
ENV VENVDir=/deps/venv
150160
ENV LD_PRELOAD=${ALLOCATOR_LD_PRELOAD}
151161

162+
# Enable Level Zero system management
163+
# See https://spec.oneapi.io/level-zero/latest/sysman/PROG.html
164+
ENV ZES_ENABLE_SYSMAN=1
165+
152166
# Force 100% available VRAM size for compute-runtime.
153167
# See https://github.com/intel/compute-runtime/issues/586
154168
ENV NEOReadDebugKeys=1
155169
ENV ClDeviceGlobalMemSizeAvailablePercent=100
156170

171+
# Enable double precision emulation just in case.
172+
# See https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md#feature-double-precision-emulation-fp64
173+
ENV OverrideDefaultFP64Settings=1
174+
ENV IGC_EnableDPEmulation=1
175+
157176
# Enable SYCL variables for cache reuse and single threaded mode.
158177
# See https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md
159178
ENV SYCL_CACHE_PERSISTENT=1
160179
ENV SYCL_PI_LEVEL_ZERO_SINGLE_THREAD_MODE=1
161180

162-
# Enable double precision emulation just in case.
163-
# See https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md#feature-double-precision-emulation-fp64
164-
ENV OverrideDefaultFP64Settings=1
165-
ENV IGC_EnableDPEmulation=1
181+
# FIXME: Does this need to be turned on for Stable Diffusion or only with ipex-llm?
182+
#ENV BIGDL_LLM_XMX_DISABLED=1
183+
# FIXME: The below variables are optimal for running LLMs but not Stable Diffusion which setting these makes it slower. Figure out why.
184+
#ENV SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1
185+
#ENV USE_XETLA=OFF
166186

167187
# Set variable for better training performance in case.
168188
# See https://github.com/intel/intel-extension-for-pytorch/issues/296#issuecomment-1461118993

0 commit comments

Comments
 (0)