# IPEX and Intel GPUs ## Install Guide for Windows ### Preparations - Install [Intel ARC Drivers](https://www.intel.com/content/www/us/en/download/785597/intel-arc-iris-xe-graphics-windows.html) - Install [Git and Python](Installation#install-python-and-git) ### Running SD.Next on Windows Open CMD in the folder where you want to install SD.Next, then run: ```shell git clone https://github.com/vladmandic/sdnext ```bash Then enter the `sdnext` folder: ```shell cd sdnext ``` Then start SD.Next with: ```shell .\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. ## Install Guide for Linux or WSL > [!NOTE] > > **Do not use Linux Kernel 6.8 or 6.9 with Linux.** > > > Update your kernel to at least 6.10 or update to the latest available kernel. > > *Updating the kernel is not necessary for WSL because it uses Windows GPU drivers instead.* ### Install Guide for Ubuntu Linux or Ubuntu with WSL Following Ubuntu instructions are for Ubuntu 24.04. Install the base packages: ```shell 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: ```shell 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: ```shell sudo apt install -y intel-opencl-icd libze-intel-gpu1 libze1 libgl1 libglib2.0-0 libgomp1 ``` ### Install Guide for Arch Linux Install the necessary packages for Arch Linux: ```shell 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.13): ```shell git clone https://aur.archlinux.org/python312.git cd python312 makepkg -si cd .. export PYTHON=python3.12 ``` ### Running SD.Next on Linux Open a terminal in the folder where you want to install SD.Next, then run: ```shell git clone https://github.com/vladmandic/sdnext ```bash Then enter the `sdnext` folder: ```shell cd sdnext ``` Then start SD.Next with: ```shell ./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. ## Running SD.Next with Docker Check out the [Docker wiki](https://github.com/vladmandic/sdnext/wiki/Docker) if you want to build a custom Docker image. Using Docker with a prebuilt image: ```shell 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`: Trigger threshold for dynamic attention slicing in SDPA on Intel ARC, in GB. Default: `1`. - `IPEX_ATTENTION_SLICE_RATE`: Dynamic attention slicing rate for 32-bit GPUs, in GB. Default: `0.5`. - `IPEX_FORCE_ATTENTION_SLICE`: Enables or disables dynamic attention slicing. Default: `1`. - `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`: Launches the web UI with ipexrun when set to `True`. Default: unset.