Creating multiple pipelines with different __raygen__

The pipeline is coupled with the Shader Binding Table (SBT).
Each pipeline needs its own SBT which contains the matching SBT record headers (32 bytes of information about your pipeline’s entry point functions).

Check your calls to optixSbtRecordPackHeader() for the ray generation program groups and the raygenRecord field in your shader binding tables (plural!).

You can not switch only the pipeline inside the optixLaunch().
Means your &sbt argument should be &sbt[i] instead.

Related thread:
https://forums.developer.nvidia.com/t/how-to-handle-multiple-ray-generators/83446

Related search for “SBT” in this OptiX forum for more information:
https://forums.developer.nvidia.com/search?q=SBT%20%20%23visualization%3Aoptix

Related chapters inside the OptiX Programming Guide:
https://raytracing-docs.nvidia.com/optix7/guide/index.html#program_pipeline_creation#program-pipeline-creation
https://raytracing-docs.nvidia.com/optix7/guide/index.html#shader_binding_table#shader-binding-table