Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

aoc error for emulation

Kulkarni__Vinay
New Contributor I
1,531 Views

Hi,

   I installed opencl intel fpga sdk 19.2 and after installation the hello world example seems to compile smoothly taking default board as Arria10GX. But when i try giving the emulator compilation, i get following error:

My Machine spec:

Xeon-16 cores,32 GB RAM and Ubuntu 18.04.

 

 aoc -march=emulator  -fast-emulator -v device/hello_world.cl -o bin/hello_world.aocx
Warning: Command has been deprecated. The Fast Emulator is the default emulator; use -legacy-emulator if you wish to target the Legacy Emulator.
Error: aoc: The Intel(R) Kernel Builder for OpenCL(TM) compiler (ioc64) can not be found

 

Any idea on how i can fix this.

 

0 Kudos
1 Solution
Sergey_I_Intel1
Employee
1,531 Views

Vinay,

Please, check that you set the environment variable CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=<number_of_devices>.

For more information about emulating OpenCL Kernels read here.

 

Best regards,

Sergey

View solution in original post

8 Replies
Kulkarni__Vinay
New Contributor I
1,531 Views

Hello Intel Folks,

     May i request you to please suggest solution for me. I need emulator urgently for my development.

 

 

Sergey_I_Intel1
Employee
1,531 Views

Hello Vinay,

Sorry for delay in answer.

 

In previous version of aoc you should use "-march=emulator and -fast-emulator".

In 19.2 version, please, use "-march=emulator -legacy-emulator".

I guess, documentation of aoc was not updated to 19.2.

 

Best regards,

Sergey

Kulkarni__Vinay
New Contributor I
1,531 Views

Thanks Sergey for your help.

Now i am able to compile, but running gives error as below:

 

ERROR: CL_DEVICE_NOT_FOUND
Location: ../common/src/AOCLUtils/opencl.cpp:356
Query for number of devices failed

Please let me know how i can get this working.

 

 

My Runs are as below :

 

(base) wc@ign:~/Documents/opencl_fpga/exm_opencl_hello_world_x64_linux/hello_world$ aoc -march=emulator -legacy-emulator -board=a10gx  device/hello_world.cl -o bin/hello_world.aocx
aoc: Running OpenCL parser....
aoc: OpenCL parser completed successfully.
aoc: Linking Object files....
aoc: Compiling for Emulation ....

 

------------------------------Make of hello world --------------------------------------------------------------------------------------

(base) wc@ign:~/Documents/opencl_fpga/exm_opencl_hello_world_x64_linux/hello_world$ make
../common/src/AOCLUtils/opencl.cpp: In function ‘_cl_program* aocl_utils::createProgramFromBinary(cl_context, const char*, _cl_device_id* const*, unsigned int)’:
../common/src/AOCLUtils/opencl.cpp:388:22: warning: ignoring attributes on template argument ‘cl_int {aka int}’ [-Wignored-attributes]
   scoped_array<cl_int> binary_status(num_devices);
                      ^

 

 

------------------------------Running hello world ---------------------------------------------------------------------

(base) wc@ign:~/Documents/opencl_fpga/exm_opencl_hello_world_x64_linux/hello_world$ bin/host
Querying platform for info:
==========================
CL_PLATFORM_NAME                         = Intel(R) FPGA SDK for OpenCL(TM)
CL_PLATFORM_VENDOR                       = Intel(R) Corporation
CL_PLATFORM_VERSION                      = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 19.2

ERROR: CL_DEVICE_NOT_FOUND
Location: ../common/src/AOCLUtils/opencl.cpp:356
Query for number of devices failed

Sergey_I_Intel1
Employee
1,532 Views

Vinay,

Please, check that you set the environment variable CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=<number_of_devices>.

For more information about emulating OpenCL Kernels read here.

 

Best regards,

Sergey

Kulkarni__Vinay
New Contributor I
1,531 Views

Thanks Sergey, it really helped.

 

HMaha5
Beginner
1,531 Views

Hi Sergey,

       I work in Vinay's team. I was trying out the Sobel Filter Design Example. While compiling the host code I got this error 

host/src/display.cpp:23:10: fatal error: SDL2/SDL.h: No such file or directory
 #include <SDL2/SDL.h>
          ^~~~~~~~~~~~
compilation terminated.
../common/src/AOCLUtils/opencl.cpp: In function ‘_cl_program* aocl_utils::createProgramFromBinary(cl_context, const char*, _cl_device_id* const*, unsigned int)’:
../common/src/AOCLUtils/opencl.cpp:388:22: warning: ignoring attributes on template argument ‘cl_int {aka int}’ [-Wignored-attributes]
   scoped_array<cl_int> binary_status(num_devices);
                      ^
Makefile:74: recipe for target 'bin/host' failed
make: *** [bin/host] Error 1

 

Please help me to solve this.

 

Thanks and regards,

Hamsika.
 

PVeli
Beginner
1,426 Views

Use this library in ur path.It will work 

cheers,

Prithvi (ISRO)

Dmitry_V_Intel
Employee
1,531 Views

Hi Hamsika,

Sorry for delay.

Could you please check that you have libsdl2-dev on your machine?

If not, you can install it by executing this command:

sudo apt-get install libsdl2-dev

Reply