Guide Installing Stable Diffusion WebUI with Intel ARC GPUs

SoteMix




Notes:

Data Types:

BF16 is faster than FP16 in general.

Backend:​

Diffusers backend is 10%-25% faster than the original backend.

Errors with iGPU:
Disable your iGPU (if any, e.g. UHD or Iris Xe) in the device manager.

Errors with ipexrun on Linux:

If you get random errors at the startup, it's probably from ipexrun.
Export DISABLE_IPEXRUN=1 to disable ipexrun.



Windows Installation

Preparations:
  • Install Intel GPU Driver.
  • Install Git.
  • Install Python 3.10 or 3.11.
  • Open CMD in a folder you want to install SD.Next.

Using SD.Next:

Install SD.Next from Github:
Bash:
git clone https://github.com/vladmandic/automatic

Then enter into the automatic folder:
Bash:
cd automatic

Then start WebUI with this command:
Bash:
.\webui.bat --use-ipex
Note: It will install the necessary libraries at the first run so it can take a while depending on your internet.



Linux and WSL Installation

Install Intel Compute Runtime:

Ubuntu:

Use Ubuntu 23.04 or newer because we will need Linux 6.2 kernel or newer.
Update your kernel to at least Linux 6.2 if you are on older Ubuntu builds.
Note: Updating kernel is not neccesary for WSL.

Then add the package lists for Intel OneAPI:
Bash:
sudo apt update && sudo apt install -y ca-certificates wget gpg
Bash:
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
Bash:
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
Bash:
sudo apt update && sudo apt upgrade -y

Then install the necessary packages:
Bash:
sudo apt install intel-opencl-icd intel-level-zero-gpu level-zero git python3-pip python3-venv libgl1 libglib2.0-0 libgomp1 libjemalloc-dev


Arch Linux:

Install the necessary packages for Arch Linux:
Bash:
pacman -S intel-compute-runtime level-zero-headers level-zero-loader git python-pip python-virtualenv jemalloc


Using SD.Next:

Install SD.Next from Github:
Bash:
git clone https://github.com/vladmandic/automatic

Then enter into the automatic folder:
Bash:
cd automatic

Then start WebUI with this command:
Bash:
./webui.sh --use-ipex
Note: It will install the necessary libraries at the first run so it can take a while depending on your internet.
 
Son düzenleme:
Hi, thank you for your guide. Everything worked perfectly fine the first time I did it, but yesterday I reinstalled Windows and ever since can't get it to work any more. I keep getting the following errors.

/home/linux/automatic/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") numactl: This system does not support NUMA policy2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Core binding with numactl is not available. Disabling numactl and using taskset instead. This may affect performance in multi-socket system; please use numactl if memory binding is needed. 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Neither TCMalloc nor JeMalloc is found in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/linux/.local/lib/ so the LD_PRELOAD environment variable will not be set. This may drop the performance 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - INFO - OMP_NUM_THREADS=6 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Unable to find the iomp library file libiomp5.so in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/linux/.local/lib/ so the LD_PRELOAD environment variable will not be set.you can use 'conda install intel-openm' to install intel openMP 2023-07-16 12:49:47,899 - intel_extension_for_pytorch.cpu.launch - INFO - taskset -c 0-5 /home/linux/automatic/venv/bin/python3 -u launch.py --use-ipex

/home/linux/automatic/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") No module 'xformers'. Proceeding without it. 12:49:52-319457 INFO Pipeline: Backend.ORIGINAL Error in sys.excepthook: Traceback (most recent call last): File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 103, in excepthook Traceback.from_exception( File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 346, in from_exception return cls( File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 280, in __init__ for suppress_entity in suppress: TypeError: 'module' object is not iterable Original exception was: Traceback (most recent call last): File "/home/linux/automatic/launch.py", line 191, in <module> instance = start_server(immediate=True, server=None) File "/home/linux/automatic/launch.py", line 136, in start_server module_spec.loader.exec_module(server) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/linux/automatic/webui.py", line 45, in <module> from modules import shared, extensions, extra_networks, ui_tempdir, ui_extra_networks, modelloader File "/home/linux/automatic/modules/ui_extra_networks.py", line 11, in <module> from modules.generation_parameters_copypaste import image_from_url_text File "/home/linux/automatic/modules/generation_parameters_copypaste.py", line 10, in <module> from modules import shared, ui_tempdir, script_callbacks, images File "/home/linux/automatic/modules/images.py", line 18, in <module> from modules import sd_samplers, shared, script_callbacks, errors, paths File "/home/linux/automatic/modules/sd_samplers.py", line 1, in <module> from modules import sd_samplers_compvis, sd_samplers_kdiffusion, sd_samplers_diffusers, shared File "/home/linux/automatic/modules/sd_samplers_kdiffusion.py", line 4, in <module> import k_diffusion.sampling File "/home/linux/automatic/repositories/k-diffusion/k_diffusion/__init__.py", line 1, in <module> from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "/home/linux/automatic/repositories/k-diffusion/k_diffusion/evaluation.py", line 6, in <module> import clip ModuleNotFoundError: No module named 'clip' die: piextUSMEnqueueMemset2D: not implemented terminate called without an active exception Traceback (most recent call last): File "/home/linux/automatic/venv/bin/ipexrun", line 8, in <module> sys.exit(main()) File "/home/linux/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch.py", line 880, in main launcher.launch(args) File "/home/linux/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch.py", line 542, in launch raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd_s) subprocess.CalledProcessError: Command 'taskset -c 0-5 /home/linux/automatic/venv/bin/python3 -u launch.py --use-ipex' died with <Signals.SIGABRT: 6>. die: piextUSMEnqueueMemset2D: not implemented terminate called without an active exception Aborted

I have tried different Ubuntu Versions but it didn't solve the problem. Do you have any idea what could have went wrong?
 
Hi, thank you for your guide. Everything worked perfectly fine the first time I did it, but yesterday I reinstalled Windows and ever since can't get it to work any more. I keep getting the following errors.

/home/linux/automatic/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") numactl: This system does not support NUMA policy2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Core binding with numactl is not available. Disabling numactl and using taskset instead. This may affect performance in multi-socket system; please use numactl if memory binding is needed. 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Neither TCMalloc nor JeMalloc is found in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/linux/.local/lib/ so the LD_PRELOAD environment variable will not be set. This may drop the performance 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - INFO - OMP_NUM_THREADS=6 2023-07-16 12:49:47,898 - intel_extension_for_pytorch.cpu.launch - WARNING - Unable to find the iomp library file libiomp5.so in $CONDA_PREFIX/lib or $VIRTUAL_ENV/lib or /.local/lib/ or /usr/local/lib/ or /usr/local/lib64/ or /usr/lib or /usr/lib64 or /home/linux/.local/lib/ so the LD_PRELOAD environment variable will not be set.you can use 'conda install intel-openm' to install intel openMP 2023-07-16 12:49:47,899 - intel_extension_for_pytorch.cpu.launch - INFO - taskset -c 0-5 /home/linux/automatic/venv/bin/python3 -u launch.py --use-ipex

/home/linux/automatic/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") No module 'xformers'. Proceeding without it. 12:49:52-319457 INFO Pipeline: Backend.ORIGINAL Error in sys.excepthook: Traceback (most recent call last): File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 103, in excepthook Traceback.from_exception( File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 346, in from_exception return cls( File "/home/linux/automatic/venv/lib/python3.10/site-packages/rich/traceback.py", line 280, in __init__ for suppress_entity in suppress: TypeError: 'module' object is not iterable Original exception was: Traceback (most recent call last): File "/home/linux/automatic/launch.py", line 191, in <module> instance = start_server(immediate=True, server=None) File "/home/linux/automatic/launch.py", line 136, in start_server module_spec.loader.exec_module(server) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/linux/automatic/webui.py", line 45, in <module> from modules import shared, extensions, extra_networks, ui_tempdir, ui_extra_networks, modelloader File "/home/linux/automatic/modules/ui_extra_networks.py", line 11, in <module> from modules.generation_parameters_copypaste import image_from_url_text File "/home/linux/automatic/modules/generation_parameters_copypaste.py", line 10, in <module> from modules import shared, ui_tempdir, script_callbacks, images File "/home/linux/automatic/modules/images.py", line 18, in <module> from modules import sd_samplers, shared, script_callbacks, errors, paths File "/home/linux/automatic/modules/sd_samplers.py", line 1, in <module> from modules import sd_samplers_compvis, sd_samplers_kdiffusion, sd_samplers_diffusers, shared File "/home/linux/automatic/modules/sd_samplers_kdiffusion.py", line 4, in <module> import k_diffusion.sampling File "/home/linux/automatic/repositories/k-diffusion/k_diffusion/__init__.py", line 1, in <module> from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "/home/linux/automatic/repositories/k-diffusion/k_diffusion/evaluation.py", line 6, in <module> import clip ModuleNotFoundError: No module named 'clip' die: piextUSMEnqueueMemset2D: not implemented terminate called without an active exception Traceback (most recent call last): File "/home/linux/automatic/venv/bin/ipexrun", line 8, in <module> sys.exit(main()) File "/home/linux/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch.py", line 880, in main launcher.launch(args) File "/home/linux/automatic/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/cpu/launch.py", line 542, in launch raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd_s) subprocess.CalledProcessError: Command 'taskset -c 0-5 /home/linux/automatic/venv/bin/python3 -u launch.py --use-ipex' died with <Signals.SIGABRT: 6>. die: piextUSMEnqueueMemset2D: not implemented terminate called without an active exception Aborted

I have tried different Ubuntu Versions but it didn't solve the problem. Do you have any idea what could have went wrong?


Seems like core libraries required for SD are missing.
Remove the venv folder and config.json file and start with webui.sh --use-ipex instead of launch.py.
 
Son düzenleme:

Yeni konular

Geri
Yukarı