I may have discovered a bug using image2d_t in opencl code. I can get the clBuildProgram() call to crash (AccessViolation) every time when I have a kernel that looks like this:
__kernel void BoxRowsTex( __read_only image2d_t SourceRgbaTex, __global unsigned int* uiDest, sampler_t RowSampler,
unsigned int uiWidth, unsigned int uiHeight, int iRadius, float fScale)
{
}
When I don’t use any image2d_t and/or sampler_t calls in the kernel it causes the clBuildProgram to crash.
I’m having the same problem, but it is not related to image2d_t. I switched to developer driver 260.61 yesterday (on Windows XP).
The code below will crash clBuildProgram() with an access violation. Comment out the kernel’s body (leaving an empty kernel, i.e. {}) and it will still crash, comment out the remaining functions and it will build.
I have two or three different kernels crashing that way.
I’m having the same problem, but it is not related to image2d_t. I switched to developer driver 260.61 yesterday (on Windows XP).
The code below will crash clBuildProgram() with an access violation. Comment out the kernel’s body (leaving an empty kernel, i.e. {}) and it will still crash, comment out the remaining functions and it will build.
I have two or three different kernels crashing that way.
Two things, first thank you SOOOOO much for solving my problem. You have to actually use the image2d_t, otherwise it crashes. Second, yes, I can verify that this is a problem, under a slightly different environment: Ubuntu 10.10 Linux Kernel 2.6.35-23-generic, driver version NVIDIA 260.19.14.
The behavior was exactly the same: if an image2d_t appears as a kernel argument, it MUST be used at least once in the kernel, otherwise, it will cause a segmentation fault when clBuildProgram is called. This is a bug because clBuildProgram must either succeed or let us print the error log. It cannot seg fault (or access violation) if the kernel source code looks wrong. That makes it extremely hard for developers to pin down the problem (it already wasted six hours of my time). I am not sure if the bug report has been filed, but I am putting a report together.
Moral of the story is it works fine, just make sure you use both the sampler and the image2d_t at least once.
Two things, first thank you SOOOOO much for solving my problem. You have to actually use the image2d_t, otherwise it crashes. Second, yes, I can verify that this is a problem, under a slightly different environment: Ubuntu 10.10 Linux Kernel 2.6.35-23-generic, driver version NVIDIA 260.19.14.
The behavior was exactly the same: if an image2d_t appears as a kernel argument, it MUST be used at least once in the kernel, otherwise, it will cause a segmentation fault when clBuildProgram is called. This is a bug because clBuildProgram must either succeed or let us print the error log. It cannot seg fault (or access violation) if the kernel source code looks wrong. That makes it extremely hard for developers to pin down the problem (it already wasted six hours of my time). I am not sure if the bug report has been filed, but I am putting a report together.
Moral of the story is it works fine, just make sure you use both the sampler and the image2d_t at least once.