[SOLVED] Stack overflow if I use Acceleration structures with complex Trees (many levels)

Hi, I tried to use “Bvh” for Group Node for days but I failed.

My Optix hierarchy it is created as follow: I have three layers of Group Objects: MainNode, TOptixGroupObject(GLItem) and TOptixGroupObject(GLMesh).

Under the TOptixGroupObject(GLMesh) node, the last Group Objects, I have one Transform Object then a GeometryGroup, then a GeometryInstance finally a Geometry Object (classical structure).

I’ve created Accelerators for Group Objects and GeometryGroup Objects.

The “Bvh” works fine for GeometryGroup Objects (trinagle meshes) but not for Group Objects. The only way to obtain a valid image is to use “NoAccel” for Group Objects (still using “Bvh” for GeometryGroup Objects).

If I use “Bvh” acceleration type for Group Objects, I get only black boxes (the exact size of the bounding boxes of the GeometryGroup Objects)

See the images below.

P.S. I’m using Optix 3.5.1 32 bit, Cuda 6.0 (or 5.5) with a GTX 460M card

Thank you

A. Delle

[EDIT] More updated informations HERE




According to the release notes, OptiX 3.5.1 supports CUDA up to version 5.5, maybe CUDA 6 is causing the problem?

Thank you.

I’ve just tried to install the NVidia Drivers 320.49 WHQL (Cuda 5.5) without solving.

I get the same exact images (same behavior)

I’m probably missing something but I cant figure it out what…

you sure you also switch the traversal algorithm?

Yes ‘Bvh’ for both…

I don’t set “refine” and “refit” values for BVH traversal algorithm (using default value) maybe in the afternoon (I’m in Italy) I’ll do some test on this…

[UPDATE] No acceleration type different from “NoAccel” works, every acceleration different from “NoAccel” render only black bounding boxes…

Thx

I’ve seen that in you code that you set the accelerators only to GeometryGroups, in my case I use them for GeometryGroups and for “simple” Groups (no geometry only tree structure).

In my case GeometryGroups work (any accelerator) but Groups don’t (black BBox) maybe its an Optix bug?

AD

I’ve seen, in your code, that you set the accelerators only to GeometryGroups, in my case I use them for GeometryGroups and for “simple” Groups (no geometry only tree structure).

In my case GeometryGroups work (any accelerator) but Groups don’t (black BBox) maybe its an Optix bug?

AD

I don’t use groups at all, so i can’t accelerate them :)

did you check out sample7?
it’s possible to switch between acceleration enabled and not enabled…

Thank you, I’ll try to change the tree structure

Added exception handling to my code.

The problem was due to “RT_EXCEPTION_STACK_OVERFLOW”.

I’ve made some test to get the minimal configuration that cause the Problem (exception if I use an acceleration structure):

If I use just one top Group object with GeometryGroups children it works (“bvh” accel on for Group Accelerator)

If I use one top Group object with Tranform Objects children each with its GeometryGroup child, it doesn’t work (with “bvh” I get the exception, with “NoAccel” works fine)

If I use one top Group object with Groups Objects children each with its GeometryGroup child, it doesn’t work (with “bvh” I get the exception, with “NoAccel” works fine)

Somewhat it is connected with the depth of the Tree.

AD

If you get a stack overflow exception, you should increase the stack size.

See “3.1.3. Global State” in the OptiX Programming guide.

Works !

Changing the Optix Stack Size from 1024 (default size) to 2048 solved…

Thanks a lot!

As a design note, the programming guide also recommends minimizing the stack size:

And this is pretty easy to do:

if( error_code[id] == RT_EXCEPTION_STACK_OVERFLOW ){
	context->setStackSize( context->getStackSize()+some_increase );
	...

But if you’re not worried about using too much GPU memory, no biggy…

OK, I’ll try to increment the Stack little by little.

AD