Hi all.
First post here, I’m hoping someone can enlighten me on this error. I have a “CUDA_EXCEPTION_1” error from a piece of code carrying out an interpolation, it’s not always fired, so assume a race condition type fault, but have been having problems tracking this down further. Apologies if the code is hard to read
__device__ float _interpolate( float x, float y, float *img, int width, int height)
{
int xt = (int) x;
int yt = (int) y; // Top left corner
float ax = x - xt;
float ay = y - yt; // Fractional offsets
float *ptr = img + (width*yt) + xt; // Pointer to top left corner of image, a 1D array with step of "width"
return ( (1-ax)*(1-ay)* *ptr+ax *(1-ay)* *(ptr+1) +
(1-ax)*ay* *(ptr+(width)) +
ax*ay* *(ptr+(width)+1) );
}
Assertions and error checks has been removed for readability, but all checks on variables come back with correct values (debugger also confirms this). Code does work if converted to serial C function. Debug output, with memcheck on, gives this:
Program received signal CUDA_EXCEPTION_1, Lane Illegal Address.
[Switching focus to CUDA kernel 34, grid 35, block (12,0,0), thread (0,0,0), device 0, sm 3, warp 0, lane 0]
0x00000000009f6948 in _interpolate (x=warning: Variable is not live at this point. Returning garbage value.
1.79366203e-42, y=warning: Variable is not live at this point. Returning garbage value.
1.79366203e-42, img=warning: Variable is not live at this point. Returning garbage value.
0xfffb3800000500, width=320, height=warning: Variable is not live at this point. Returning garbage value.
- at cudaTrackFeatures.cu:172
172 return ( (1-ax)(1-ay) *ptr+ax (1-ay) *(ptr+1)+
The “dead” variables are, I assume, marked as such because the compiler has purged them before the return statement (and breaking before this point shows the variables do have the expected values), it’s the “CUDA_EXCEPTION_1, Lane Illegal Address” error that I am having trouble tracing.
Has anyone come across this error in similar code? Any help would be greatly appreciated
Btw, system specs are Tesla C2070, Ubuntu 10.04 64bit, and CUDA 4.0
Thanks, Pete