# 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](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](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) - Open CMD in a folder you want to install SD.Next ### Using SD.Next Open a CMD window and install SD.Next from Github: ```shell git clone https://github.com/vladmandic/sdnext cd automatic ``` Then run SD.Next: ``` .\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! > > 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: ```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 ``` ### 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.12): ```shell 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: ```shell git clone https://github.com/vladmandic/sdnext cd automatic ``` Run SD.Next ```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. ## Docker Installation Checkout 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: ``` 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 is `1`. - `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 is `0.5`. - `IPEX_FORCE_ATTENTION_SLICE`: Specify to enable or disable Dynamic Attention. The default is `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`: Specify to launch the webui with ipexrun. Set it to `True` to use ipexrun. The default is unset.