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

ImportError: envs/pytorch-arc/lib/python3.11/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEventrge/envs/pytorch-arc/lib/python3.11/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent

SoldierWz opened this issue · comments

Describe the bug

After starting the system today, it seems that the oneAPI suite has been updated. Then I ran my code and an error like this appeared.

ImportError Traceback (most recent call last)
Cell In[1], line 8
6 import modin.pandas as pd
7 import numpy as np
----> 8 import torch
9 # import intel_extension_for_pytorch as ipex
10 import torch.nn as nn

File ~/mambaforge/envs/pytorch-arc/lib/python3.11/site-packages/torch/init.py:235
233 if USE_GLOBAL_DEPS:
234 _load_global_deps()
--> 235 from torch._C import * # noqa: F403
237 # Appease the type checker; ordinarily this binding is inserted by the
238 # torch._C module initialization code in C
239 if TYPE_CHECKING:

ImportError: /home/wangzhen/mambaforge/envs/pytorch-arc/lib/python3.11/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent

Versions

wget https://raw.githubusercontent.com/intel/intel-extension-for-pytorch/master/scripts/collect_env.py

For security purposes, please check the contents of collect_env.py before running it.

python collect_env.py

I did not now the whole story of about you and your environment.

Did you update oneAPI basekit? IPEX and oneAPI version should be matched.
I suggest you install oneAPI and IPEX with matched version.

I have the exact same issue on Ubuntu 23, it happens after i run 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())];" as a sanity check. Here is my env @xiguiw :

PyTorch version: N/A
PyTorch CXX11 ABI: N/A
IPEX version: N/A
IPEX commit: N/A
Build type: N/A

OS: Ubuntu 23.10 (x86_64)
GCC version: (Ubuntu 12.3.0-9ubuntu2) 12.3.0
Clang version: 16.0.6 (15)
IGC version: 2024.1.0 (2024.1.0.20240308)
CMake version: version 3.27.4
Libc version: glibc-2.38

Python version: 3.10.12 (main, Mar 10 2024, 18:08:53) [GCC 12.3.0] (64-bit runtime)
Python platform: Linux-6.5.0-25-generic-x86_64-with-glibc2.38
Is XPU available: N/A
DPCPP runtime version: 2024.1
MKL version: 2024.1
GPU models and configuration: 
N/A
Intel OpenCL ICD version: N/A
Level Zero version: N/A

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      39 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             8
On-line CPU(s) list:                0-7
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Core(TM) i3-14100F
CPU family:                         6
Model:                              191
Thread(s) per core:                 2
Core(s) per socket:                 4
Socket(s):                          1
Stepping:                           5
CPU(s) scaling MHz:                 96%
CPU max MHz:                        4700.0000
CPU min MHz:                        800.0000
BogoMIPS:                           6988.80
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          192 KiB (4 instances)
L1i cache:                          128 KiB (4 instances)
L2 cache:                           5 MiB (4 instances)
L3 cache:                           12 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-7
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced / Automatic IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==2.0.120+xpu
[pip3] numpy==1.26.4
[pip3] torch==2.0.1a0+cxx11.abi
[pip3] torchvision==0.15.2a0+cxx11.abi
[conda] N/A

@Shr1ftyy

I noted some mismatche version in you environment.

[pip3] intel-extension-for-pytorch==2.0.120+xpu
DPCPP runtime version: 2024.1
MKL version: 2024.1

For "intel-extension-for-pytorch==2.0.120+xpu", oneAPI 2024.0 is required
image

Pleae set up your environemt to follow the system requiremnt.
"install page"
Please double confirm the GPU driver and oneAPI Basekit version are matched with IPEX version.

@SoldierWz @Shr1ftyy

I would suggest this version:
intel-extension-for-pytorch 2.1.10 + oneAPI 2024.0

Please follow this system requirment.

Doesn't look IPEX related. I have the same issue, but don't use IPEX.

Downgrading to MKL 2024.0 works, so it seems MKL 2024.1 dropped an exported function. I don't know what Intel's policy is on binary backwards compatibility, but it definitely looks broken.

I learned at least to link to a specific MKL version and not "latest", so as to avoid issues like this in the future

Same error libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent encountered when import torch

I confirm that this issue happens when MKL 2024.1.0 is installed with pytorch (tried pytorch=2.2.*)

Don't use IPEX either

@jrversteegh @LiutongZhou
Thanks for investigating and confirming the problem.

Since it is MKL problem, we will close it.

Turns out I was indeed using the wrong version of MKL. Thanks.

hit the same error

as a fedora user, turns out I should install intel-basekit-2024.0.x86_64 instead of the latest version

@jrversteegh @LiutongZhou Thanks for investigating and confirming the problem.

Since it is MKL problem, we will close it.

@xiguiw Please do close it to prevent more "me too" comments. As far as IPEX is concerned, this issue has been solved.