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

DLL load failure when ipps.dll is the only reference

gast128
Beginner
464 Views

Hello all,

we upgraded recently to oneAPI 2025.3 / IPP 2022 and encounter now mysterious DLL load failures. It seems to be related to ippcore.dll not be loaded before any other IPP DLL. If ipps.dll is loaded before ippcore.dll the load of ippcore.dll fails. This is reproducible by making a small console app with the following code (tested on Windows 10):

#include <windows.h>
#include <filesystem>


int main()
{
    std::filesystem::current_path("D:\\Develop\\Bin\\x64\\Debug");

    const HMODULE h = ::LoadLibraryA("ipps.dll");
    
    if (h == 0)
    {
       //126: ERROR_MOD_NOT_FOUND 
       std::cerr << "Error " << ::GetLastError() << std::endl;
    }
    else
    {
       ::FreeLibrary(h);
    }

    return 0;
}

Although above example is artificial in real world applications this can easily emerge when only ipps functions are used. Workarounds are not easy: with implicit loading and link to 'ippcore.lib' the linker removes the reference to ippcore.dll if there are no functions used. This can be hacked by artificially add a a dependency  (e.g. invoke ippGetLibVersion somewhere) but the problems are not over then. I see now that sometimes the Windows loader reorders the DLL loads and ipps.dll might be loaded before ippcore.dll resulting in the original failure.

 

Can anyone help? The best solution is that ippcore.dll just loads independent of the order.

 

0 Kudos
3 Replies
gast128
Beginner
336 Views

...I can't edit my own post. There might be a reason why ippcore.dll is only 'loaded' (actually memory mapped in the process space) after ipps.dll. It seems that Windows parallel loads all indirect DLL's through its thread pool. The order is non deterministic resulting in spurious failures. Forcing a memory mapping load order is not possible besides the direct order in the PE executable. It would be nice if Intel would fix this IPP issue; it already costs us a week.

 

The parallel loading can be by HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<YourApp.exe>\MaxLoaderThreads registry value on Windows but this is not a workable solution (i.e. costs performance and per PC / exe). 

0 Kudos
Chao_Y_Intel
Moderator
162 Views

Hello,

 

can you check the new 2026 IPP release? I can not reproduce this issue.  I also add DLL search directory like bellow:

 

std::filesystem::current_path("D:\\Develop\\Bin\\x64\\Debug");

SetDllDirectoryA("D:\\Develop\\Bin\\x64\\Debug"); // ADD THIS

const HMODULE h = ::LoadLibraryA("ipps.dll");

 

please check if this work for you. 

thanks,

Chao

 

0 Kudos
gast128
Beginner
93 Views

Hello Chao,

 

busy with other things right now but when I have time again I can try IPP 2026. Be aware though that we use implicit linking so solution with setting DLL directories wouldn't solve our problem.

 

wkr

0 Kudos
Reply