Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyOpenCl: how to debug segmentation fault?

I have PyOpenCL code with OpenCL C kernel code. I catch segmentation fault error when I run my app. How to debug such error with some debugger or some other development tool? I don't know what exactly to do to find out the problem. I have in mind option with printf or something but I want use more powerful stuff.

I believe that error in kernel code, so I want to debug kernel code firstly.

UPD. I'm on linux (Arch Linux, 3.6.11), python 2 or 3, PyOpenCl 2012.1

like image 662
petRUShka Avatar asked Jan 22 '13 21:01

petRUShka


1 Answers

Kernel debugging is an implementation-dependent affair. On Linux, the best I've found is to use AMD's CL implementation on the CPU, compile the kernel with -g, and use gdb. They've got instructions on this in their programming guide, here:

AMD CL Documentation page

like image 144
Andreas Klöckner Avatar answered Oct 06 '22 03:10

Andreas Klöckner