intel / intel-extension-for-pytorch

A Python package for extending the official PyTorch that can easily obtain performance on Intel platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined Symbols with oneAPI 2024.0.0

BenBrock opened this issue · comments

Describe the issue

I'm getting an undefined symbol issue when trying to load IPEX with oneAPI 2024.0. Is this a known issue?

(venv) (base) [bbrock@pcl-pvc01 pytorch-pvc]$ 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())];"
/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: 'libjpeg.so.8: cannot open shared object file: No such file or directory'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(
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/intel_extension_for_pytorch/__init__.py", line 94, in <module>
    from .utils._proxy_module import *
  File "/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/intel_extension_for_pytorch/utils/_proxy_module.py", line 2, in <module>
    import intel_extension_for_pytorch._C
ImportError: /data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/intel_extension_for_pytorch/lib/libintel-ext-pt-gpu.so: undefined symbol: _ZNK4sycl3_V16detail16AccessorBaseHost25isMemoryObjectUsedByGraphEv

Hi @BenBrock , could you share the specific version of IPEX you are using?
this seems to be a version mismatch issue for oneapi /ipex/driver.

Hi @ZhaoqiongZ, it looks like I was using 2.1.20+xpu, which I now see requires the more recent oneAPI 2024.1.0.

Switching to 2.1.10+xpu, which the page says supports 2024.0.0, I now get a different error:

(venv) (base) [bbrock@pcl-pvc01 pytorch-pvc]$ !pyth
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())];"
/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/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(
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/intel_extension_for_pytorch/__init__.py", line 94, in <module>
    from .utils._proxy_module import *
  File "/data/nfs_home/bbrock/src/pytorch-pvc/venv/lib/python3.11/site-packages/intel_extension_for_pytorch/utils/_proxy_module.py", line 2, in <module>
    import intel_extension_for_pytorch._C
ImportError: /data/nfs_home/bbrock/.miniconda3/bin/../lib/libmkl_intel_thread.so.2: undefined symbol: mkl_graph_mxm_gus_phase2_plus_second_fp32_def_i64_i32_fp32

I'm using 2024.0.0, so I believe it should work:

(venv) (base) [bbrock@pcl-pvc01 pytorch-pvc]$ icpx --version
Intel(R) oneAPI DPC++/C++ Compiler 2024.0.0 (2024.0.0.20231017)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/swtools/intel/compiler/2024.0/bin/compiler
Configuration file: /data/swtools/intel/compiler/2024.0/bin/compiler/../icpx.cfg

I have both sourced icpx as normal and sourced ${MKLROOT}/env/vars.sh. I can see MKL in my LD_LIBRARY_PATH (LD_LIBRARY_PATH=/data/swtools/intel/mkl/2024.0/lib...), so I'm not sure what's causing the issue.

Hi @BenBrock ,what is your driver version and how did you install the oneAPI 2024.0 ?
normally the compiler and mkl should be activated with path /installation_root/intel/oneapi/compiler/2024.0/env/vars.sh and /installation_root/intel/oneapi/mkl/2024.0/env/vars.sh

I just installed a new copy of oneAPI on the machine and it seems to be working now. Not sure what was up with the system version.

I'll close this issue now.