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

How to remove the warning when run IPP on AMD processor ?

free1006
Beginner
4,579 Views


When I run my application which built base on the INTEL IPP on an AMD CPU, got the warning message, please see the attached screenshot. Please tell me how to remove it, thanks in advance.



0 Kudos
22 Replies
detlef_stralaudynami
4,312 Views
Hi free1006,

i had the same problem, the best way is to set the enviorment variable "KMP_AFFINITY=disabled".

Best Regards

Detlef
0 Kudos
SergeyKostrov
Valued Contributor II
4,312 Views

OpenMP environment variables could be easily set in a program andplease take a look at example:

[cpp] ... int iRetCode = _putenv( "KMP_AFFINITY=disabled" ); if( iRetCode == 0 ) printf( "KMP_AFFINITY=%sn", getenv( "KMP_AFFINITY" ) ); else printf( "Error: Failed to Set Environment Variable KMP_AFFINITYn" ); ... [/cpp]


Best regards,
Sergey

0 Kudos
free1006
Beginner
4,312 Views
Thank you for your code, then I should detected the CPU in my application, if the CPU is AMD, then call your code, correct?
0 Kudos
SergeyKostrov
Valued Contributor II
4,312 Views
Quoting free1006
Thank you for your code, then I should detected the CPU in my application, if the CPU is AMD, then call your code, correct?


Yes, that is correct.

Please take into account that all OpenMP environment variables with a prefix 'KMP_' are Intel specific.

Best regards,
Sergey

0 Kudos
Ying_H_Intel
Employee
4,312 Views
Hi Sergey,

Thanks for the suggestion. That is right. The basic reason is that IPP is threaded by OpenMP, which provided by Intel Compiler.
The warning message is from the OpenMP library. It is known issue and solved by set KMP_AFFINITY =NONE.

Here is detial discussion in Intel Comipiler Forum: http://software.intel.com/en-us/forums/showthread.php?t=100563

Best Regards,
Ying
0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
You are wrong. Since IPP 7 update 7 None does not work, only Disabled works.

I would prefer if Intel could fix this asap so all we users won't have to add strange workaround code. The world has other processor types than Intel... Our software is used in the world...
From Subject Received
isn.admin@intel.com Intel Software Network - Thread Subscription : Intel Integrated Performance Primitives, How to remove the warning when run IPP on AMD processor ? 03:40
0 Kudos
SergeyKostrov
Valued Contributor II
4,312 Views
You are wrong. Since IPP 7 update 7 None does not work, only Disabled works.
...

Do you mean'None' doesn't work on computers withAMD CPU?

Unfortunately, I don't have a computer with AMD CPU and I can't verify.

Best regards,
Sergey
0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
My work pc is an AMD Phenom X4, 3.8GHz.
I develop an IPP custom dll with a subset of IPP, enabling OpenMP, compiled with Intel C++ 10.2. This gives me a small dll with multithreaded codecs and image filters.

Since IPP 7.0, I got a unexceptable command prompt window (This is all on Windows 7) every time I loaded my custom dll (and calling ippStaticInit). This command prompt window is unacceptable for our users, as you might guess.

I then learned that by adding the kmp environment, I could supress the command prompt window.
I first tried to add the environment inside my custom dll, but that did not work. I guess IPP was doing some initialization before my code was run. I then added the kmp to the (local) environment in the exe file, and that worked. At this tme, I used "None" and it worked. Later, with IPP 7.0.7 (Via Composer) the problem came back. I then changed to "Disabled", and that fixed it again, no command windows.

I strongly advise the people responsible for this problem to go out and buy an AMD computer, to verify their code before release. I don't know the real numbers, but I guess that AMD has 1/3 of all computers out there. IPP must be tested to also run on such platforms. If Intel can't do that, then IPP should be stated as "Only supported on Genuine Intel Processors", and then I will have to drop the product.
0 Kudos
Chao_Y_Intel
Moderator
4,312 Views
Hello Thomas,

Thanksfor checking on this. We are looking at this problem, and will provide more information.

Thanks,
Chao
0 Kudos
SergeyKostrov
Valued Contributor II
4,312 Views
...I then learned that by adding the kmp environment, I could supress the command prompt window.
I first tried to add the environment inside my custom dll, but that did not work. I guess IPP was doing some initialization before my code was run. I then added the kmp to the (local) environment in the exe file, and that worked...

Yes, that is correct and environment variables have to be set in some executable module. It doesn't work if
theyset in a DLL module.
0 Kudos
tfield98
Beginner
4,312 Views
Ying,
Can Intel please confirm Mr. Jensen's statement that "none' no longer works?
Tom
0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
I want to add to my findings.
I launched the precompiled Picnic application from the IPP 7 update 7 samples.
This application use only IPP in dll files.
Running this on my AMD did not trigger bogus warning command prompt windows.
I do not have any KMP environment settings my my computer.
Picnic uses libiomp5md.dll (KMP stuff), as I also do.

So why is this KMP warning not in Picnic but it is in my application?
0 Kudos
Ying_H_Intel
Employee
4,312 Views
Hi Thomas,

We checked the affinity with IPP developer,all ofIPP functions ( primitives) haven'tlow-level affinity settings internally.There is several IPP functions (in Core domain) for low-level affinity control, like ippSetAffinity()for external purposes, but we only use these functions in the sample for Realistic Rendering (RR) domain.

So formost of applications, likePicnic application you won't seesuch problem.
You mentioned, you are using image Filter in dll files, could you please give the function lists you are using orthe exacttest case?

Regarding theproblem of None doesn't work, but Disable works, I discussed withPatrick Kennedy (Intel). he'd like to check this. Could you please tell the result of using (set/export KMP_VERSION=1), then run the application.
or a test case will be helpful.

Best Regards,
Ying

0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
If I set KMP_VERSION=1, I get this on my AMD:

OMP: Warning #72: KMP_AFFINITY: affinity only supported for Intel processors.

OMP: Warning #71: KMP_AFFINITY: affinity not supported, using "disabled".
Intel OMP Copyright (C) 1997-2011, Intel Corporation. All Rights Reserved.
Intel OMP version: 5.0.20111219
Intel OMP library type: performance
Intel OMP link type: dynamic
Intel OMP build time: 2011-12-19 17:12:07 UTC
Intel OMP build compiler: Intel C++ Compiler 12.0
Intel OMP alternative compiler support: yes
Intel OMP API version: 3.1 (201107)
Intel OMP tracefile support: no
Intel OMP dynamic error checking: no
Intel OMP helper thread support: yes
Intel OMP thread affinity support: no
Intel OMP debugger support version: 1.1
Intel OMP Intel RML support: not using

However, I want to add more of my findings:

As I stated before, with IPP 7.0.7, I suddenly got the bogus warning when I used "none". Since I knew about "disabled", I just put that in, and the bogus warning went away. Then I started posting about this matter.
However, right now I tested just removing KMP_AFFINITY. I now see no bogus warning. This answers two things:
1. The reason Picnic has no bogus warning.
2. The question when the bugfix for the bogus warning in 7.0.0 would come (the bugfix is in 7.0.7).

So, if I'm right, with 7.0.7 and on AMD systems, it is no longer neccesary to add the environment KMP_AFFINITY setting. Thank you, Intel. Sorry that I didn't see this earlier.

0 Kudos
tfield98
Beginner
4,312 Views
Beccause some .exe's may initialize the IPP DLLs on startup, wouldn't it be more accurate to state that the local environment variable has to be set before teh IPP DLLs are initialized? .
0 Kudos
pbkenned1
Employee
4,312 Views
I've reported to the developers that setting KMP_AFFINITY=none is no longer a workaround to disable affinity warnings 71 & 72 on non-Intel processor hosts. Setting KMP_AFFINITY=disabled is still a viable workaround.

This is being tracked as defect DPD200232441. I'll keep this thread updated with news from the developers.

This is only a compiler issue with the Intel OpenMP runtime library libiomp5.so (Linux*) or libiomp5md.dll (Windows*).

Patrick Kennedy
Intel Developer Support
0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
For IPP 7.0.7 (current), I want to add: Not setting (or clearing) KMP_AFFINITY is also a viable workaround.
0 Kudos
pbkenned1
Employee
4,312 Views
Hello Thomas,
>>>Not setting (or clearing) KMP_AFFINITY is also a viable workaround.

Thanks for pointing that out. It's true, if you don't do anything with KMP_AFFINITY, you won't see those warnings at all.

Regarding the problem report I filed, the OpenMP developer has already fixed the issue in the v13.0 OpenMP runtime library! The fix should appear in an update to the v13.0 beta compiler. The fix is already in our v13.0 development compiler:

$ export KMP_AFFINITY=none

$ icc -fopenmp helloOmp.cc && ./a.out

_OPENMP is defined for compiler.

Hello from thread 0 out of 4

Hello from thread 3 out of 4

Hello from thread 1 out of 4

Hello from thread 2 out of 4

$

Patrick






0 Kudos
Thomas_Jensen1
Beginner
4,312 Views
I'm sorry to say this story is not finished yet.
I tested on another AMD processor, and it did display the bogus KMP warning, when no KMP_AFFINITY was set.

It appears that this problem is dependent on what type AMD processor you use.

So, KMP_AFFINITY not set at all:

No KMP warnings: AMD Phenom II X4 "Deneb"
Bogus KMP warnings: AMD Athlon 64 X2 "Toledo"

In other words, newer AMD no warnings, older AMD warnings unless KMP_AFFINITY=disabled is set.

I'd prefer that Intel fix this also.
Setting KMP_AFFINITY locally (runtime) requires detecting cpu vendor first. IPP can do that but then it is too late. Do anyone have simple C++ code for cpu vendor detection?

Patrick, the OpenMP changes, will those not be added to the IPP Composer OpenMP library libiomp5md.dll also (when)?

0 Kudos
Ying_H_Intel
Employee
3,639 Views
Just notify that Compiler 13.0 (IPP 7.1 gold) release recently. Please feel free to test them. The version should fix the problem Patrik mentioned in , 05/30/2012 . " Regarding the problem report I filed, the OpenMP developer has already fixed the issue in the v13.0 OpenMP runtime library! The fix should appear in an update to the v13.0 beta compiler. The fix is already in our v13.0 development compiler" W.B.R Ying
0 Kudos
Reply