Closed citratecycle closed 1 year ago
Windows support for IPEX is really experimental and doesn't really work for now.
Check this issue: https://github.com/intel/intel-extension-for-pytorch/issues/398
Actually not a purely upstream problem.
SD.Next tries to install the latest torchvision
(0.15.2), which requires torch == 2.0.1
, overriding the intel torch (2.0.0a0) because of incompatible version. Then intel_extension_for_pytorch
bails out because of wrong dll version from torch 2.0.1
.
I'll try to fix installer.py
for IPEX windows.
You can give this a try: https://github.com/vladmandic/automatic/discussions/2023
Hi, here is an amazing blog that I found to configure the intel-ipex to your pytorch on a windows: https://christianjmills.com/posts/intel-pytorch-extension-tutorial/native-windows/
Issue Description
Error
I deployed SD.Next on my Windows PC with the recently released oneAPI basekit for Windows. When I tried to start
webui.bat
with argument--use-ipex
, it reports an error when trying toimport intel_extension_for_pytorch as ipex
. The specific problem isOSError: [WinError 126] Error loading intel-ext-pt-gpu.dll
.Work Tried
I tried to fix it and after some search, it seems that error code 126 happens when the DLL file doesn't exist or some dependencies of the DLL file don't exist.
Firstly, I checked the report path
C:\Users\<my_usernmae>\Documents\SD_Local\automatic\venv\lib\site-packages\intel_extension_for_pytorch\bin\intel-ext-pt-gpu.dll
and I'm sure the file exists.Then, I used a dependency checker to check the dependencies of
intel-ext-pt-gpu.dll
. It shows that four dependencies are missing:torch_cpu.dll
,c10.dll
,mkl_core.2.dll
,mkl_sycl.3.dll
.After some search, the first two belongs to
torch
and the latter two belongs to oneAPI. So, I found the latter two underC:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64
and added this directory to thePATH
.For the first two, I think this is where SD.Next need to fix? Pytorch was installed in the venv so the intel extension cannot find dependencies? (I'm not familiar with Python venv so this is just my inference.)
I tried to add
automatic\venv\Lib\site-packages\torch\lib
toPATH
(which is extremely inelegant in my view) and the dependency checker can find all the dependencies ofintel-ext-pt-gpu.dll
now, but it reports a error/waning that "torch_cpu.dll has missing imports" (indicating
torch` version and intel extension version don't match?). Under such condition, SD.Next still reports 126 error.Conclusion
I'm not sure whether the loading DLL error is related to missing dependencies. However, I did find missing dependencies. If the problem is caused by missing dependencies, I think those related to oneAPI can easily be fixed by modifying
PATH
, while those related totorch
need some elegant solution. The problem persists after addingtorch
-related DLL files toPATH
and now I have no idea how to fix it.Version Platform Description
Other information that may be helpful:
Relevant log output
Acknowledgements