IPEX and Intel GPUs
GPU Support with IPEX and SD.Next
- Intel ARC Series
- Intel Flex Series
- Intel Max Series
Note
Iris Xe and older iGPUs are not supported with IPEX, use OpenVINO if you want to use an older iGPU.
Having an Intel iGPU can cause conflicts and random errors if you want to use a dedicated Intel GPU with IPEX.
Disable your iGPU (if any, e.g. UHD or Iris Xe) in the device manager.
Windows Installation
Preparations
- Install Intel ARC Drivers
- Install Intel OneAPI Deep Learning Essentials
- Install Git and Python
- Open CMD in a folder you want to install SD.Next
Using SD.Next
Open a CMD window and install SD.Next from Github:
git clone https://github.com/vladmandic/sdnext
cd automatic
Then run SD.Next:
"C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\env\vars.bat"
"C:\Program Files (x86)\Intel\oneAPI\ocloc\2024.2\env\vars.bat"
.\webui.bat --use-ipex
Note
It will install the necessary libraries at the first run so it will take a while depending on your internet.
Linux and WSL Installation
Note
#### Don't use Linux Kernel 6.8 or 6.9 with Linux!
https://github.com/intel/compute-runtime/issues/726
Update your kernel to at least 6.10 or update to the latest available kernel.
*Updating kernel is not necessary for WSL as it is using the Windows GPU drivers instead.
Ubuntu / WSL
Following Ubuntu instructions are for Ubuntu 24.04.
Install the base packages:
sudo apt update && sudo apt install -y software-properties-common build-essential ca-certificates wget gpg git
Add the package lists for Intel Level Zero Drivers:
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble client" | sudo tee /etc/apt/sources.list.d/intel-gpu-noble.list
sudo apt update
Install the Intel Level Zero Drivers and the packages needed for PyTorch:
sudo apt install -y intel-opencl-icd libze-intel-gpu1 libze1 libgl1 libglib2.0-0 libgomp1
Arch Linux
Install the necessary packages for Arch Linux:
sudo pacman -S intel-compute-runtime level-zero-headers level-zero-loader base-devel git python-pip python-virtualenv
Install Python 3.12 (or anything between 3.10 and 3.12):
git clone https://aur.archlinux.org/python312.git
cd python312
makepkg -si
cd ..
export PYTHON=python3.12
Using SD.Next on Linux
Install SD.Next from Github:
git clone https://github.com/vladmandic/sdnext
cd automatic
Run SD.Next
./webui.sh --use-ipex
Note
It will install the necessary libraries at the first run so it will take a while depending on your internet.
Docker Installation
Checkout the Docker wiki if you want to build a custom Docker image.
Using Docker with a prebuilt image:
export SDNEXT_DOCKER_ROOT_FOLDER=~/sdnext
sudo docker run -it \
--name sdnext-ipex \
--device /dev/dri \
-p 7860:7860 \
-v $SDNEXT_DOCKER_ROOT_FOLDER/app:/app \
-v $SDNEXT_DOCKER_ROOT_FOLDER/python:/mnt/python \
-v $SDNEXT_DOCKER_ROOT_FOLDER/data:/mnt/data \
-v $SDNEXT_DOCKER_ROOT_FOLDER/models:/mnt/models \
-v $SDNEXT_DOCKER_ROOT_FOLDER/huggingface:/root/.cache/huggingface \
disty0/sdnext-ipex:latest
Note
It will install the necessary libraries at the first run so it will take a while depending on your internet.
Resulting docker image will use 1.1 GB disk space (uncompressed) for the docker image and 8 GB for the venv.
Environment Variables
-
IPEX_SDPA_SLICE_TRIGGER_RATE
: Specify when dynamic attention slicing for Scaled Dot Product Attention should get triggered for Intel ARC. This environment variable allows you to set the trigger rate in gigabytes (GB). The default is1
. -
IPEX_ATTENTION_SLICE_RATE
: Specify the dynamic attention slicing rate for 32 bit GPUs. This environment variable allows you to set the slicing rate in gigabytes (GB). The default is0.5
. -
IPEX_FORCE_ATTENTION_SLICE
: Specify to enable or disable Dynamic Attention. The default is1
. 1
will force enable dynamic attention slicing even if the GPU supports 64 bit.-1
will force disable dynamic attention slicing even if the GPU doesn't support 64 bit.-
0
will automatically enable or disable dynamic attention based on the GPU. -
IPEXRUN
: Specify to launch the webui with ipexrun. Set it toTrue
to use ipexrun. The default is unset.