AI Tools from Intel
Find answers to your toolkit installation, configuration, and get-started questions.
87 Discussions

oneAPI Devcloud undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

MohammedSaif
Employee
2,710 Views

Hi team,

 

I am currently trying to implement https://github.com/oneapi-src/visual-quality-inspection in jupyter lab environment in Intel Devcloud. Running all the commands written in the guide on a terminal session inside the jupyter lab env. I was able to run inference on stock PyTorch. However, when i activate aikit-pt and run the inference command, i get the following error:

 

(aikit-pt) u118819@s001-n044:~/myprojects/visual-quality-inspection/src$ python pytorch_evaluation.py -d ../data -m ./pill_intel_model.h5 -b 1 -i 1
Dataset path Found!!
Train and Test Data folders Found!
Traceback (most recent call last):
File "/home/u118819/myprojects/visual-quality-inspection/src/pytorch_evaluation.py", line 75, in <module>
import intel_pytorch_extension as ipex
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/__init__.py", line 7, in <module>
from .optim import *
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/__init__.py", line 1, in <module>
from .split_sgd import is_available
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/split_sgd.py", line 3, in <module>
import _torch_ipex
ImportError: /home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/lib/libtorch_ccl.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

 

 

 

Labels (1)
0 Kudos
1 Solution
VaradJ_Intel
Moderator
2,554 Views

Hi,

 

Good day to you.

 

Please can you try the following workaround:

 

1. Remove the current aikit-pt environment

 

2. Go to visual-quality-inspection/env/intel/aikit-pt.yml. In this file just change 'intel-aikit-pytorch=2022.0.0' to 'intel-aikit-pytorch' and save the changes.

 

3. Now go to visual-quality-inspection/src/pytorch_evaluation.py. On line number 75 replace 'intel_pytorch_extension' with 'intel_extension_for_pytorch'

 

4. Also on line 76 of pytorch_evaluation.py replace 'device=ipex.DEVICE' with 'device="cpu"' and now save the changes in pytorch_evaluation.py file.

 

5. Now install the aikit-pt environment and try running the example.

 

Please let us know if you still face the issues.

 

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issues. 

 

Thank You!

 

View solution in original post

0 Kudos
8 Replies
VaradJ_Intel
Moderator
2,673 Views

Hi,

 

Good day to you.

 

Thanks for posting in Intel Communities.

 

I followed the same GitHub link which you shared but it worked for me.

 

Please can you remove the aikit-pt environment and try creating it again?

 

-You can remove the aikit-pt environment in the following way:

1. conda deactivate
2. conda env remove -n aikit-pt 

 

-To create the aikit-pt environment just run the following command:

1. conda env create -f env/intel/aikit-pt.yml

Also, after creating the aikit-pt environment check if the Intel Extension of Pytorch is rightly installed and also check its version.

 

-You can check it in the following way:

1. conda activate aikit-pt
2. python
3. import intel_pytorch_extension as ipex
4. print(ipex.__version__)

Do let us know if you face any issues. Also please do share the screenshots if you get an error while performing the above steps.

 

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issues. 

 

Thank You!

0 Kudos
MohammedSaif
Employee
2,658 Views

Hi Varad,

 

Thank for the detailed reply.

 

Unfortunately, the error has not been fixed. After removing aikit env and creating a new aikit rnv, i get the following error in the Python console:

 

(aikit-pt) u118819@s001-n014:~/myprojects/visual-quality-inspection/src$ python
Python 3.9.7 (default, Oct 27 2021, 01:23:21)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import intel_pytorch_extension as ipex
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/__init__.py", line 7, in <module>
from .optim import *
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/__init__.py", line 1, in <module>
from .split_sgd import is_available
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/split_sgd.py", line 3, in <module>
import _torch_ipex
ImportError: /home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/lib/libtorch_ccl.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

0 Kudos
MohammedSaif
Employee
2,635 Views

Can i please get some help on this at the earliest? I have a demo to give in the coming week and would like to get this up and runnings before it

0 Kudos
JyothisV_Intel
Moderator
2,625 Views

Hi,

 

Good day to you.

 

Sorry for the delay and inconvenience caused.

 

We believe that there is an issue with your conda environment. Can you try backing up your local conda environment folder by running the below command:

 

mv ~/.conda ~/.conda_bk

 

 

Now try creating the environment using the command mentioned below from inside the visual-quality-inspection directory:

 

conda clean --packages -y
conda env create -f env/intel/aikit-pt.yml

 

 

Then, test loading IPEX as given below:

 

source /opt/intel/oneapi/setvars.sh --force
conda activate aikit-pt
python
import intel_pytorch_extension as ipex
print(ipex.__version__)

 

 

Do let us know if you are still facing any issues.

 

Thanks and Regards

Jyothis V James

 

0 Kudos
MohammedSaif
Employee
2,598 Views

Hi Jyothis,

 

Thank you for the reply. Unfortunately, those list of commands haven't solved the issue either. Error log attached.

 

Last few lines of the error being:
u118819@s001-n013:~/myprojects/visual-quality-inspection$ conda activate aikit-pt
(aikit-pt) u118819@s001-n013:~/myprojects/visual-quality-inspection$ python
Python 3.9.7 (default, Oct 27 2021, 01:23:21)
[GCC 9.3.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import intel_pytorch_extension as ipex
print(ipex.__version__)Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/__init__.py", line 7, in <module>
from .optim import *
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/__init__.py", line 1, in <module>
from .split_sgd import is_available
File "/home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/intel_pytorch_extension/optim/split_sgd.py", line 3, in <module>
import _torch_ipex
ImportError: /home/u118819/.conda/envs/aikit-pt/lib/python3.9/site-packages/lib/libtorch_ccl.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

0 Kudos
VaradJ_Intel
Moderator
2,555 Views

Hi,

 

Good day to you.

 

Please can you try the following workaround:

 

1. Remove the current aikit-pt environment

 

2. Go to visual-quality-inspection/env/intel/aikit-pt.yml. In this file just change 'intel-aikit-pytorch=2022.0.0' to 'intel-aikit-pytorch' and save the changes.

 

3. Now go to visual-quality-inspection/src/pytorch_evaluation.py. On line number 75 replace 'intel_pytorch_extension' with 'intel_extension_for_pytorch'

 

4. Also on line 76 of pytorch_evaluation.py replace 'device=ipex.DEVICE' with 'device="cpu"' and now save the changes in pytorch_evaluation.py file.

 

5. Now install the aikit-pt environment and try running the example.

 

Please let us know if you still face the issues.

 

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issues. 

 

Thank You!

 

0 Kudos
VaradJ_Intel
Moderator
2,496 Views

Hi,

 

Good day to you

 

Thanks for accepting our solution.

 

Since your issue is resolved please do let us know if we can closed this thread and https://community.intel.com/t5/Intel-DevCloud/oneAPI-Devcloud-undefined-symbol/m-p/1428927#M6532 thread, which is a duplicate thread of the current thread?

 

Also you qualify for priority support and you can open a support ticket in Online service center for direct 1:1 support.

 

Thank You!

 

0 Kudos
VaradJ_Intel
Moderator
2,440 Views

Hi,


Good day to you


If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thank You!


0 Kudos
Reply