I got a segfault in clEnqueueReadBuffer reading the result of a kernel. I run my kernel a first time w/o problems and then I exchange the variables and run it again where it crashes with a segfault. But the behavior is not ‘perfectly reliable’. Sometimes it works in debug mode but not in normal mode, but most of the time it does not work at all. So I assume it is a memory issue. I checked all the variables that go in and out of clEnqueueReadBuffer regarding their sizes, but I could not find an error. Where else could the error hide? How would you debug this error?
Hello,
I’m a novice programmer myself, but I thought I’d throw out a few things I’ve learned:
Make sure that the Kernel itself is operating correctly. Is it returning an error? I had an issue reading back memory that had been corrupted in the Kernel, and it didn’t show up until I tried to read it back.
What are the sizes that work? What sizes don’t work? Have you checked the maximum sizes you are allowed on your device?
Hope this is a starting point, and perhaps someone who is a better programmer than I am can come along and help out more!
Hello,
I’m a novice programmer myself, but I thought I’d throw out a few things I’ve learned:
Make sure that the Kernel itself is operating correctly. Is it returning an error? I had an issue reading back memory that had been corrupted in the Kernel, and it didn’t show up until I tried to read it back.
What are the sizes that work? What sizes don’t work? Have you checked the maximum sizes you are allowed on your device?
Hope this is a starting point, and perhaps someone who is a better programmer than I am can come along and help out more!