Get Error when using Group Node

Here is my test code:

This one works perfect:

list<Transform> transs;
for each (auto geo in gis)
{
	auto trans = context->createTransform();
	//auto group = context->createGroup();
	auto geoGroup = context->createGeometryGroup();
	geoGroup->addChild(geo);
	//group->addChild(geoGroup);
	trans->setChild(geoGroup);
	geoGroup->setAcceleration(context->createAcceleration("Trbvh"));
	//group->setAcceleration(context->createAcceleration("Trbvh"));
	transs.push_back(trans);
}

Group shadow_group = context->createGroup(transs.begin(), transs.end());
shadow_group->setAcceleration(context->createAcceleration("Trbvh"));
context["top_object"]->set(shadow_group);

But this one gets error:

list<Transform> transs;
for each (auto geo in gis)
{
	auto trans = context->createTransform();
	auto group = context->createGroup();
	auto geoGroup = context->createGeometryGroup();
	geoGroup->addChild(geo);
	group->addChild(geoGroup);
	trans->setChild(group);
	geoGroup->setAcceleration(context->createAcceleration("Trbvh"));
	group->setAcceleration(context->createAcceleration("Trbvh"));
	transs.push_back(trans);
}

Group shadow_group = context->createGroup(transs.begin(), transs.end());
shadow_group->setAcceleration(context->createAcceleration("Trbvh"));
context["top_object"]->set(shadow_group);

Here is the error message:

Unknown error (Details: Function "_rtCommandListExecute" caught exception: Encountered a CUDA error: cudaDriver().CuEventSynchronize( m_event ) returned (700): Illegal address)
Unknown error (Details: Function "bufferMap" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoH( dstHost, srcDevice, byteCount ) returned (700): Illegal address)

Anyone knows why?

Try this one, no error but also no effect.

list<Transform> transs;
for each (auto geo in gis)
{
	auto trans = context->createTransform();
	auto group = context->createGroup();
	auto geoGroup = context->createGeometryGroup();
	geoGroup->addChild(geo);
	//group->addChild(geoGroup);
	trans->setChild(group);
	geoGroup->setAcceleration(context->createAcceleration("Trbvh"));
	group->setAcceleration(context->createAcceleration("Trbvh"));
	transs.push_back(trans);
}

Group shadow_group = context->createGroup(transs.begin(), transs.end());
shadow_group->setAcceleration(context->createAcceleration("Trbvh"));
context["top_object"]->set(shadow_group);

It seems that “group” can’t be used, but why?

Ok
I know, the “Group” node can only be used at the top of the node graph…

That’s not true. Group nodes can be set as child to other Group or Transform nodes (or Selector nodes, but those are not available in the default OptiX 6 RTX execution strategy.)

Please have look at the *SetChild() functions inside the OptiX API Refence which list the valid child objects:
https://raytracing-docs.nvidia.com/optix_6_0/api_6_0/html/group___group_node.html#ga8f0c16eadde731ab70e0df7b07a51820
https://raytracing-docs.nvidia.com/optix_6_0/api_6_0/html/group___transform_node.html#ga32327bde6ffe75d26194f897126c0988

Please always provide the following system configuration information when asking about OptiX issues:
OS version, installed GPU(s), VRAM amount, display driver version, OptiX major.minor.micro version, CUDA toolkit version used to generate the input PTX, host compiler version.

Your first working version is the most efficient layout.

So, what should I do to make it available in OptiX 6?

I met a new problem with these Graph Nodes.

Here is my graph:     
                 Group
               |     |
        Transform  Transform
       |      |    |       |
   GeoIns GeoIns GeoIns  GeoIns
     |       |     |       |
    Geo     Geo   Geo     Geo

And I got this error again:

Unknown error (Details: Function “_rtCommandListExecute” caught exception: Encountered a CUDA error: cudaDriver().CuEventSynchronize( m_event ) returned (700): Illegal address)

It seems that I have to disable the RT_GLOBAL_ATTRIBUTE_ENABLE_RTX to let them work. But it’s ridiculous…

OS:windows10 Version 1809, 2080Ti, display driver version 425.31, OptiX6.0.0, CUDA 10.1.105_418.96
Visual studio 2019, MSVC 14.2

To be able to analyze that further you would need to provide a minimal complete reproducer in failing state along with the requested system configuration information of the development environment and target machine which shows the problems you reported.

Sorry, but that graph is invalid. You cannot assign GeometryInstances to Transform nodes.
There are GeometryGroup nodes missing between the Transform and GeometryInstance nodes and each Transform node can hold only one child.

(Please don’t quote the whole previous message when just adding additional posts. I cleaned them up for easier reading.)

You could try the previous 419 or the newer 430.39 display drivers to see if the behaviour changes.
In either case, please test first if the pre-compiled OptiX 6.0.0 SDK examples run.

Oh, that’s my mistake, the actual graph I have used looks like this:

Here is my graph:     
                 Group
               |     |
        Transform  Transform
           |           |
         GeoGro      GeoGro
       |      |    |       |
   GeoIns GeoIns GeoIns  GeoIns
     |       |     |       |
    Geo     Geo   Geo     Geo

The pre-compiled OptiX 6.0.0 SDK examples run very well.
I will try to change the display driver and give feedback later.

By the way, do I have to use GeometryTriangle to enable the RTCore?

If this problem still exists, I will provide a minimal complete reproducer for you.

And thanks for your reply.

This forum is too hard to use… I don’t know how to correctly quote others reply…

Yes, to use the hardware triangle intersection inside the RT cores on RTX boards you need to use the GeometryTriangles.
The BVH traversal over the AABBs of any geometric primitive will always run in hardware on these RTX boards, means also for custom geometric primitives in Geometry nodes with your own intersection and bounding box programs. Using GeometryTriangles gives the best speedup.

On boards without RT cores, you can use the exact same scene. OptiX 6 handles the BVH traversal and triangle intersection on the GPU’s streaming multiprocessors like all OptiX versions before.

I’ve fixed up your posts.
You can use the “Preview” button to see what your post will look like before replying.

The quotes are just text blocks surrounded by tags like this, but without the spaces:
[ quote ]This text will appear as quote on darker background.[ / quote ]
[ quote ][ quote ]If you nest the quote tags, the inner background gets an even darker background.[ / quote ][ / quote ]

Now without the spaces in the tags: