Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
825 Discussions

OpenCL on Intel OneAPI devcloud?

Elliott
Novice
1,825 Views

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
1 Solution
RahulV_intel
Moderator
1,740 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

10 Replies
RahulV_intel
Moderator
1,800 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
1,792 Views

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

RahulV_intel
Moderator
1,785 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
1,750 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
1,741 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

 

u92921
Beginner
657 Views

Hi Rahul,

I have similar doubts.

I am building an OpenCL application using AUTOTOOLS (Autoconf, Automake etc.).

After generating the configuration file, when I am running it as follows:

                                                "./configure CPPFLAGS=-I/opt/intel/inteloneapi/compiler/latest/linux/include/sycl/"

on the head-node, then it can fetch OpenCL header files successfully.

But on any compute node (i.e. Arria 10 PAC Compilation and Programming - RTL AFU, OpenCL), it cannot fetch the required files as /opt/intel/ is an empty directory.

 

Please help.

 

RahulV_intel
Moderator
1,709 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
1,682 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.

Joel_Dippold
Employee
1,449 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.

RahulV_intel
Moderator
1,658 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.

 

Reply