hi all,
i’ve been banging my head against this all day…my cuda program keeps crashing and i cannot figure out why. if i take out (seemingly) random lines it works fine. also, running emudebug runs everything fine.
for example:
float specular = dotProduct(&ref, &rayDir);
if (specular != 0) {
specular=0;
}
specular = pow(specular, KS_EXP);
unsigned char red = (unsigned char)(color*specular*KS_DEFAULT);
crashes. while:
float specular = 0;
if (specular != 0) {
specular=0;
}
specular = pow(specular, KS_EXP);
unsigned char red = (unsigned char)(color*specular*KS_DEFAULT);
works fine. also,
float specular = dotProduct(&ref, &rayDir);
specular=0;
if (specular != 0) {
specular=0;
}
specular = pow(specular, KS_EXP);
unsigned char red = (unsigned char)(color*specular*KS_DEFAULT);
works as well.
from this one might think dotProduct() is the problem:
__device__ inline float dotProduct(float3 *r1, float3 *r2) {
float dot = (r1->x*r2->x) +(r1->y*r2->y) +(r1->z*r2->z);
return dot;
}
i call this function else where, and it seems to work fine. also, i’ve verified all variables contain “valid” data. is there a maximum execution time, or size, for a kernel? ANY ideas would be helpful.