OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Segmentation fault with intel opencl for linux

wang_f_
Beginner
424 Views

Hi,

We have tried to accelerate our program with intel opencl on Windows 7.The program works successfully.

And now,we want to switch to Linux(with the same hardware) . So we installed the driver and  intel opencl SDK for linux.We download the sample code and also running without any fault.However, after running my own program ,it returns Segmentation fault.We use GDB to locate the fault and we get this:

2529            status = clEnqueueNDRangeKernel(
(gdb) n
2538                NULL);
(gdb) n
2541            status=clFinish(cmdQueue1);
(gdb) p status
$2 = 0
(gdb) n

Thread 3 "GAKnot1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee418700 (LWP 3221)]

More Details:

OS:Ubuntu 16.04LTS

Driver Version:1.2.0.400      (PS:from clinfo)

Devices Name:Intel(R) Core(TM) i7-6700k CPU @ 4.00GHz  (PS:from clinfo)

We installed SRB4 driver package.

My question is as follows:

1.Does it mean the Segmentation Fault is caused by kernel?

2.How to debug with kernel?Are there any tools for Ubuntu ?

Thanks for your attention.

Regards

 

 

0 Kudos
1 Reply
Jeffrey_M_Intel1
Employee
424 Views

Sorry for the delayed reply.  Very glad you were able to get the samples to work, since this is good evidence that your install is correct.

If clFinish returns 0 this should indicate that all queued commands (including the kernel execution) have finished.  However, it is suspicious that the segmentation fault happens right after clFinish. Is there any way you can send a reproducer?  Please feel free to send a private message if you don't want the code on a public forum.

There is a GPU kernel debugger for Linux.  For more info: https://software.intel.com/en-us/node/671870

From the Developer Guide: "It's important to use separate machines, as the debugging on the GPU takes place at real-time and the screen cannot render (is frozen) while you are debugging your kernel on the GPU."

Reply