Hi,
I have a codebase based of an Optix SDK sample that worked fine in Optix 7.3, needed little mending for 7.6, but does not work anymore in Optix 7.7. I checked the release notes and couldn’t find any indications for breaking changes. The Optix SDK examples all work fine though.
The specific issues I encounter are:
- During runtime time the following call, which is a sort of sanity check throws: “invalid Bitcode” upon optixModuleCreate
OptixModuleCompileOptions module_compile_options2 = {};
#if !defined( NDEBUG )
module_compile_options2.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_0;
module_compile_options2.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
endif
OptixPipelineCompileOptions pipeline_compile_options2 = {};
OPTIX_CHECK_LOG(optixModuleCreate(
state.context,
&module_compile_options2,
&pipeline_compile_options2,
ptx.c_str(),
ptx.size(),
log,
&sizeof_log,
moduleptr));
- When using the correct options (either the set that worked in Optix 7.6 or the adapted versions for Optix 7.7 with new fields added, see below):
OPTIX_CHECK_LOG(optixModuleCreate(
state.context,
&module_compile_options,
&state.renderpipe.options,
ptx.c_str(),
ptx.size(),
log,
&sizeof_log,
moduleptr));
I obtain:
Caught exception: OPTIX_ERROR_INVALID_VALUE: Optix call ‘optixModuleCreate( state.context, &module_compile_options, &state.renderpipe.options, ptx.c_str(), ptx.size(), log, &sizeof_log, moduleptr)’ failed: …\program_manager.cpp:72)
Log:
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠…
OptixModuleCompileOptions module_compile_options = {
100, // maxRegisterCount
OPTIX_COMPILE_OPTIMIZATION_DEFAULT, // optLevel
//OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO // debugLevel // Optix 7.3
DEBUG_LEVEL_LINE // debugLevel // Optix 7.6+
, // Below only for Optix 7.7
nullptr, // OptixModuleCompileBoundValueEntry → ignored
0, // numBoundValues → ignored
0, // numPayloadTypes → has to be 0, because “OptixPipelineCompileOptions::numPayloadValues” is not zero
nullptr // OptixPayloadType* → ignored because OptixPipelineCompileOptions are used
};
state.renderpipe.options = {
false, // usesMotionBlur
OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_ANY, // traversableGraphFlags
4, // numPayloadValues
3, // numAttributeValues
OPTIX_EXCEPTION_FLAG_NONE, // exceptionFlags
"params" // pipelineLaunchParamsVariableName
, // Below only for Optix 7.7
OPTIX_PRIMITIVE_TYPE_CUSTOM, // usesPrimitiveTypeFlags
static_cast<int>(false) // allowOpacityMicromaps
};
My build system uses Cuda 12.2, Optix 7.7, Visual Studio 2022, Windows 10 64bit. It doesn’t matter if I build using NVRTC or not. It seems the signature of the compile options changed somewhere, but I verified that all new fields are ignored. I use custom type primitives as specified in OptixBuildInput.type: OPTIX_BUILD_INPUT_TYPE_CUSTOM_PRIMITIVES.
Do you have any idea what the reason could be, given that the code works in 7.6 but not 7.7?
Best
Tobias