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.
417 Discussions

Ingest OpenCL by source example fauls to run.

Dr_FPGA
Novice
3,114 Views

The example to ingest OpenCL by source comliles w/o error but fails to run on gpu DevCloud node.

https://software.intel.com/content/www/us/en/develop/articles/interoperability-dpcpp-sycl-opencl.html

tar file attached. Please see log below

Please provide equivalent example specific for Intel FPGA.

=========================== log =======================

u34222@s001-n178:~/ingest_ocl_by_source$ make clean
rm -rf a.out
u34222@s001-n178:~/ingest_ocl_by_source$ make all
dpcpp -fsycl-unnamed-lambda -std=c++17 -o a.out ingest.cpp
u34222@s001-n178:~/ingest_ocl_by_source$ ./a.out
terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): Native API failed. Native API returns: -59 (CL_INVALID_OPERATION) -59 (CL_INVALID_OPERATION)
Aborted
u34222@s001-n178:~/ingest_ocl_by_source$ tar cvf ingest_ocl.tar ingest.cpp Makefile
ingest.cpp
Makefile
u34222@s001-n178:~/ingest_ocl_by_source$

 

0 Kudos
1 Solution
AbhishekD_Intel
Moderator
3,104 Views

Hi Andrei,


The thing is that you are trying to ingest OpenCL-C kernel through SYCL Program, so to execute this program there should be OpenCL backend but by default, accelerators use Level0 backend. So you need to change the underlying backend to execute this program.


Here is what you can do:

export SYCL_BE=PI_OPENCL

Then you can try executing your code, it will work.

We hope, the provided solution will help.



Warm Regards,

Abhishek


View solution in original post

11 Replies
AbhishekD_Intel
Moderator
3,105 Views

Hi Andrei,


The thing is that you are trying to ingest OpenCL-C kernel through SYCL Program, so to execute this program there should be OpenCL backend but by default, accelerators use Level0 backend. So you need to change the underlying backend to execute this program.


Here is what you can do:

export SYCL_BE=PI_OPENCL

Then you can try executing your code, it will work.

We hope, the provided solution will help.



Warm Regards,

Abhishek


Dr_FPGA
Novice
3,093 Views

Hi Abhishek,

This magic word worked on GPU, thanks! Please update the documentation on the link that I posted to reflect this new requirement.

But I am looking into this particularly for FPGAs and unfortunately, the same code (with FPGA specific includes and device selectors) is not running on FPGA node even in emulator mode. There were no errors reported during compilation though. I attaching a new tar file with FPGA specific dpcpp switches.

The error messages are not very informative. I am hoping you can help me to decipher them.

Because of these specific compiler related error messages please do not bounce this thread to "FPGA area".

==================================== FPGA error log ==============================

u34222@s001-n149:~/ingest_ocl_by_source$ ./a.out
terminate called after throwing an instance of 'cl::sycl::compile_program_error'
what(): Program build error:
The program was built for 1 devices
Build program log for 'Intel(R) FPGA Emulation Device':
Compilation started
1:1:10: error: expected function body after function declarator
Intel(R) oneAPI DPC++ Compiler 2021.1-beta07 (2020.5.0.0604)
^
1:9:23: error: expected identifier or '('
Candidate multilib: .;@m64
^
1:10:22: error: expected identifier or '('
Selected multilib: .;@m64
^
Compilation failed
-11 (CL_BUILD_PROGRAM_FAILURE)
Aborted

0 Kudos
AbhishekD_Intel
Moderator
3,071 Views

Hi Andrei,

 

We have checked the code you have given and tried it on devcloud and we can compile and execute it successfully. For more details please see the screenshot I also have printed running device name for details.

Please check if can find Intel(R) FPGA Emulation in clinfo. And update us with your finding.

 

ScreenshotScreenshot

 

 

Warm Regards,

Abhishek

 

0 Kudos
Dr_FPGA
Novice
3,060 Views

Hi Abhishek,

Thank you for looking into this. Our company has another DevCloud account and this code does run correctly these. However, the same exact code runs with errors that I have posted on our primary account. So, there is a chance that the primary account was somehow corrupted likely by user ;)). Or less likely it may have not been setup correctly. It was originally setup for oneAPI training at SC19.

If one of your IT guys could take a look at u34222 the environment and correct it that would be great. We will use the secondary account in the meantime.

Thank you.

0 Kudos
Dr_FPGA
Novice
3,057 Views

Hi Abhishek,

I have compiled project for FPGA and have fpga.bin in the ingest.prj directory. However, while I am running a.out I have this error message:

u44838@s001-n081:~/ingest$ ./a.out
terminate called after throwing an instance of 'cl::sycl::feature_not_supported'
what(): Online compilation is not supported by this device -3 (CL_COMPILER_NOT_AVAILABLE)
Aborted

What syntax would be correct to launch OpenCL kernel from SYCL in this code example?

0 Kudos
AbhishekD_Intel
Moderator
3,020 Views

Hi Andrei,

 

  • For Devcloud issue please post a new thread on Intel Devcloud forum giving them details that your account might get corrupted they will definitely solve your problem-related Devcloud.
  • For detailed insight regarding FPGA, I will suggest you put your issue on the Intel High-Level Design forum. You can also refer to Intel OneAPI Programming Guide mainly FPGA FLOW (Pg-35 & onwards) for more details. I might not be the best one to give more deep insights on FPGA related issues.

 

Please give us an update.

 

Warm Regards,

Abhishek

 

0 Kudos
AbhishekD_Intel
Moderator
2,947 Views

Hi,

As your issue related to this is resolved so can we close this thread?

You are always welcome to post a new thread if you have any issues.


Warm Regards,

Abhishek


0 Kudos
Dr_FPGA
Novice
2,936 Views
0 Kudos
AbhishekD_Intel
Moderator
2,881 Views

Okay, If you want then we can wait till the response from the Admin.

I am also in sync with the Devcloud team, so if we get any update we will share it with you.



Warm Regards,

Abhishek


0 Kudos
AbhishekD_Intel
Moderator
2,867 Views

Hi,

 

Admin has suggested that the best solution is to apply for a new account on Devcloud and setting it according to your need. Please refer to your Devcloud Thread for more details.

https://community.intel.com/t5/Intel-DevCloud/Older-account-environment-differs-from-new-one/m-p/1193273

Please give us an update so that we can close this thread.

 

Thank You

 

0 Kudos
AbhishekD_Intel
Moderator
2,857 Views

Hi,

As per the process, we are closing this thread as your issue is resolved.

Please post a new thread if have any problem.


Thank You


0 Kudos
Reply