Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
723 Discussions

Error in using emulator mode with SDK 20.1 for hello_world example

beiwang2003
Beginner
3,203 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
3,164 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-p/731970

Please let us know whether it helps. 

Thanks and Regards

Anil

0 Kudos
beiwang2003
Beginner
3,153 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

0 Kudos
AnilErinch_A_Intel
3,138 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

0 Kudos
AnilErinch_A_Intel
3,129 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


0 Kudos
AnilErinch_A_Intel
3,105 Views

Hi ,

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

Thanks and Regards

Anil


0 Kudos
PVeli
Beginner
3,089 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

0 Kudos
AnilErinch_A_Intel
3,037 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-emulated-HelloWorld-example-on/td-p/34890

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

Thanks and Regards

Anil

0 Kudos
AnilErinch_A_Intel
3,033 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-emulated-HelloWorld-example-on/td-p/34890

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

Thanks and Regards

Anil


0 Kudos
Reply