Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6704 Discussions

Most functions hang after migrate from 2018.3 to 2021.6

Nikolai_Tasev
Novice
1,466 Views

Hello

 

I have tried to migrate from 2018.3 to 2021.6 version on Linux but most of the functions do not return after called. ippInit(), ippGetCpuFeatures(), ippGetEnabledCpuFeatures() return but when I call for example ippiGetLibVersion() or ippCopy() they never return.

 

My test system is with OpenSuse Leap 15.2 and Intel(R) Core(TM) i7-4770 CPU. Using static versions of the libraries.

Anyone seen such behavior or have an idea what might be the cause?

 

Regards

Nikolai

0 Kudos
12 Replies
VidyalathaB_Intel
Moderator
1,441 Views

Hi Nikolai,


Thanks for reaching out to us.

>>when I call for example ippiGetLibVersion() or ippCopy() they never return

Could you please elaborate a bit more on the above statement?

As a quick check, I tested the GetLibVersion function and could not see the issue (hanging) that you are mentioning in your subject line. 

If you are facing any issues with the IPP API's, please provide us with a sample reproducer, steps to reproduce it, and what is the exact issue that you are facing (issues with results or any errors) so that it would help us to address your issue accordingly.


Regards,

Vidya.


0 Kudos
Nikolai_Tasev
Novice
1,436 Views

Hi Vidya,

We have been using the IPP extensively for many versions now. So our usage of the API should be correct.
The first call to ippiGetLibVersion() is during the static C++ initialization. There is a singleton class that calls
ippInit()
ippGetCpuFeatures()
ippiGetLibVersion()
...

By hanging I mean that after I call ippiGetLibVersion() it continues to make further calls to some internal library functions and never returns.

I cannot step through the internal functions with the debugger but when I make interrupts it looks like it is trying internally to init the library. The call stacks I get are one of the following:

1.

ippGetCpuFeatures
ippInit
ippSafeInit
.....
2.
ownFeaturesToIdx
ownSetCpuFeaturesAndIdx
ippSetCpuFeatures
ippInit
ippSafeInit
....

3.

ipp_is_Genuine_Intel

__frame_dummy_init_array_entry
ippInit
ippSafeInit
....

4.

ippGetCpuFeatures
ippInit
ippSafeInit
....

 

This is probably related to the combination of OS, kernel version and CPU. So far we have tried on two machines with different Intel CPUs.


Regards
Nikolai

0 Kudos
VidyalathaB_Intel
Moderator
1,421 Views

Hi Nikolai,


Could you please confirm if you are able to run the example code from the guide here and see if you still face the issue that you are mentioning?

Please find the link which contains the example code

https://www.intel.com/content/www/us/en/develop/documentation/dev-guide-ipp-for-oneapi/top/get-started-with-ipp/building-intel-ipp-applications.html


>>My test system is with OpenSuse Leap 15.2 ..... probably related to the combination of OS, kernel version and CPU....

If possible could you please try running the same on a system with Ubuntu and confirm it?

Please do let us know if you have any issues in doing so.

It would be a great help if you could provide us with the screenshots of the output that you are getting.


Regards,

Vidya.


0 Kudos
Nikolai_Tasev
Novice
1,402 Views

I have been able to isolate the specifics of the failure. It is not OS or compiler specific. I tested also on Ubuntu and on both clang and gcc and the effects are the same. The hang happens when the code calling the IPP function is in a separate shared library. If the same code is moved to the executable the issue doesn't happen.
I am adding an archive  package with a minimal test app. Needs cmake and gcc or clang to compile. I used your sample code in the main() and added our initialization in a separate shared library. When we run, it never reaches the main() as our initialization is in the static initialization of the Init class.
Output:
|--- Before init ---
|--- After init ---
|--- Before getLibVersion ---

 

Here is the specs of the test machine on Ubuntu:
cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
....

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel Xeon Processor (Skylake, IBRS)
stepping : 4
microcode : 0x1
cpu MHz : 2099.998
cache size : 16384 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13

...

0 Kudos
Nikolai_Tasev
Novice
1,383 Views

I have made further tests with changing the version of the IPP. The hanging is not happening until 2019.4 and starts happening on 2019.5 and further versions. So the breaking change is introduced in 2019.5

0 Kudos
VidyalathaB_Intel
Moderator
1,365 Views

Hi Nikolai,


Could you please try commenting the ippInit(); in main.cpp file (as for newer versions of IPP no need of using Init function) and try running the code?


Regards,

Vidya.


0 Kudos
Nikolai_Tasev
Novice
1,357 Views

Hi Vidya,

 

That is one of the first things I tried when the problem happened in our application. But it was not an improvement.

 

Regards
Nikolai

0 Kudos
Nikolai_Tasev
Novice
1,356 Views

As I said that the problem starts happening at 2019.5. And looking at the change log the only thing that is similar in the release notes is :
"Fixed issue with stack alignment in Intel® IPP and Intel® IPP Crypto non-PIC libraries that caused application crash on Linux."

0 Kudos
VidyalathaB_Intel
Moderator
1,327 Views

Hi Nikolai,

 

We are working on this issue. we will get back to you soon.

 

Regards,

Vidya.

0 Kudos
Abhinav_S_Intel
Moderator
856 Views

We looked at the reproducer and found an issue in the CMake file. The root cause of hang is due to double linking of ippCore domain. First time ippCore is included in "NandIPPTest", The second link is to "ipptest" directly along with "NandIPPTest" which contains own ippCore lib. It can produce double dispatcher variables with undefined behavior.

0 Kudos
Nikolai_Tasev
Novice
830 Views

Thank you for the reply. In our typical case we use ippCore in several shared libs and sometimes in the app itself. ippCore is linked to each of them statically as they may use different subsets of the functionality. As ippCore is linked statically it must put in each lib only what is needed.

So if I understand you correctly to keep using static linking we must move all the functionality in one lib that exports wrappers to the others. Or to use share linking and redistribute all the shared libraries.

Besides ippCore are there similar limitations to the libs for signal, computer vision and image processing?


Regards,
Nikolai

0 Kudos
Abhinav_S_Intel
Moderator
793 Views

We did some experiments at our end and the recommendation are to create a common wrapper library that would include core domain and all required processing functions or to use shared IPP library. All the IPP domains depend on the core domain.

0 Kudos
Reply