Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
613 Discussions

Runtime failures in ESIMD example code when linked with other SYCL modules

MikeDB
Novice
564 Views
I'm getting runtime compilation failures or incorrect behaviour when running ESIMD sample code which only occurs when other SYCL modules are linked into the same program even if they are not run. I'm using DPC++ 2024.1 from
up to date Visual Studio 2022 with default compiler options. I'm running on an 12th gen alder lake Intel Iris Xe-LP integrated GPU.

For example, create a new DPC++ console project in visual studio 2022. Replace the existing main program with the SIMD view ESIMD example from
https://github.com/intel/llvm/tree/sycl/sycl%2Fdoc%2Fextensions%2Fsupported%2Fsycl_ext_intel_esimd%2Fexamples

Then add a second source file with the contents of the sum two arrays sample from the same place. Rename main in the sum two arrays sample to something else to prevent duplicate main() link conflicts.

If I now build and run the project, I get runtime compilation failure opencl code 11 even though the second source file is not being executed. If I remove the second source file from being linked, the SIMD view example program runs correctly.

Do I need extra DPC++ compiler options when using ESIMD code or does ESIMD code need modification to run with Intel DPC++? Are there known problems linking ESIMD with other SYCL code in the same program?

I can't see anything unusual in the build output even if verbose build with all warnings enabled. Any suggestions for how to diagnose this problem further in the compiler or at runtime?

In other projects I've had the simd view sample produce incorrect results rather than fail to compile at runtime.
Labels (1)
0 Kudos
1 Solution
Alex_Y_Intel
Moderator
234 Views

Is your "latest update" 17.9.7? Please note that Intel only supports up to 17.9.2 as for now.

I've tried your issue on our platform and while Visual Studio shows some issues, the command prompt shows correct results. 

View solution in original post

0 Kudos
6 Replies
Alex_Y_Intel
Moderator
470 Views

Please provide exact files you used and reproducing steps to demonstrate the issue. We need this information to investigate further. 

0 Kudos
MikeDB
Novice
449 Views

I've included the Visual Studio projects and source files to demonstrate the problem.

 

1 Rebuild

2 Run

Expected - Should run successfully

Actual - Fails at runtime with exception, Open CL error code -11

 

Removing ESIMD_sum_two_arrays.cpp from the project will fix the failure even though the SYCL kernel in that source file is not being executed. Just commenting out the SYCL kernel in this unused source file is enough to fix the failure.

 

This is being run on the integrated Iris-Xe GPU on an i7-1260p CPU on Windows 11. There are no discrete GPUs installed. 

 

The project was created from a default DPC++ console project using the correspond ESIMD example programs from intel llvm github. The only change is renaming main() in ESIMD_sum_two_arrays.cpp to avoid a link conflict.

 

0 Kudos
Alex_Y_Intel
Moderator
325 Views

Have you tried this on "Intel oneAPI command prompt" or only MS visual studio? What's the version of your visual studio?  

0 Kudos
MikeDB
Novice
253 Views

I've only built it with Visual Studio 2022 (public release, latest updates)

 

I've tried running the executable from the Intel OneAPI command prompt but the results are the same.

0 Kudos
Alex_Y_Intel
Moderator
235 Views

Is your "latest update" 17.9.7? Please note that Intel only supports up to 17.9.2 as for now.

I've tried your issue on our platform and while Visual Studio shows some issues, the command prompt shows correct results. 

0 Kudos
MikeDB
Novice
143 Views

Thanks for your reply. I'm actually using Visual Studio 17.9.6 at the moment.

 

For various other reasons it looks like ESIMD is not suitable for my current project so I'm shelving work on ESIMD.

 

I'll test again at some point with a future update of Intel DPC++.

0 Kudos
Reply