Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16556 Discussions

OpenCL_Library : Exemple 1 :Segmentation fault (core dumped)

Altera_Forum
Honored Contributor II
2,178 Views

Hi, 

I'm trying to excute the example OpenCL Library (Exemple 1) (Link Below). I generated my excutable file for My FPGA Arria 10. Then I get this message when I execute : Segmentation fault (core dumped).! 

What does it mean ? How I can find the error knowing that I follwed all steps and it works well. 

https://www.altera.com/support/support-resources/design-examples/design-software/opencl/library-design-example.html 

 

 

Thank You.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,206 Views

Segmentation faults usually occur when the executable tries to access a memory it does not have access to and may be difficult to debug (such as accessing data past a pointer's allocated space). The example should work out of the box if the binary is generated and in the expected location for the host to find. Otherwise using a debugger would be helpful to find out where the segfault is happening.

0 Kudos
Altera_Forum
Honored Contributor II
1,206 Views

Thank you , 

The example 1 doesn't' work and the binary file is generated successfully. Note that I'm using a Nallatech Board with Arria 10 FPGA and SDK for Opencl under Linux OS. Which debugger you use ?
0 Kudos
Altera_Forum
Honored Contributor II
1,206 Views

I normally use gdb which i found to be pretty helpful. If you run it on your host application, you'll need to ignore interrupts otherwise it will treat them as breakpoints for SIG44 and SIG64 (https://www.altera.com/en_us/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf#_opentopic_toc_processing_d116e18533) or just continue whenever you hit a break from the interrupt signal. Then you can use a backtrace (bt) when the debugger hits the seg fault and it can tell you what line it is occurring on. 

 

Also you'll need to add the -g flag to gcc to enable debug info to get more meaningful information from gdb.
0 Kudos
Altera_Forum
Honored Contributor II
1,205 Views

Hi fand, 

 

Seems like this folder is not been update yet for some bug. I have modified the host file alittle, can you try to use this version of main.cpp ? 

 

 

 

Regards, 

CloseCL 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Reply