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

intel-aikit-tensorflow cause undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

ChenHaifeng
Employee
5,118 Views

I have a python=3.9 conda environment and installed with paramiko==2.12.0

And then when after I installed intel-aikit-tensorflow==2023.1.0.

the paramiko functionality was broken by the intel installation of cffi==1.15.1. When import paramiko, it raise an error:

ImportError: /home/cloudtik/anaconda3/envs/cloudtik/lib/python3.9/site-packages/_cffi_backend.cpython-39-x86_64-linux-gnu.so: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

 

The reproduce step is simple:

1. create a python 3.9 environment with paramiko==2.12.0

2. Test import paramiko is working: execute python and import paramiko module (success)

3. Install intel-aikit-tensorflow: conda install -c intel intel-aikit-tensorflow==2023.1.0

4. Test import paramiko is broken: execute python and import paramiko module (will)

 

The problem is intel-aikit-tensorflow replaced cffi==1.15.1 in the existing environment with its build intel/cffi==1.15.1 and this build cause problem on the symbol.

If I use pip to remove intel version and pip install cffi from pypi, paramiko goes fine. But I am not sure whether it will break intel-aikit-tensorflow.

 

Any ideas?

0 Kudos
1 Solution
JyothisV_Intel
Moderator
5,014 Views

Hi,

 

Good day to you.

 

Thanks for getting back to you with the exact steps that you followed.

 

We were able to replicate the error from our side:

 

(the_actual_test_env) user@ubuntu:~$ python
Python 3.9.16 (main, Jan 11 2023, 16:05:54)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/__init__.py", line 22, in <module>
  from paramiko.transport import SecurityOptions, Transport

 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/transport.py", line 92, in <module>
  from paramiko.ed25519key import Ed25519Key
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/ed25519key.py", line 22, in <module>
  import nacl.signing
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/signing.py", line 16, in <module>
  import nacl.bindings
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/bindings/__init__.py", line 16, in <module>
  from nacl.bindings.crypto_aead import (
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/bindings/crypto_aead.py", line 17, in <module>
  from nacl._sodium import ffi, lib
ImportError: /home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/_cffi_backend.cpython-39-x86_64-linux-gnu.so: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

 

 

 

It is not advised to mix and match conda and pip installers while installing packages. Do it only if specific packages are not available in either of those repositories. Intel AI Kit uses conda as its default package manager for installing packages. Since you are using conda to install Intel AI Kit, kindly use conda to install paramiko too.

 

Alternatively, to get rid of the above error, doing a force re-install of paramiko package after installing Intel AI kit using the below command solves the issue:

 

pip install --force-reinstall paramiko

 

 

(All install and test outputs are attached along for reference.)

 

Hope this is helpful. If this helps resolve your issue, kindly mark this as a solution as it might help others with a similar issue. If you still facing any issues with Intel products or services, do get back to us.

 

Thanks and Regards,

Jyothis V James

 

 

View solution in original post

0 Kudos
8 Replies
JyothisV_Intel
Moderator
5,045 Views

Hi,

 

Good day to you.

 

Thanks for posting in Intel Communities.

 

We tried replicating the issue from our side on an Ubuntu 22.04 LTS system running on Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz system and was not able to observe the error that you got. We used a Miniconda based Python Conda environment using the commands below:

 

 

# Creating conda environment test_env with Python=3.9
conda create --name test_env python=3.9

# Activating the new test_env environment
conda activate test_env

# Installing paramiko packaage from conda-forge
conda install -c conda-forge paramiko

# Installing Intel AI Kit Tensorflow package
conda install -c intel intel-aikit-tensorflow

 

 

 

Kindly see the log of the install attached along with this email. The paramiko package is installed in the new environment and works fine on importing.

 

 

 

(test_env) user@ubuntu:~$ conda list | grep paramiko
paramiko         3.0.0       pyhd8ed1ab_0  conda-forge

(test_env) user@ubuntu:~$ python
Python 3.9.16 (main, Jan 11 2023, 16:05:54)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
>>> print(paramiko.__version__)
3.0.0

 

 

 

Can you recheck and confirm if the above steps are working for you. Is installing the specified version a requirement? We can confirm it works fine with the latest version of both the AI kit and Paramiko. If not, do get back to us with the exact commands that you used to create the environment. Additionally, kindly include the OS and hardware details of the system where you are facing this issue.

 

Hope this helps.

 

Thanks and Regards,

Jyothis V James

 

0 Kudos
ChenHaifeng
Employee
5,024 Views

Hi James,

Thank you for your response.

Here is the exact command to reproduce the problem:

 

conda create --name test_env python=3.9

conda activate test_env

pip install paramiko

conda install -c intel intel-aikit-tensorflow

 

The only difference between your steps is the way of installing paramiko (step #3). I used pip which installed paramiko 3.0.0 too.

I could reproduce the problem using the above steps. My system is Ubuntu 20.04 and I think it is not likely to be related to OS and hardware.

 

Thanks,

Haifeng

 

0 Kudos
ChenHaifeng
Employee
4,989 Views

 [Reply to the wrong replace but I didn't find a delete button]

0 Kudos
JyothisV_Intel
Moderator
5,015 Views

Hi,

 

Good day to you.

 

Thanks for getting back to you with the exact steps that you followed.

 

We were able to replicate the error from our side:

 

(the_actual_test_env) user@ubuntu:~$ python
Python 3.9.16 (main, Jan 11 2023, 16:05:54)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/__init__.py", line 22, in <module>
  from paramiko.transport import SecurityOptions, Transport

 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/transport.py", line 92, in <module>
  from paramiko.ed25519key import Ed25519Key
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/paramiko/ed25519key.py", line 22, in <module>
  import nacl.signing
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/signing.py", line 16, in <module>
  import nacl.bindings
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/bindings/__init__.py", line 16, in <module>
  from nacl.bindings.crypto_aead import (
 File "/home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/nacl/bindings/crypto_aead.py", line 17, in <module>
  from nacl._sodium import ffi, lib
ImportError: /home/user/miniconda3/envs/the_actual_test_env/lib/python3.9/site-packages/_cffi_backend.cpython-39-x86_64-linux-gnu.so: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

 

 

 

It is not advised to mix and match conda and pip installers while installing packages. Do it only if specific packages are not available in either of those repositories. Intel AI Kit uses conda as its default package manager for installing packages. Since you are using conda to install Intel AI Kit, kindly use conda to install paramiko too.

 

Alternatively, to get rid of the above error, doing a force re-install of paramiko package after installing Intel AI kit using the below command solves the issue:

 

pip install --force-reinstall paramiko

 

 

(All install and test outputs are attached along for reference.)

 

Hope this is helpful. If this helps resolve your issue, kindly mark this as a solution as it might help others with a similar issue. If you still facing any issues with Intel products or services, do get back to us.

 

Thanks and Regards,

Jyothis V James

 

 

0 Kudos
ChenHaifeng
Employee
4,988 Views

Thanks James for the information!

 

Although conda is used here, but most of python environment were building up with pip. Usually this is also the case for many users or developers.

We would prefer pip install and use conda install only for the case we have to. 

 

I saw there is intel-tensorflow package in the pip but we found the installation from pip install intel-tensorlow is quite different than it gets by conda install -c intel intel-aikit-tensorflow (the latter installed a lot of intelxxx packages which is not appear in pip install of intel-tensorflow)

 

If we can install intel-tensorflow from pip to get the best of everything and if it is not break anything, that would be OK. And we can use pip install intel-tensorflow.

 

So the question is the result of "pip install intel-tensorflow"  is a lot different than the result of "conda install -c intel intel-aikit-tensorflow"? 

Are the additional intelxxx libraries are installed by "conda install -c intel intel-aikit-tensorflow" already configured by default to be used in the tensorflow for this installation or there need other configurations? These are not clear.

 

Thanks,

Haifeng

0 Kudos
JyothisV_Intel
Moderator
4,902 Views

Hi,

 

Good day to you.

 

Thanks for getting back to us.

 

>> So the question is the result of "pip install intel-tensorflow" is a lot different than the result of "conda install -c intel intel-aikit-tensorflow"?

Intel Tensorflow and Intel AI Kit for Tensorflow are two different frameworks.

 

 

Intel Tensorflow or Intel Tensorflow Extension (ITEX) or Intel Extension for Tensorflow is a Tensorflow library that takes full advantage of Intel® architecture to extract maximum performance. The Tensorflow framework has been optimized using oneAPI Deep Neural Network Library (oneDNN) primitives, a popular performance library for deep learning applications. 

 

There are two ways we can install Intel Tensorflow based on the package manager used:

PIP:

pip install intel-tensorflow

 

Conda (any one):

conda install tensorflow -c intel 
conda install tensorflow

 

Note: Anaconda has now made it convenient for the AI community to enable high-performance-computing in TensorFlow. Starting from TensorFlow v1.9, Anaconda has and will continue to build TensorFlow using oneDNN primitives to deliver maximum performance in your CPU. Therefore, Tensorflow installed via Conda package maanger is Intel optimized Tensorflow.

 

Refer: https://www.intel.com/content/www/us/en/developer/articles/guide/optimization-for-tensorflow-installation-guide.html



Intel Tensorflow while importing displays a special message to signify that Intel Tensorflow is being used as given below:

>>> import tensorflow
... I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: ...

 

 

Intel AI Analytics Toolkit (AIKit) is a collection of optimized frameworks that are designed to use the full power of Intel architecture and yield high performance for training and inference. Based on the use case, Intel AI Kit can be installed for three different use cases which includes Intel optimized frameworks with extensions for use-case specific libraries. Theses are:

Tensorflow: intel-aikit-tensorflow for deep learning workflows using Intel® Optimization for TensorFlow.

PyTorch: intel-aikit-pytorch for deep learning workflows using Intel® Optimization for PyTorch.

Modin: intel-aikit-modin for data analytics and machine learning workflows using Intel® Distribution of Modin (for accelerated Panda data frames)

 

These can only be installed using the below command:

conda install -c intel intel-aikit-tensorflow
conda install -c intel intel-aikit-pytorch
conda install -c intel intel-aikit-modin

 

Refer: https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/install-intel-ai-analytics-toolkit-via-conda.html

 

 

Hope this is helpful. If this helps resolve your issue, kindly mark this as a solution as it might help others with a similar issue. If you still facing any issues with Intel products or services, do get back to us.

 

Thanks and Regards,

Jyothis V James

 

0 Kudos
JyothisV_Intel
Moderator
4,877 Views

Hi,


Good day to you.


We can see that you have accepted one of our replies as solution. Is your issue resolved. If yes, do let us know so that we can close this thread and stop monitoring it.


Thanks and Regards,

Jyothis V James


0 Kudos
JyothisV_Intel
Moderator
4,763 Views

Hi,


Good day to you.


Since, you have accepted one of our solution as answer and there has been no response or confirmation, we will be closing this thread as resolved and will stop monitoring the same.


If you need any assistance while using Intel products or services, please post a new question.


Thanks and Regards,

Jyothis V James


0 Kudos
Reply