Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
410 Discussions

Executing oneAPI 2024.0.0 built exe fails

Doug_B_Intel
Employee
1,266 Views

I have a oneAPI program that runs fine when compiled and run from within Microsoft Visual studio (on either Windows 10 or 11).  However, when I use the Intel oneAPI Command Prompt to launch a cmd window and then navigate to the location of the exe and run it from command prompt, the program fails with a dialog box that says: "The procedure entry point ?getPreloadedPlugin@@YAPEAXAEBVpath@filesystem@std@@@Z could not be located in the dynamic link library C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\sycl7d.dll" when running the Debug version of the exe or a similar message by with sycl7.dll for Release.  This did not occur with oneAPI 2023.2 version.

To reproduce, start Visual Studio (in my case 2022 in case it matters), select Create New Project, then select DPC++ Console Application.  This will create a project with a basic vector add program.  Compile that and it will run under Visual Studio.  Next open the Intel oneAPI Command Prompt and cd to the directory location of the exe that was just built.  Run the program and it likely will fail.

 

0 Kudos
10 Replies
Alina_S_Intel
Employee
1,208 Views

Thank you for posting the request.

We continue working on this case on our support site, 06071039.

This thread will not be monitored. 

0 Kudos
ShanmukhS_Intel
Moderator
1,192 Views

Hi,


Thanks for posting in Intel Communities.


Based on this, and our discussion about creating a priority ticket if needed, I am going ahead and closing this case for now.


Please feel free to contact us further if you need any assistance from our side. 


Best Regards,

Shanmukh.SS



0 Kudos
BullyWiiPlaza
Beginner
978 Views

Hi, there, I still run into this issue, feel free to check this StackOverflow question for more details. Thanks for any help on this matter.

0 Kudos
Alina_S_Intel
Employee
937 Views

Hi BullyWiiPlaza, 

 

Thank you for posting your question.

 

Diagnosing such issues is challenging as they are often non-reproducible outside of the user's environment, and even when observing very similar behavior, the underlying reasons can vary, making it difficult to pinpoint the root cause. I would appreciate it if you could share more details:

 

1) Could you please indicate what version of edition and version of Visual Studio you are using? 

2) Is there any difference between running the application in oneAPI command prompt for Visual Studio and in cmd.exe + setvars.bat? 

3) When you compile and run your application in the command prompt, could you provide details on the observed behavior? Is there any difference between running the application in oneAPI command prompt for Visual Studio and cmd.exe + setvars.bat? The key here is that you compile in the command prompt

4) Can you try compiling in cmd.exe + setvars.bat and running in oneAPI command prompt for Visual Studio and vice versa? 

5) If you see that one of the cases in p.4 was successful and another was not, can you please print environment variables to the file and attach files to the forum?

6) What happens if you do `set "PATH=C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin;%PATH%"` before running application in the command prompt?  Since I cannot reproduce the issue, I tested this with the cmd.exe without setvars.bat. It should fail with `sycl7d.dll not found` as expected. Setting PATH in the same terminal is a workaround at least for this issue.

 

0 Kudos
BullyWiiPlaza
Beginner
888 Views

Hello Alina,

let me respond to your questions in order.

 

1) I'm using "Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview Version 17.9.0 Preview 2.0"


2) No, there is no difference. In both cases, the application runs successfully.


3) No, there is no difference either.

 

4) Yes, it works fine.

 

5) There weren't any differences.

 

6) "What happens if you do set "PATH=C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin;%PATH%" before running application in the command prompt?"
This will fix the issue and the application works again, even without using a oneAPI Tools command line.

What I just realized is that compiling from the command line via e.g. icx Main.cpp produces binaries which work outside of the oneAPI Tools environment. However, when building with Visual Studio via `Build -> Build My Project` and then running the Main.exe from the x64\Releases folder for example, it fails with the missing DLLs error.

 

"C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin\icx" cannot be invoked in a normal CMD window successfully (without calling setvars.bat), it crashes with error level -1073741515 (0xC0000135) which stands for "The application was unable to start correctly" but I believe this is expected behavior.

 

 

>dumpbin /dependents Main.exe
Microsoft (R) COFF/PE Dumper Version 14.39.33321.0
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file Main.exe

File Type: EXECUTABLE IMAGE

Image has the following dependencies:

KERNEL32.dll

Summary

4000 .data
3000 .pdata
12000 .rdata
1000 .reloc
35000 .text
1000 .trace
2000 _RDATA
>dumpbin /dependents x64\Releases\Main.exe
Microsoft (R) COFF/PE Dumper Version 14.39.33321.0
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file Main.exe

File Type: EXECUTABLE IMAGE

Image has the following dependencies:

MSVCP140.dll
sycl7.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-utility-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
api-ms-win-crt-environment-l1-1-0.dll

Summary

1000 .00cfg
2000 .data
2000 .idata
1000 .pdata
5000 .rdata
1000 .reloc
10000 .text
2000 .text.st
1000 .tgtimg
1000 _RDATA
13000 __CLANG_

 

So maybe there is an issue with the Intel Compiler integration in Visual Studio or the behavior of compiling this way is different. Is there any configuration or setting that makes the EXE standalone when building in Visual Studio?

Visual Studio uses the following command to build:
icx /O2 /Zi /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /WX- /MD /std:c++latest /EHsc /W1 /nologo Main.cpp
This actually causes the dependencies listed above. And I tracked it down to the /MD flag, which is the Runtime Library selection:

BullyWiiPlaza_0-1704225749493.png

Visual Studio does not allow to not pass this flag though, how it seems. Why not? Without this flag, we get a fully static EXE which only depends on KERNEL32.dll.

 

0 Kudos
Alina_S_Intel
Employee
870 Views

Thank you for checking. 

 

Unfortunately, oneAPI 2024.0 supports Visual studio up to 17.7.5.  Newer versions are not tested so we cannot guarantee that the integration is functional. 

 

However, the issue seems to be related to the content of the PATH.  Please, carefully check paths that are placed before "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin". One of the directions for a check is older versions of oneAPI. Another point is to compare PATH from the command line (good case) and Visual Studio PATH (project properties -> Debugging -> Environment -> if it is empty, just click it and then click edit -> you will see the Environment window -> scroll down the Evaluated values section )

 

For example, this is what I have in Visual Studio:

TBB_DLL_PATH=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\..\..\tbb\latest\bin

OCL_ICD_FILENAMES=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin\intelocl64_emu.dll;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin\intelocl64.dll;

INTELFPGAOCLSDKROOT=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\opt\oclfpga

INTEL_TARGET_ARCH=intel64

INTEL_TARGET_PLATFORM=windows

CMPLR_ROOT=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\

PATH=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\lib\ocloc;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\lib;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\opt\oclfpga\host\windows64\bin;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\opt\oclfpga\llvm\aocl-bin;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\opt\oclfpga\windows64\bin;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\opt\oclfpga\bin;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\..\..\tbb\latest\bin;%PATH%

 

Do you have one of the older versions of Intel Distribution for Python or an older oneAPI installed? Did you select `add to PATH` option in Python installer? 

You can check if C:\Program Files (x86)\Intel\oneAPI\intelpython3 exists. The latest Intel Distribution for Python standalone package has another installation path. 

0 Kudos
BullyWiiPlaza
Beginner
850 Views

Hello Alina, 

I believe the Visual Studio integration is working fine so that shouldn't be an issue. This is also the first time I installed Intel oneAPI so I don't have any older version of it installed. My Visual Studio PATH is exactly the same as yours. Are you sure your binary compiled in Visual Studio does not depend on sycl7.dll like mine? I just want to resolve the dependency on Intel specific DLLs so the EXE can run standalone. I'm not sure what else to try, any ideas?

Thank you.

0 Kudos
Alina_S_Intel
Employee
827 Views

You confirmed that application runs successfully both when you are using Intel oneAPI command prompt and cmd.exe + setvars.bat. That's the solution. 

 


@BullyWiiPlaza wrote:

"C:\Program Files (x86)\Intel\oneAPI\compiler\2024.0\bin\icx" cannot be invoked in a normal CMD window successfully (without calling setvars.bat), it crashes with error level -1073741515 (0xC0000135) which stands for "The application was unable to start correctly" but I believe this is expected behavior.


You need properly configured environment for running oneAPI: Intel oneAPI command prompt or running setvars.bat

 from cmd.exe. If you need only one single component to be available in you environment,  I would recommend looking at env/vars.bat for the desired component. 

 

If you need to run your application on a machines where oneAPI is not installed, I would recommend looking at https://www.intel.com/content/www/us/en/developer/articles/tool/compilers-redistributable-libraries-by-version.html 

0 Kudos
BullyWiiPlaza
Beginner
821 Views

Hello Alina,

thanks a lot, I was after the solution for running applications on machines where oneAPI is not installed. Even though I have oneAPI installed, running an EXE depending on the sycl7.dll outside of the oneAPI or Visual Studio command prompt environment did not work out-of-the-box. However, after installing the compiler runtime you linked, this issue has been solved. Now everything is working fine.

0 Kudos
Alina_S_Intel
Employee
706 Views

The issue is caused by Intel Python 2023.2 installed on the same machine because Python 2023.2 is added to PATH and having Intel Compiler 2023.2 installed as a dependency. So, having 2023.2 compiler libraries (installed to `C:\Program Files (x86)\Intel\oneAPI\intelpython\python3.9\Library\bin`) prepending 2024 compiler libraries in the PATH causes the conflict.  

 

To resolve this problem, remove Python  from PATH.

 

This is a known issue so Intel Python 2024 installer has a warning related to adding Python to PATH since it may lead to conflicts with other applications.

0 Kudos
Reply