Odd Callable Program Behavior in 3.5.1

When upgrading to Optix 3.5.1 (after 3.6.2 didn’t work) I have a spot in my code where a callable program crashes with the similar error i was having in 3.0.

OptiX Error: Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: Kernel launch returned (700): Launch failed, [6619200])

What is absurdly odd is that if i put an if I wrap it into an conditional statement such as frame > 0, it runs without a problem.

if (frame > 0 ){
   float radiance = camera_integrator(0.f, 0.f, 0.f);

Frame’s initial value is set to 1. However if i put if (true) it crashes again, I suppose it does some optimization and pull it out of the code.

Has anyone else run into an issue like this?

I had a similar problem in OptiX 3.6.0 using the 32-bit version. If you are using the 32-bit version, you might see if you get different behavior compiling your application as 64-bit, or the other way around. I believe you are correct about compiler optimization occurring.

Here’s my post about the issue: Callable program buffer: Assertion failed

Just out of curiosity, why did you downgrade to OptiX 3.5.1? My understanding is that the callable program implementation in that version is even less robust than in 3.6.0 or 3.6.2.

For Optix 3.6 & 3.6.1 the 32-bit version did not work at all. The 64-bit version was able to run but when using callable programs it would not produce correct results. For example if I had a callable program where I passed in a constant and then return the value, it would return random numbers or just 0. This behavior was was unacceptable so I installed 3.5.1 to see what it would do. Apparently 32/64 bit version worked properly so I decided to stick with that.

You replied to my other thread when I was discussing my issues with the 3.6 series:

I do like the new design changes with the 3.6 series but if I can’t get it to evaluate expressions properly I really can’t see myself using it.

Just to be clear, your callable program is working under 3.5.1? I was under the impression from your original post in this thread that your callable program was not working under either 3.5.1 or 3.6.0/3.6.2.

The callable program only works in 3.5.1 with that hackish if statement wrapping that I mentioned. However with 3.6/3.6.2 it just returns bogus values.