Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Elliott
Novice
687 Views

OpenCL on Intel OneAPI devcloud?

Jump to solution

Is OpenCL available on the Intel OneAPI devcloud? I'd like to test running OpenCL on Intel GPUs.

Is there any documentation on how to do this?

0 Kudos

Accepted Solutions
RahulV_intel
Moderator
602 Views

Hi Elliott,

 

Looks like the program is unable to find opencl.h header file.

 

clang ocl_vecadd.c -o ocl_vecadd -lOpenCL -lm -I/opt/intel/inteloneapi/compiler/latest/linux/include/sycl/ && ./ocl_vecadd

 

Add the -I include path during compilation(provided above).

 

Let me know if it helps.

 

--Rahul

 

View solution in original post

9 Replies
RahulV_intel
Moderator
662 Views

Hi Elliott,


Your question is a bit ambiguous here. Are you looking to test DPC++/sycl programs on Intel iGPUs with OpenCL as backend? Or do you want to test native OpenCL programs on Intel iGPUs?


Regards,

Rahul


Elliott
Novice
654 Views

I was hoping to test native OpenCL programs on Intel iGPUs. Thanks.

RahulV_intel
Moderator
647 Views

Hi,

 

OpenCL dynamic library(libOpenCL.so) is available by default on Devcloud.

 

Here's the command to compile and run a sample:

 

clang ocl_vecadd.c -o ocl_vecadd -lOpenCL -lm && ./ocl_vecadd

 

Refer to the attached code, that selects Intel OpenCL HD graphics platform(iGPU device) for the program to run. You may wish to alter the code as per your need. 

 

--Rahul

Elliott
Novice
612 Views

Hi Rahul,

I seem to be having trouble finding the OpenCL header files. Do you know what's going wrong?

$ clang ocl_vecadd.c -o ocl_vecadd -lOpenCL -lm
ocl_vecadd.c:4:10: fatal error: 'CL/opencl.h' file not found
#include <CL/opencl.h>
         ^~~~~~~~~~~~~
1 error generated.

$ which clang
/glob/development-tools/versions/oneapi/beta07/inteloneapi/compiler/latest/linux/bin/clang

$ clang --version
Intel(R) oneAPI DPC++ Compiler 2021.1-beta07 (2020.5.0.0604)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /glob/development-tools/versions/oneapi/beta07/inteloneapi/compiler/latest/linux/bin
RahulV_intel
Moderator
603 Views

Hi Elliott,

 

Looks like the program is unable to find opencl.h header file.

 

clang ocl_vecadd.c -o ocl_vecadd -lOpenCL -lm -I/opt/intel/inteloneapi/compiler/latest/linux/include/sycl/ && ./ocl_vecadd

 

Add the -I include path during compilation(provided above).

 

Let me know if it helps.

 

--Rahul

 

View solution in original post

RahulV_intel
Moderator
573 Views

Hi,


Could you let me know if I can close the thread from my end since you have accepted the solution?


Thanks,

Rahul


Elliott
Novice
546 Views

Hi,

If there's any more documentation on how to use OpenCL on iGPUs in the devcloud environment, I'd appreciate it.

But yes, please go ahead and close this issue.

Thanks.

RahulV_intel
Moderator
522 Views

Thanks for the confirmation. Intel will no longer monitor this thread. However, this thread will remain open for community discussion.

 

I will speak to the concerned team regarding the OpenCL documentation. Thanks for your input.

 

Joel_Dippold
Employee
311 Views

Hi Elliott,

I'm a technical writer supporting OpenCL. We haven't created documentation specific to using OpenCL on iGPUs in the Intel DevCloud because the application's behavior there should be the same as you'd see it on your local system. 

Our lead engineer for the project had this explanation: "The Intel DevCloud is a sandbox for checking out DPC++ and Intel oneAPI on new Intel hardware. There’s a section of the DevCloud that deals with FPGA only and it might be already set up for OpenCL. [The FPGA section includes the Intel® FPGA SDK for OpenCL™ Software Technology] On oneAPI, DevCloud OpenCL is not specifically supported, though it is installed by default. Additional packages might be required in order to make OpenCL work on FPGA. I’m not sure because we’re not testing for that." 

He also had this advice: "From my brief experience I highly recommend switching to DPC++, if this is an option for you. DPC++ is much easier to use for FPGA apps than OpenCL." 

He recommended these resources, available on the DevCloud:

He also said, "The get started document will guide someone through the process of compiling and executing DPC++ code on the FPGAs currently available in the public section of the DevCloud. The documentation in the learning section of the DevCloud dashboard will provide additional details about how to request more time (up to 24h) for a job as the default 6 hours might not be enough and how to automate the execution of the code after the completion of the build."

You can also find OpenCL documentation on the Intel Developers Zone.