Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28384 Discussions

The ordinal 899 could not be located in the dynamic link library (see image attached) omptarget.dll

Noemig4
Beginner
5,195 Views

Hello,

I am trying to compile a simple example (Microsoft Visual Studio 2019 and IntelOneAPI) with IFX Intel Fortran Compiler.

Noemig4_0-1641910027175.png

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:

 

Noemig4_4-1641910584118.png

 

Noemig4_5-1641910626357.png

 

Noemig4_6-1641910644765.png

 

Noemig4_7-1641910661284.png

 

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.

 

Noemig4_8-1641911536743.png

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. 

 

0 Kudos
54 Replies
Noemi
Beginner
1,035 Views
0 Kudos
Ron_Green
Moderator
1,020 Views

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.

 

Ron_Green_0-1642785697958.png

 

0 Kudos
Ron_Green
Moderator
1,014 Views

Interesting, a related problem in this thread

https://community.intel.com/t5/Intel-Fortran-Compiler/Procedure-entry-point-kmpc-aligned-alloc-could-not-be-located/m-p/1330222#M158367

 

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?

0 Kudos
Steve_Lionel
Honored Contributor III
1,003 Views

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.

0 Kudos
Noemi
Beginner
994 Views

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?.

 

Noemi_1-1642903152843.png

 

0 Kudos
Ron_Green
Moderator
956 Views

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)

0 Kudos
Ron_Green
Moderator
953 Views

and check how your paths are set up.  Depends was showing the DLLs in the ia32 path.

0 Kudos
Steve_Lionel
Honored Contributor III
935 Views

@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.

0 Kudos
Steve_Lionel
Honored Contributor III
989 Views

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.

0 Kudos
andrew_4619
Honored Contributor II
985 Views

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.

Steve_Lionel
Honored Contributor III
972 Views

@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!

Noemig4
Beginner
942 Views

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:

 

Noemig4_0-1643045492418.png

 

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

0 Kudos
Ron_Green
Moderator
937 Views

Fantastic news!  and I'm glad to learn about dependencies tool!! 

0 Kudos
Reply