cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

OpenCL 2.1 access violation -> strange solution ?

Hi,

I have a strange crash with my code; I explain, when I do this  have a crash :

Ray shadowRay;
... set up the shadow ray ...
Intersect(&shadowRay, &rayHit, scene);

When I do this , I have no crash :

Ray shadowRay;
... set up the shadow ray ...
Ray shadowRay2;
rayCopy(shadowRay2, shadowRay);
Intersect(&shadowRay2, &rayHit, scene);

Strange, no ?

 

0 Likes
8 Replies
spectral
Adept II

I have test it under NVidia OpenCL and I have no problem, so I suspect a bug in the AMD SDK 😞

0 Likes

viewon01,
Is the crash on the CPU or GPU? Does it occur during compilation or execution?
0 Likes

Hi Micah,

This crash occur during run-time on the CPU.

0 Likes

viewon1,
Most likely you have a buffer overrun in your code. On the GPU memory is protected from buffer overruns(DX requirement), so you won't crash if this occurs. However, no protection is available on the CPU.
0 Likes

Hi Michah,

How can I have a buffer overrun on the CPU ?

To solve the problem, I just create a new variable, copy the data from the original one and use the new one !!!!

I do nothing else than creating a copy of the variable !

Also, I have no problem with the NVidia version !

How can I check this ?

0 Likes

Allocate larger buffers, say twice the size, does it fix the issue?
0 Likes

Hi Micah,

Which buffer ? it is a local variable, not a buffer !

NB: or maybe I miss something ?

0 Likes

maybe something like this: rayCopy(&shadowRay2, shadowRay);

If ray is a variable, you have to send the pointer to it, so the function can change the value?

Maybe you have a residual value that doesn't represent a ray, so the intersection ands up somewhere where it is not allowed, following a pointer from the structure Ray, which isn't initialised, because the function Copy didn't change it's value.

 

[edit] sorry, I thought the second code gave the crash, not the first

0 Likes