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.
438 Discussions

Error in using emulator mode with SDK 20.1 for hello_world example

beiwang2003
Beginner
792 Views

I have quartus 19.2 and FPGA SDK 20.1. When trying to compile the OpenCL code with emulator mode:  aoc -march=emulator -o ./bin/hello_world.aocx ./device/hello_world.cl, I had the following error message in running the code. The problem is resolved by using -legacy-emulator option. Same problem and solution for SDK 19.4. My question is when do I need to use -legacy-emulator option for SDK 19.4 and beyond?  Thanks

[beiwang@della-fpga1 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 20.1

 

Querying device for info:

========================

CL_DEVICE_NAME                           = EmulatorDevice : Emulated Device

CL_DEVICE_VENDOR                         = Intel(R) Corporation

CL_DEVICE_VENDOR_ID                      = 4466

CL_DEVICE_VERSION                        = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version 20.1

CL_DRIVER_VERSION                        = 20.1

CL_DEVICE_ADDRESS_BITS                   = 64

CL_DEVICE_AVAILABLE                      = true

CL_DEVICE_ENDIAN_LITTLE                  = true

CL_DEVICE_GLOBAL_MEM_CACHE_SIZE          = 32768

CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE      = 0

CL_DEVICE_GLOBAL_MEM_SIZE                = 403931233280

CL_DEVICE_IMAGE_SUPPORT                  = false

CL_DEVICE_LOCAL_MEM_SIZE                 = 16384

CL_DEVICE_MAX_CLOCK_FREQUENCY            = 1000

CL_DEVICE_MAX_COMPUTE_UNITS              = 1

CL_DEVICE_MAX_CONSTANT_ARGS              = 8

CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE       = 100982808320

CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS       = 3

CL_DEVICE_MEM_BASE_ADDR_ALIGN            = 8192

CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE       = 1024

CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR    = 4

CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT   = 2

CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT     = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG    = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT   = 1

CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE  = 0

Command queue out of order?              = true

Command queue profiling enabled?         = true

Using AOCX: hello_world.aocx

Context callback: Malformed program binary: missing .acl.board section

Context callback: kernel argument info is not available

Context callback: Invalid binary

ERROR: CL_INVALID_BINARY

Location: ../common/src/AOCLUtils/opencl.cpp:407

Failed to create program with binary

0 Kudos
8 Replies
AnilErinch_A_Intel
753 Views

Hi, 

This could be related to the  Altera.icd file being used in the system. 

Please see a thread below which discusses a similar issue. 

https://community.intel.com/t5/Intel-High-Level-Design/Error-when-performing-emulation-for-v19-3/td-...

Please let us know whether it helps. 

Thanks and Regards

Anil

beiwang2003
Beginner
742 Views

Hi, Anil,

I've tried this by replacing the current Altera.icd file at /etc/OpenCL/vendors/ with the one at .../19.4/hld/Altera.icd. It is still the same error message during running:Context callback: Malformed program binary: missing .acl.board section

Thanks

Bei

AnilErinch_A_Intel
727 Views

Hi,
It turns out that From version 19.4 onwards there are two options available

1. Legacy emulator

export CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1

./host -legacy-emulator

2. If you want to use the fast emulator

export CL_CONFIG_CPU_EMULATE_DEVICES=1

./host -emulator

Please try both the options and  let us know about the  performance.

Thanks and Regards
Anil

AnilErinch_A_Intel
718 Views

Hi ,

Please let us know whether the below options

1. Legacy emulator

export CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1

./host -legacy-emulator

2. If you want to use the fast emulator

export CL_CONFIG_CPU_EMULATE_DEVICES=1

./host -emulator

Helped in resolving the issue

Thanks and Regards

Anil


AnilErinch_A_Intel
694 Views

Hi ,

Please let us know whether the previous suggestion was helpful, and whether the issue was resolved.

Thanks and Regards

Anil


PVeli
Beginner
678 Views

Hello Anil,

When I am using legacy emulator for 19.3 I am getting following error. Please suggest me asap.

Platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
Using AOCX: traffic_stn.aocx
Context callback: clCreateProgramWithBinary failed
ERROR: CL_INVALID_BINARY
Location: ../common/src/AOCLUtils/opencl.cpp:392
Failed to create program with binary

AnilErinch_A_Intel
626 Views

Hi ,

for the latest error message which you are getting please refer the below forum link

https://community.intel.com/t5/Intel-Quartus-Prime-Software/Got-CL-INVALID-BINARY-error-when-emulate...

and let us know whether the suggestions outlined there helps to solve the issue.

Thanks and Regards

Anil

AnilErinch_A_Intel
622 Views

Hi ,

for the latest error message which you are getting please refer the below forum link

https://community.intel.com/t5/Intel-Quartus-Prime-Software/Got-CL-INVALID-BINARY-error-when-emulate...

and let us know whether the suggestions outlined there helps to solve the issue.

Thanks and Regards

Anil


Reply