Forum Discussion

Kulkarni__Vinay's avatar
Kulkarni__Vinay
Icon for New Contributor rankNew Contributor
6 years ago
Solved

aoc error for emulation

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.

  • 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

8 Replies

  • 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

  • Hello Intel Folks,

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

  • 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

  • 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

  • HMaha5's avatar
    HMaha5
    Icon for New Contributor rankNew Contributor

    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.

  • 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