- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to compile a simple example (Microsoft Visual Studio 2019 and IntelOneAPI) with IFX Intel Fortran Compiler.
The code is simple, see below:
Program Example
implicit none
integer :: i, j
real :: x, y
x=0
!$omp target map(tofrom:x)
!$omp parallel do private(j,y) reduction(+:x)
do i=1,2000000
y=0.5
do j=1,1000
y=(y+SQRT(y))/2
end do
x=x+1-y
end do
!$omp end target
print '("Our final result is: ",G0.5)', x
write(99,*)'("Our final result is: ",G0.5)', x
end Program
The following properties are selected in Visual Studio:
I have installed the following:
- Microsoft Visual Studio Professional 2019 Version 16.11.8
- Intel® oneAPI Base, and HPC Toolkits version: 2022.1.0 (64 bit)
I am able to compile and run this code using IFORT and OpenMP, the issue is shown when I tried to offload to GPU. One of my display adapters is the UHD Graphics 630, I am trying to offloading to the graphics cores.
I have been searching for a complete example project build in Visual Studio that could help me to figure out what is the issue with my OpenMP libraries and DLL. My guess is that I am either missing a LIB/DLL or I am using and old version of the Open MP libraries.
Link Copied
- « Previous
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I might have something to help.
There's a tool called Dependency Walker, Dependency Walker (depends.exe) Home Page
Pull down the x64 version.
it's a simple zip file. Move that to something like c:\tools or some temp dir.
Unzip it.
Next, start a Intel oneAPI x64 Command Window. You want to start the depends.exe from this window and NOT a File Explorer because you need the exe to inherit all the PATH info from the Command Window to the Intel compiler paths. So I did this
opened a oneAPI x64 Command Window
cd c:\
cd tools\depends22_x64
depends.exe
Once the GUI opens, use File Open to find your compiled matmul-offload.exe that we have been compiling and testing.
Depends will show you a hierarchy of the DLLs required by this .exe.
From mine, I found "ordinal 899". It's in libiomp5md.dll. Thanks to Lorri and Steve I understand an "ordinal" is what I personally consider a hash into a jump table of function pointers. Correct me if I'm wrong, I'm an linux guy wading through this DLL stuff.
SO what you SHOULD see is libiomp5md.dll being resolved - is it for you also? I needs to be. See my screenshot below. If it's pathing correctly to find libiomp5md.dll we can examine the "ordinals" or hash keys to find the function pointer your app is complaining about. It's "__kmpc_get_ompt_callbacks". That should be in libiomp5md.dll. So your app is complaining, I THINK that it cannot find this DLL. Check your path. this dll is in C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.0\windows\redist\intel64_win\compiler
That path SHOULD BE in your PATH variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting, a related problem in this thread
Steve suggested installing the Redistributable Libraries. did you do this? I haven't but my code works.
One thing maybe different from my installation to yours - I have only had the 2022 version of oneAPI tools on my PC. Do you have an older 2021 installation? Did you remove it before adding 2022?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
libiomp5md.dll may have ordinal 899, but the error message is about omptarget.dll, which doesn't have any ordinals above 90. Yes, DLL ordinals are how Windows identifies DLL entry points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue with libiomp5md.dll is shown in the dependency tool. I ran the program and I got errors with libiomp5md.dll, see the image below. Could it be that an old version of the DLL is called?.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Eureka! I see the problem
Are you aware that offload is ONLY for Intel 64 (x64) applications? ia32 cannot offload. It's 64bit ONLY.
Your paths are to ia32 libraries.
1) In VS did you change your project configuration to "Release" + "x64"?
2) On the command line, did you open an Intel 64 window?: Start -> Intel oneAPI 2022 -> Intel oneAPI command prompt for Intel 64 for Visual Studio
it is the 2nd command prompt icon in the list under 'Intel oneAPI 2022'. The first icon is for ia32 which will not work.
Please check your VS configuration and your command line configuration to build for Intel 64 (x64)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and check how your paths are set up. Depends was showing the DLLs in the ia32 path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Ron_Green wrote:
Eureka! I see the problem
Are you aware that offload is ONLY for Intel 64 (x64) applications? ia32 cannot offload. It's 64bit ONLY.
That wouldn't be a problem. 64-bit Windows automatically skips over 32-bit DLLs in its search when a 64-bit application is running. Note that ifx supports only 64-bit configurations (Ron, you and I had an exchange about this a week or so ago.)
It's great to hear that Noemi found the solution, though it's irritating that the error message was so misleading.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Those aren't real errors. DependencyWalker increasingly has trouble navigating Windows' methods for locating DLLs - for example, it has no idea that 64-bit Windows skips over 32-bit DLLs. It hasn't been maintained in years, and often takes 5-10 minutes to show results. Sadly, there isn't a good alternative.
I think libiomp5md.dll is a distraction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use "dependencies" from github which works better and is more up to date than the old dependency walker. There is either soutce or binary downloads available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@andrew_4619 wrote:
I use "dependencies" from github which works better and is more up to date than the old dependency walker. There is either soutce or binary downloads available.
Huh - I downloaded that a year ago but had forgotten about it! lucasg/Dependencies: A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues. (github.com) Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I downloaded the dependencies tool from github and I was able to use it. It helped me fixing the issue. I am not getting anymore the ordinal 899 error and the offloading GPU seems to be working when I run the matmul multiplication example, see below:
The main issue was in the path on the system variables (system environment variables). One of them had an incorrect semicolon in the variable value. I removed it, rebooted the computer, ran again the example and now I see some GPU (UHD 630) usage when I run my example and I do not see an error anymore (ordinal 899). I will test this further but seems to be fixed.
Thank you very much to @Ron_Green @Steve_Lionel @andrew_4619 @Lorri_M_Intel for your help fixing this problem.
Noemi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fantastic news! and I'm glad to learn about dependencies tool!!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
- Next »