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

Getting FPGA OpenCL platform on OneAPI devcloud

Elliott
Novice
1,286 Views

Hi,

I'm trying to run an OpenCL program on the iGPUs on Intel OneAPI devcloud. The complete source code and instructions to reproduce this are here:

https://github.com/elliottslaughter/Summer20/tree/4034e0141e8f401944f635699950e02586187f9d/OpenCLEx

Basically, I'm running

ssh devcloud
git clone https://github.com/elliottslaughter/Summer20.git
qsub -I -l nodes=1:gpu:ppn=2 -d .
cd Summer20/OpenCLEx
clang -c -cl-std=CL1.2 -target spir64 -emit-llvm -Xclang -finclude-default-header -flto sample_kernel.cl -o sample_kernel64.ll
llvm-spirv sample_kernel64.ll -o sample_kernel64.spv
clang++ -O0 -g -std=c++0x -o main main.cpp -lOpenCL

When I run the program, I get:

$ ./main 
Running on platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
Running on device: Intel(R) FPGA Emulation Device
CL_DEVICE_ADDRESS_BITS is 64 for this device.
Reading SPIR-V from file: sample_kernel64.spv
Building program with build options: (none)
getPlatformVersion OpenCL 1.2 Intel(R) FPGA SDK for OpenCL(TM), Version 20.3
main: main.cpp:108: cl::Program createProgramWithIL(const cl::Context &, const std::vector<cl_uchar> &): Assertion `false' failed.
Aborted

This would seem to indicate that I'm running on the OpenCL platform for FPGAs. This is confusing since I'm on a GPU node and am using the default ~/.bash_profile, and so on. Furthermore, when I run ldd on the binary it seems to be pointing to the OpenCL for OneAPI:

$ ldd main
	linux-vdso.so.1 (0x00007fff9d1ca000)
	libOpenCL.so.1 => /glob/development-tools/versions/oneapi/beta07/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 (0x00007f2f2446f000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2f23ecc000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2f23b2e000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2f23916000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f23525000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f23306000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2f23102000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2f24255000)

 This is in the same tree as my copy of Clang:

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

 Am I doing something wrong? Is there something I need to do to get access to the OpenCL platform for iGPUs?

(As an aside, I also note that the OpenCL seems to be old, version 1.2. I believe I need version 2.1 to get access to clCreateProgramWithIL, which I need for my use case. Is there a newer version available?)

Thanks.

0 Kudos
1 Solution
Elliott
Novice
1,276 Views

A colleague pointed out to me that my code was selecting the wrong OpenCL platform, and in fact the code already has a flag to choose platform. Running my example with

./main -p 2

Causes it to run on the GPU. (And it is using OpenCL 2.1 now.)

View solution in original post

0 Kudos
4 Replies
Elliott
Novice
1,277 Views

A colleague pointed out to me that my code was selecting the wrong OpenCL platform, and in fact the code already has a flag to choose platform. Running my example with

./main -p 2

Causes it to run on the GPU. (And it is using OpenCL 2.1 now.)

0 Kudos
ArunJ_Intel
Moderator
1,264 Views

Hi Elliott,

 

Glad to know you found the solution. Is there any further assistance you would like regarding this issue from Intel?

 

 

Thanks

Arun

 

0 Kudos
Elliott
Novice
1,255 Views

Thanks for asking. No further assistance is needed at this time.

0 Kudos
ArunJ_Intel
Moderator
1,239 Views

Thanks for the confirmation. We would not be monitoring this conversation further. Please feel free to raise a new thread in case of any further issues.


0 Kudos
Reply