intel-extension-for-pytorch icon indicating copy to clipboard operation
intel-extension-for-pytorch copied to clipboard

Import intel_extension_for_pytorch fails on windows11

Open rairatne opened this issue 1 year ago • 17 comments

Describe the bug

HW used: ADL i7 (12700H)/ARC770

OS Name Microsoft Windows 11 Pro: Version 10.0.22621 Build 22621 ARC Driver: 31.0.101.4972 / 31.0.101.4953 {Tried with both drivers}

Pre-requisites: miconda3(latest) Python: 3.9 oneAPI: 2024.0 {as no download link available for 2023.2 anymore}

Steps to reproduce: conda create --name llmenv python=3.9 conda activate llm call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" -> DPCPPROOT call "C:\Program Files (x86)\Intel\oneAPI\compiler\mkl\env\vars.bat" -> MKLROOT

conda install pkg-config libuv python -m pip install torch==2.0.0a0 intel-extension-for-pytorch==2.0.110+gitba7f6c1 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/

#sanity test python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.version); print(ipex.version); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"

This throws Error:

Traceback (most recent call last): File "", line 1, in File "C:\Users\intel\miniconda3\envs\llm\lib\site-packages\intel_extension_for_pytorch_init_.py", line 89, in raise err OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\intel\miniconda3\envs\llm\lib\site-packages\intel_extension_for_pytorch\bin\intel-ext-pt-gpu.dll" or one of its dependencies. image

Versions

PyTorch version: 2.0.0a0+gitc6a572f PyTorch CXX11 ABI: No IPEX version: N/A IPEX commit: N/A Build type: N/A

OS: Microsoft Windows 11 Pro GCC version: N/A Clang version: 16.0.5 IGC version: 2024.0.0 (2024.0.0.20231017) CMake version: version 3.27.7 Libc version: N/A

Python version: 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)] (64-bit runtime) Python platform: Windows-10-10.0.22621-SP0 Is XPU available: N/A DPCPP runtime version: N/A MKL version: N/A GPU models and configuration: N/A Intel OpenCL ICD version: N/A Level Zero version: N/A

CPU: Architecture=9 CurrentClockSpeed=2300 DeviceID=CPU0 Family=198 L2CacheSize=11776 L2CacheSpeed= Manufacturer=GenuineIntel MaxClockSpeed=2300 Name=12th Gen Intel(R) Core(TM) i7-12700H ProcessorType=3 Revision=

Versions of relevant libraries: [pip3] intel-extension-for-pytorch==2.0.110+gitba7f6c1 [pip3] numpy==1.26.2 [pip3] torch==2.0.0a0+gitc6a572f [conda] intel-extension-for-pytorch 2.0.110+gitba7f6c1 pypi_0 pypi [conda] mkl-include 2024.0.0 pypi_0 pypi [conda] mkl-static 2024.0.0 pypi_0 pypi [conda] numpy 1.26.2 pypi_0 pypi [conda] torch 2.0.0a0+gitc6a572f pypi_0 pypi

rairatne avatar Nov 23 '23 12:11 rairatne

Is this a root cause #449 ? when are we planning to host a new python whl for ipex on Windows based on latest one API and GPU driver?

rairatne avatar Nov 23 '23 13:11 rairatne

I'm also waiting for this.

JeroenAdam avatar Nov 23 '23 23:11 JeroenAdam

Also waiting for this (Windows 10). It would be of great benefit to the open source community as a whole

hanikhatib avatar Nov 28 '23 06:11 hanikhatib

@min-jean-cho @ashokei

jingxu10 avatar Nov 28 '23 23:11 jingxu10

Intel, this is shame. Just bought ARC A770 and wanted to play with PyTorch. oneAPI 2024 breaks your official PyTorch package. I can live with that, but for whatever insane reason, official way to download older oneAPI package is to pay for support. Are you kidding?

So, current (as of today) Intel's PyTorch build 2.0.0a works with oneAPI 2023.2 only. Link to download that installer you may still find in oneAPI official repository: https://github.com/oneapi-src/oneapi-ci/commit/cf8ed233e0c32b0f31ed09bc587b281e99e1df12#diff-407ded4161c16de89574d5450eea4c1e6d89390b0363974918115723f093a735 - I was able to use online installer today.

For torchvision - download 0.15.1 wheel from PyPI, modify manually manifest (this is actually zip file) to be dependent on torch-2.0.0a instead of 2.0.0.

You're welcome, Intel.

kred avatar Nov 30 '23 09:11 kred

Maybe hopeful? This intel extension was just released for torch 2.2.0 https://github.com/intel/intel-extension-for-pytorch/releases

ebeshero avatar Feb 18 '24 19:02 ebeshero

Maybe hopeful? This intel extension was just released for torch 2.2.0 https://github.com/intel/intel-extension-for-pytorch/releases

@ebeshero It was released for CPU so far.

kred avatar Feb 18 '24 20:02 kred

Yeah, I was sad it was missing xpu. And I am having endless trouble installing the old one properly.

ebeshero avatar Feb 19 '24 02:02 ebeshero

Anything new from this ? I have the same issue and haven't been able to find a solution...

ccomee avatar Mar 19 '24 16:03 ccomee

Could you refer to here https://github.com/intel/intel-extension-for-pytorch/issues/560 I will try to reproduce in my side.

feng-intel avatar Mar 22 '24 01:03 feng-intel

Also, please use "developer command prompt for vs 2022" or "anaconda prompt", instead of "powershell prompt".

ZailiWang avatar Mar 22 '24 02:03 ZailiWang

Hi @ccomee ,

For your reference:

If I follow the original steps of [rairatne]

Pre-requisites:
miconda3(latest)
Python: 3.9
oneAPI: 2024.0 {as no download link available for 2023.2 anymore}

Steps to reproduce:
conda create --name llmenv python=3.9
conda activate llm
call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" -> DPCPPROOT
call "C:\Program Files (x86)\Intel\oneAPI\compiler\mkl\env\vars.bat" -> MKLROOT

conda install pkg-config libuv
python -m pip install torch==2.0.0a0 intel-extension-for-pytorch==2.0.110+gitba7f6c1 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/

#sanity test
`python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.version); print(ipex.version); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"`

I'm able to reproduce the original problem. 
<<python -c "import torch; import torchvision; import torchaudio; import intel_extension_for_pytorch as ipex; print(f'torch_version:       {torch.__version__}'); print(f'torchvision_version: {torchvision.__version__}'); print(f'torchaudio_version:  {torchaudio.__version__}'); print(f'ipex_version:        {ipex.__version__}');"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\miniconda3\envs\ipex_huiyan\lib\site-packages\intel_extension_for_pytorch\__init__.py", line 90, in <module>
    raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\ProgramData\miniconda3\envs\ipex_huiyan\lib\site-packages\intel_extension_for_pytorch\bin\intel-ext-pt-python.dll" or one of its dependencies.       >>

But in the same conda environment, if I follow the steps in official doc: https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu&version=v2.1.10%2Bxpu.

python -m pip install torch==2.1.0a0 torchvision==0.16.0a0 torchaudio==2.1.0a0 intel-extension-for-pytorch==2.1.10 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/

**then everything is fine. So, I guess the original problem is caused by missing torchvision and audio dependency dll.

could you please try the install command again and let us know if it works?**

supposed you have oneAPI 2024.0 installed, MSVC 2022, or MSVC runtime dll installed. open one anaconda prompt (instead of PowerShell prompt or other developer command prompt for vs 2022)

  
  conda create --name llmenv python=3.9
  conda activate llm
  call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" 
  call "C:\Program Files (x86)\Intel\oneAPI\compiler\mkl\env\vars.bat" 

   conda install pkg-config libuv
   **python -m pip install torch==2.1.0a0 torchvision==0.16.0a0 torchaudio==2.1.0a0 intel-extension-for-pytorch==2.1.10 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/**
   
   python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.version); print(ipex.version); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"

The output is like <module 'torch.version' from 'C:\ProgramData\miniconda3\envs\ipex_huiyan\lib\site-packages\torch\version.py'> <function version at 0x000001B15174BAF0> [0]: _DeviceProperties(name='Intel(R) Arc(TM) Graphics', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=7133MB, max_compute_units=112, gpu_eu_count=112)

yinghu5 avatar Mar 22 '24 11:03 yinghu5

Hello @yinghu5 ;

Thank you for this response. I have been trying to make this work for weeks and couldn't figure it out. I tried the step you gave but I still had the same issue. I ended up creating another environment and redoing the whole process, and now it worked !

I don't know what I did wrong for the first environment but now everything is in order

ccomee avatar Mar 22 '24 15:03 ccomee

So the final solution is to re-install the steps in a new environment? But I tried it and still got the same problem.

SoldierWz avatar Mar 23 '24 05:03 SoldierWz

There is also a question about the test command in the official tutorial: call {DPCPPROOT}\env\vars.bat call {MKLROOT}\env\vars.bat I tried but the output:System can not find the route.

SoldierWz avatar Mar 23 '24 06:03 SoldierWz

@SoldierWz Could you start a new issue? And give more details about steps, env, and the problem? Thanks.

This issue is closed.

feng-intel avatar Apr 15 '24 06:04 feng-intel

Sorry, I may not be using Intel graphics cards for work in the near future. If I still encounter such a problem when I use it again, I will restart with a new problem. grateful.

王震 @.***

Original: From:feng-intel @.>Date:2024-04-15 14:51:48(中国 (GMT+08:00))To:intel/intel-extension-for-pytorch @.>Cc:SoldierWz @.> , Mention @.>Subject:Re: [intel/intel-extension-for-pytorch] Import intel_extension_for_pytorch fails on windows11 (Issue #473) @SoldierWz Could you start a new issue? And give more details about steps, env, and the problem? Thanks. This issue is closed. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

SoldierWz avatar Apr 15 '24 09:04 SoldierWz