Open daFritz84 opened 7 months ago
Upstream IPEX issue: https://github.com/intel/intel-extension-for-pytorch/issues/505
Reproduced in the Docker image: https://github.com/Disty0/docker-sdnext-ipex/
Works fine in native Arch Linux.
Diffusers backend works fine in the Docker image. Use the Diffusers backend until the fix is implemented in IPEX itself.
@Disty0 thanks for your effort I had this issue on arch native using original backend.
I tried to confirm your findings with your docker container, what are your settings? For myself I tried to inpaint on a completely white 512x512 png file and diffusers backend keeps crashing. I keep all my settings on default, except switching from original to diffusers backend
I already disabled controlnet extension because otherwise it wouldn't even try to start.
Launching ipexrun launch.py...
/python/venv/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
warn(
/python/venv/lib/python3.10/site-packages/intel_extension_for_pytorch/launcher.py:102: UserWarning: Backend is not specified, it will automatically default to cpu.
warnings.warn(
2024-01-20 09:23:54,133 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'jemalloc' memory allocator.
2024-01-20 09:23:54,133 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'auto' => 'intel' OpenMP runtime.
2024-01-20 09:23:54,134 - intel_extension_for_pytorch.cpu.launch.launch - INFO - Use 'taskset' multi-task manager.
2024-01-20 09:23:54,134 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: Untouched preset environment variables are not displayed.
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so:/python/venv/lib/libiomp5.so
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: MALLOC_CONF=oversize_threshold:1,background_thread:true,metadata_thp:auto
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: KMP_AFFINITY=granularity=fine,compact,1,0
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: KMP_BLOCKTIME=1
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - env: OMP_NUM_THREADS=4
2024-01-20 09:23:54,135 - intel_extension_for_pytorch.cpu.launch.launch - INFO - cmd: taskset -c 0-3 /python/venv/bin/python3 -u launch.py -f --use-ipex --listen
09:23:54-344104 INFO Starting SD.Next
09:23:54-347766 INFO Logger: file="/sdnext/sdnext.log" level=INFO size=164782 mode=append
09:23:54-348989 INFO Python 3.10.12 on Linux
09:23:54-377820 INFO Version: app=sd.next updated=2024-01-13 hash=5fb290f4 url=https://github.com/vladmandic/automatic.git/tree/master
09:23:54-565654 INFO Platform: arch=x86_64 cpu=x86_64 system=Linux release=6.7.0-arch3-1 python=3.10.12
09:23:54-573631 INFO Intel OneAPI Toolkit detected
09:23:54-637763 INFO Extensions: disabled=[]
09:23:54-639562 INFO Extensions: enabled=['Lora', 'sd-webui-agent-scheduler', 'sd-extension-chainner', 'stable-diffusion-webui-images-browser', 'sd-extension-system-info',
'stable-diffusion-webui-rembg', 'sd-webui-controlnet'] extensions-builtin
09:23:54-642838 INFO Extensions: enabled=[] extensions
09:23:54-644883 INFO Startup: quick launch
09:23:54-646622 INFO Verifying requirements
09:23:54-665184 INFO Verifying packages
09:23:54-667280 INFO Extensions: disabled=[]
09:23:54-668146 INFO Extensions: enabled=['Lora', 'sd-webui-agent-scheduler', 'sd-extension-chainner', 'stable-diffusion-webui-images-browser', 'sd-extension-system-info',
'stable-diffusion-webui-rembg', 'sd-webui-controlnet'] extensions-builtin
09:23:54-669682 INFO Extensions: enabled=[] extensions
09:23:54-672170 INFO Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
09:23:54-673575 INFO Command line args: ['-f', '--use-ipex', '--listen'] listen=True f=True use_ipex=True
09:23:58-715301 INFO Load packages: torch=2.1.0a0+cxx11.abi diffusers=0.25.0 gradio=3.43.2
09:23:59-139799 INFO Engine: backend=Backend.DIFFUSERS compute=ipex mode=no_grad device=xpu cross-optimization="Scaled-Dot-Product"
09:23:59-170120 INFO Device: device=Intel(R) Arc(TM) A750 Graphics n=1 ipex=2.1.10+xpu
2024-01-20 09:23:59.687105: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-01-20 09:23:59.687139: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-01-20 09:23:59.687169: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-01-20 09:24:00.768020: I itex/core/wrapper/itex_cpu_wrapper.cc:70] Intel Extension for Tensorflow* AVX2 CPU backend is loaded.
2024-01-20 09:24:01.003427: I itex/core/wrapper/itex_gpu_wrapper.cc:35] Intel Extension for Tensorflow* GPU backend is loaded.
2024-01-20 09:24:01.040545: I itex/core/graph/xpu_graph.cc:130] Please enable TF_ENABLE_ONEDNN_OPTS.So can benefit from the optimization of the MklCPUAllocator memory allocation.
2024-01-20 09:24:01.056139: I itex/core/devices/gpu/itex_gpu_runtime.cc:129] Selected platform: Intel(R) Level-Zero
2024-01-20 09:24:01.056173: I itex/core/devices/gpu/itex_gpu_runtime.cc:154] number of sub-devices is zero, expose root device.
09:24:01-372151 INFO Available VAEs: path="models/VAE" items=0
09:24:01-373452 INFO Disabled extensions: ['sd-webui-controlnet']
09:24:01-375418 INFO Available models: path="models/Stable-diffusion" items=1 time=0.00
09:24:01-557847 INFO Extension: script='scripts/faceid.py' [2;36m09:24:01-556285[0m[2;36m [0m[1;31mERROR [0m FaceID: No module named [32m'insightface'[0m
09:24:02-487770 INFO Extension: script='extensions-builtin/sd-webui-agent-scheduler/scripts/task_scheduler.py' Using sqlite file: extensions-builtin/sd-webui-agent-scheduler/task_scheduler.sqlite3
09:24:02-668395 INFO Extensions time: 1.14 { Lora=0.37 sd-webui-agent-scheduler=0.50 stable-diffusion-webui-images-browser=0.18 }
09:24:02-727770 INFO Load UI theme: name="black-teal" style=Auto base=sdnext.css
09:24:04-237446 INFO Local URL: http://localhost:7860/
09:24:04-238687 INFO Initializing middleware
09:24:04-420810 INFO [AgentScheduler] Task queue is empty
09:24:04-421935 INFO [AgentScheduler] Registering APIs
09:24:04-555356 INFO Startup time: 9.86 { torch=3.14 gradio=0.86 libraries=2.66 extensions=1.14 face-restore=0.15 upscalers=0.05 ui-extra-networks=0.08 ui-img2img=0.06 ui-control=0.05
ui-settings=0.18 ui-extensions=0.65 ui-defaults=0.09 launch=0.26 api=0.10 app-started=0.21 }
09:27:44-800417 INFO Select: model="dreamshaper_8 [879db523c3]"
Loading model: /sdnext/models/Stable-diffusion/dreamshaper_8.safetensors ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/2.1 GB -:--:--
09:27:44-878954 INFO Setting Torch parameters: device=xpu dtype=torch.bfloat16 vae=torch.bfloat16 unet=torch.bfloat16 context=no_grad fp16=False bf16=True
09:27:44-881047 INFO Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline file="/sdnext/models/Stable-diffusion/dreamshaper_8.safetensors" size=2034MB
09:27:47-904247 INFO IPEX Optimize: time=0.16
09:27:47-916525 INFO Load embeddings: loaded=0 skipped=0 time=0.00
09:27:48-223151 INFO Load model: time=3.11 { load=3.11 } native=512 {'ram': {'used': 6.58, 'total': 31.3}, 'gpu': {'used': 2.06, 'total': 7.94}, 'retries': 0, 'oom': 0}
LIBXSMM_VERSION: main_stable-1.17-3651 (25693763)
LIBXSMM_TARGET: hsw [Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz]
Registry and code: 13 MB
Command: /python/venv/bin/python3 -u launch.py -f --use-ipex --listen
Uptime: 234.754138 s
Reproduced it with UniPC Sampler + Original Backend on native Arch Linux too. Diffusers is still working fine. Try starting the webui like this:
DISABLE_IPEXRUN=1 ./webui.sh --use-ipex
Also try switching to dev branch and try with using the system OneAPI. Install OneAPI basekit with your package manager and activate it, then start the webui like this:
DISABLE_VENV_LIBS=1 ./webui.sh --use-ipex
My settings for the Docker image is a brand new install with default settings but using Euler a sampler.
@Disty0 Forgot to mention, that it works on Arch native. It just doesn't work in docker for some reason.
Issue Description
I tried to inpaint a picture using ipex on an Intel Arc 750. However it crashes right in the Intel libs again.
Stack Trace:
Looking at the log output from webui.sh, I see two suspicious assertions right before the crash (see relevant log output).
I already did disable all extensions, and I can confirm that I can generate images just fine using txt2img.
Thanks for any clues what might be wrong, Stefan
Version Platform Description
Relevant log output
Backend
Original
Branch
Master
Model
SD 1.5
Acknowledgements