Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: IPEX Error loading c10_xpu.dll #3548

Closed
2 tasks done
CraterCrater opened this issue Nov 2, 2024 · 4 comments
Closed
2 tasks done

[Issue]: IPEX Error loading c10_xpu.dll #3548

CraterCrater opened this issue Nov 2, 2024 · 4 comments
Labels
platform Platform specific problem

Comments

@CraterCrater
Copy link

Issue Description

I recently installed SD.NEXT and have not been able to get it to run successfully. Every time I run it I get an error around the loading of C10_xpu.dll.

7:45:30-712011 DEBUG Starting module: <module 'webui' from 'C:\automatic\webui.py'>
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ C:\automatic\launch.py:274 in │
│ │
│ 273 if name == "main": │
│ ❱ 274 main() │
│ 275 │
│ │
│ C:\automatic\launch.py:251 in main │
│ │
│ 250 │
│ ❱ 251 uv, instance = start_server(immediate=True, server=None) │
│ 252 while True: │
│ │
│ C:\automatic\launch.py:167 in start_server │
│ │
│ 166 installer.log.debug(f'Starting module: {server}') │
│ ❱ 167 module_spec.loader.exec_module(server) │
│ 168 uvicorn = None │
│ in exec_module:883 │
│ in call_with_frames_removed:241 │
│ │
│ C:\automatic\webui.py:11 in │
│ │
│ 10 from threading import Thread │
│ ❱ 11 import modules.loader │
│ 12 import torch # pylint: disable=wrong-import-order │
│ │
│ C:\automatic\modules\loader.py:18 in │
│ │
│ 17 os.environ.setdefault('TORCH_LOGS', '-all') │
│ ❱ 18 import torch # pylint: disable=C0411 │
│ 19 if torch.version.startswith('2.5.0'): │
│ │
│ C:\automatic\venv\lib\site-packages\torch_init
.py:271 in │
│ │
│ 270 │
│ ❱ 271 _load_dll_libraries() │
│ 272 del load_dll_libraries │
│ │
│ C:\automatic\venv\lib\site-packages\torch_init
.py:267 in _load_dll_libraries │
│ │
│ 266 ) │
│ ❱ 267 raise err │
│ 268 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
OSError: [WinError 126] The specified module could not be found. Error loading "C:\automatic\venv\lib\site-packages\torch\lib\c10_xpu.dll" or one of its dependencies.
Press any key to continue . . .

Version Platform Description

app=sd.next updated=2024-11-01, Windows 11 Pro, Chrome

Relevant log output

2024-11-02 07:37:45,605 | sd | INFO | launch | Starting SD.Next
2024-11-02 07:37:45,608 | sd | INFO | installer | Logger: file="C:\automatic\sdnext.log" level=DEBUG size=65 mode=create
2024-11-02 07:37:45,610 | sd | INFO | installer | Python: version=3.10.11 platform=Windows bin="C:\automatic\venv\Scripts\python.exe" venv="C:\automatic\venv"
2024-11-02 07:37:45,778 | sd | INFO | installer | Version: app=sd.next updated=2024-11-01 hash=b48222cd branch=master url=https://github.com/vladmandic/automatic/tree/master ui=main
2024-11-02 07:37:46,327 | sd | INFO | launch | Platform: arch=AMD64 cpu=Intel64 Family 6 Model 165 Stepping 5, GenuineIntel system=Windows release=Windows-10-10.0.26100-SP0 python=3.10.11
2024-11-02 07:37:46,328 | sd | INFO | launch | Args: ['--debug', '--use-ipex']
2024-11-02 07:37:46,330 | sd | DEBUG | installer | Setting environment tuning
2024-11-02 07:37:46,330 | sd | DEBUG | installer | Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
2024-11-02 07:37:46,336 | sd | DEBUG | installer | Torch overrides: cuda=False rocm=False ipex=True directml=False openvino=False zluda=False
2024-11-02 07:37:46,337 | sd | INFO | installer | Python: version=3.10.11 platform=Windows bin="C:\automatic\venv\Scripts\python.exe" venv="C:\automatic\venv"
2024-11-02 07:37:46,340 | sd | INFO | installer | IPEX: Intel OneAPI toolkit detected
2024-11-02 07:37:46,341 | sd | DEBUG | installer | Diffusers upgrade: package=diffusers 0.32.0.dev0 current= target=0d1d267b12e47b40b0e8f265339c76e0f45f8c49
2024-11-02 07:38:36,992 | sd | INFO | installer | Verifying requirements
2024-11-02 07:38:36,997 | sd | INFO | installer | Verifying packages
2024-11-02 07:38:37,037 | sd | DEBUG | installer | Timestamp repository update time: Fri Nov  1 11:17:09 2024
2024-11-02 07:38:37,038 | sd | INFO | launch | Startup: standard
2024-11-02 07:38:37,040 | sd | INFO | installer | Verifying submodules
2024-11-02 07:44:47,259 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-extension-chainner / main
2024-11-02 07:44:47,403 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/sd-extension-system-info" reattach=main
2024-11-02 07:44:47,404 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-extension-system-info / main
2024-11-02 07:44:47,519 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/sd-webui-agent-scheduler" reattach=main
2024-11-02 07:44:47,519 | sd | DEBUG | installer | Git submodule: extensions-builtin/sd-webui-agent-scheduler / main
2024-11-02 07:44:47,661 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/sdnext-modernui" reattach=main
2024-11-02 07:44:47,662 | sd | DEBUG | installer | Git submodule: extensions-builtin/sdnext-modernui / main
2024-11-02 07:44:47,798 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/stable-diffusion-webui-rembg" reattach=master
2024-11-02 07:44:47,799 | sd | DEBUG | installer | Git submodule: extensions-builtin/stable-diffusion-webui-rembg / master
2024-11-02 07:44:47,918 | sd | DEBUG | installer | Git detached head detected: folder="modules/k-diffusion" reattach=master
2024-11-02 07:44:47,919 | sd | DEBUG | installer | Git submodule: modules/k-diffusion / master
2024-11-02 07:44:48,033 | sd | DEBUG | installer | Git detached head detected: folder="wiki" reattach=master
2024-11-02 07:44:48,034 | sd | DEBUG | installer | Git submodule: wiki / master
2024-11-02 07:44:48,087 | sd | DEBUG | paths | Register paths
2024-11-02 07:44:48,185 | sd | DEBUG | installer | Installed packages: 181
2024-11-02 07:44:48,187 | sd | DEBUG | installer | Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
2024-11-02 07:44:48,454 | sd | DEBUG | installer | Extension installer: C:\automatic\extensions-builtin\sd-webui-agent-scheduler\install.py
2024-11-02 07:44:56,644 | sd | INFO | installer | Extension installed packages: sd-webui-agent-scheduler ['SQLAlchemy==2.0.36', 'greenlet==3.1.1']
2024-11-02 07:44:56,713 | sd | DEBUG | installer | Extension installer: C:\automatic\extensions-builtin\stable-diffusion-webui-rembg\install.py
2024-11-02 07:45:30,692 | sd | INFO | installer | Extension installed packages: stable-diffusion-webui-rembg ['PyMatting==1.1.12', 'opencv-python-headless==4.10.0.84', 'pooch==1.8.2', 'rembg==2.0.59']
2024-11-02 07:45:30,694 | sd | DEBUG | installer | Extensions all: []
2024-11-02 07:45:30,695 | sd | INFO | installer | Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
2024-11-02 07:45:30,696 | sd | INFO | installer | Verifying requirements
2024-11-02 07:45:30,697 | sd | DEBUG | launch | Setup complete without errors: 1730551531
2024-11-02 07:45:30,708 | sd | DEBUG | installer | Extension preload: {'extensions-builtin': 0.01, 'extensions': 0.0}
2024-11-02 07:45:30,709 | sd | INFO | launch | Command line args: ['--debug', '--use-ipex'] use_ipex=True debug=True
2024-11-02 07:45:30,710 | sd | DEBUG | launch | Env flags: []
2024-11-02 07:45:30,712 | sd | DEBUG | launch | Starting module: <module 'webui' from 'C:\\automatic\\webui.py'>

Backend

Diffusers

UI

Standard

Branch

Master

Model

StableDiffusion 1.5

Acknowledgements

  • I have read the above and searched for existing issues
  • I confirm that this is classified correctly and its not an extension issue
@vladmandic vladmandic changed the title [Issue]: Error loading c10_xpu.dll [Issue]: IPEX Error loading c10_xpu.dll Nov 2, 2024
@vladmandic vladmandic added the platform Platform specific problem label Nov 2, 2024
@Disty0
Copy link
Collaborator

Disty0 commented Nov 2, 2024

Install OneAPI and run these in CMD, then start the webui within that CMD window.

"C:\Program Files (x86)\Intel\oneAPI\pytorch-gpu-dev-0.5\oneapi-vars.bat"
"C:\Program Files (x86)\Intel\oneAPI\ocloc\2024.2\env\vars.bat" 

Then;

.\webui.bat --use-ipex

@CraterCrater
Copy link
Author

That did the trick, awesome! Thanks!

@AndrewRainfall
Copy link

AndrewRainfall commented Nov 2, 2024

@Disty0 I don't have "pytorch-gpu-dev-0.5\oneapi-vars.bat" and "ocloc\2024.2\env\vars.bat" files.

Installed OneApi from here:
https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html

image
image


Upd: I guess I can use those instead

"C:\Program Files (x86)\Intel\oneAPI\2025.0\oneapi-vars.bat"
"C:\Program Files (x86)\Intel\oneAPI\ocloc\2025.0\env\vars.bat"

But the second command does nothing for some reason & the C10_xpu.dll problem still there.

image


Upd 2:
So I found the solution - OneApi for some reason didn't see my VS2022.

I went Settings - System - About - Advanced System Settings - Environment Variables - System Variables - New if doesn't exist or Edit if it is wrong to "VS2022INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" enter your path in "" - ok - ok - ok

After that I CMD
D:\Intel\oneAPI\2024.2\oneapi-vars.bat
D:\Intel\oneAPI\ocloc\2024.2\env\vars.bat
.\webui.bat --use-ipex --upgrade --debug --autolaunch

and it finally works

Are where any way to automate this to one shortcut like it was before?
Also it feels like "D:\Intel\oneAPI\ocloc\2024.2\env\vars.bat" does nothing as SD launches without it too.

@Disty0
Copy link
Collaborator

Disty0 commented Nov 2, 2024

D:\Intel\oneAPI\2024.2\oneapi-vars.bat is equivalent to the commands i sent and will activate the rest by itself.

You can create a new bat file to add it to the bat file.
This will be an extra step until Intel finally decides to not make it an unnecessary extra step.

More info about why this is a thing now: #3543 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Platform specific problem
Projects
None yet
Development

No branches or pull requests

4 participants