IntelĀ® High Level Design
Support for IntelĀ® High Level Synthesis Compiler, DSP Builder, OneAPI for IntelĀ® FPGAs, IntelĀ® FPGA SDK for OpenCLā„¢
661 Discussions

OpenCL software emulation crashes when the Kernel uses more than 6MByte of memory

FPorr
Beginner
1,570 Views

Hello,

 

the OpenCL software emulation crashes with a segmentation fault when the kernel utilizes more than 6MByte of memory. Example:

uchar arr[128*128*384]; // 6MByte -- Works uchar arr[128*128*385]; // more than 6MByte -- Segmentation Fault

If this behavior is intended, a warning message would be appreciated, to prevent people from searching for a non-existing bug in their code.

 

Setup:

Ubuntu 16.04.2

Intel FPGA SDK for OpenCL 18.0.0-219

 

Tested Boards:

Arria 10 (ref BSP and BSP of custom hardware)

Stratix 10 (only BSP of custom hardware)

0 Kudos
7 Replies
KhaiChein_Y_Intel
1,039 Views

Hi,

 

May I request the testcase for replication? What is the cmd you are executing?

 

Thanks.

 

0 Kudos
FPorr
Beginner
1,039 Views

Hi,

 

thank you for the reply, I attached a simple test case to reproduce the error.

The build commands I used were:

# Host application make # Kernel aoc -march=emulator krnl.cl -o bin/krnl_emu.aocx

and for execution:

CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1 bin/host bin/krnl_emu.aocx

Depending on which size define is enabled in krnl.cl, the application either crashes or executes.

0 Kudos
KhaiChein_Y_Intel
1,039 Views
Hi, Thanks for the attachment. Please allow me some time to look into this. Thanks. (1507183204)
0 Kudos
KhaiChein_Y_Intel
1,039 Views
Hi, A lot has changed in the emulator since 18.0, not only in the old emulator flow (now called legacy emulator), but there is now a new emulator that replaces it in 19.1 (the fast emulator). Can you try this in 19.1 with the new fast emulator? Thanks,
0 Kudos
KhaiChein_Y_Intel
1,039 Views
Hi, May I know if you have any updates? Thanks
0 Kudos
FPorr
Beginner
1,039 Views

Hi,

 

I am sorry for the late response. I installed 19.1 but trying to compile any kernel using the fast emulator fails with:

Error: OpenCL kernel compilation FAILED

The ioc.log contains the following lines:

Using build options: -cl-std=CL1.2 -Xclang -Wuninitialized -I "/home/user/vector_add/device"

Failed to get platform id...: 0 (CL_SUCCESS)

Compilation failed!

 

Any thoughts on what might be the problem?

0 Kudos
FPorr
Beginner
1,038 Views

Hi,

 

I managed to solve the problem. It did not work because I forgot to install a device ... šŸ˜Ÿ

Anyway, using the fast emulator indeed removed the problem, the application no longer crashes for data > 6MB.

Thank you for your assistance.

0 Kudos
Reply