OPTIX_ERROR_INVALID_VALUE when calling optixCreatePipeline with basically empty programs

I repeatedly got OPTIX_ERROR_INVALID_VALUE when trying to create pipeline. After reading this post , I tried to “bisect” my code by commenting out all content in various programs. But even though I deleted everything from the .cu code except empty function definitions of the entries, I still got the OPTIX_ERROR_INVALID_VALUE error when trying to create pipeline.

I use nvrtc to compile and link modules and it seems that there’s no error or warning during the compile and program creation process. Here’s the log:

C:\Users\MartinZHe>"D:\CourseCode\OptixBasedRenderer\build\Debug\OptixBasedRenderer.exe"
Device Name : NVIDIA GeForce RTX 3060 Laptop GPU.
totalGlobalMem : 6143 MB.
sharedMemPerBlock : 49152.
regsPerBlock : 65536.
warpSize : 32.
memPitch : 2147483647.
maxThreadsPerBlock : 1024.
maxThreadsDim[0 - 2] : 1024 1024 64.
maxGridSize[0 - 2] : 2147483647 65535 65535.
totalConstMem : 65536.
major.minor : 8.6.
clockRate : 1.425 GHz.
textureAlignment : 512.
deviceOverlap : 1.
multiProcessorCount : 30.
original heap size: 8388608

- find materials in: D:/CourseCode/OptixBasedRenderer/assets/scenes/simple-objs/cube.mtl

- Cube  | vertices > 8  | texcoords > 14| normal| normals > 6ang| triangles > 0 | material: Material
=============== Module Link Log ===============
for module @ D:/CourseCode/OptixBasedRenderer/shaders/Background/SkySphereBackground.cu:
Info: Module uses 0 payload values.Info: Module uses 0 attribute values. Pipeline configuration: 2 (default).
Info: Entry function "__miss__sky_sphere_background" with semantic type MISS has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 1 basic block(s), 1 instruction(s)
Info: 0 non-entry function(s) have 0 basic block(s), 0 instruction(s)

=============== Program Group Create Log ===============

=============== Module Link Log ===============
for module @ D:/CourseCode/OptixBasedRenderer/shaders/Camera/PerspectiveCamera.cu:
Info: Pipeline parameter "params" size is 1 bytes
Info: Module uses 0 payload values.Info: Module uses 0 attribute values. Pipeline configuration: 2 (default).
Info: Entry function "__raygen__perspective_camera" with semantic type RAYGEN has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 1 basic block(s), 1 instruction(s)
Info: 0 non-entry function(s) have 0 basic block(s), 0 instruction(s)

=============== Program Group Create Log ===============

=============== Module Link Log ===============
for module @ D:/CourseCode/OptixBasedRenderer/shaders/Integrator/MonteCarloIntegrator.cu:
Info: Module uses 0 payload values.Info: Module uses 0 attribute values. Pipeline configuration: 2 (default).
Info: Entry function "__closesthit__monte_carlo_integrator" with semantic type CLOSESTHIT has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 1 basic block(s), 1 instruction(s)
Info: 0 non-entry function(s) have 0 basic block(s), 0 instruction(s)

=============== Program Group Create Log ===============

=============== Module Link Log ===============
for module @ D:/CourseCode/OptixBasedRenderer/shaders/Material/LambertianMaterial.cu:
Info: Module uses 0 payload values.Info: Module uses 0 attribute values. Pipeline configuration: 2 (default).
Info: Entry function "__direct_callable__lambertian_material" with semantic type DIRECT_CALLABLE has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 1 basic block(s), 1 instruction(s)
Info: 0 non-entry function(s) have 0 basic block(s), 0 instruction(s)

=============== Program Group Create Log ===============

=============== Module Link Log ===============
for module @ D:/CourseCode/OptixBasedRenderer/shaders/Mesh/TriangleMesh.cu:
Info: Module uses 0 payload values.Info: Module uses 0 attribute values. Pipeline configuration: 2 (default).
Info: Entry function "__direct_callable__triangle_mesh" with semantic type DIRECT_CALLABLE has 0 trace call(s), 0 continuation callable call(s), 0 direct callable call(s), 1 basic block(s), 1 instruction(s)
Info: 0 non-entry function(s) have 0 basic block(s), 0 instruction(s)

=============== Program Group Create Log ===============

Optix call (optixPipelineCreate(this->context, &pipeline_compile_options, &pipeline_link_options, CudaProgram::all_program_groups.data(), CudaProgram::all_program_groups.size(), log, &log_size, &(this->pipeline))) failed with code 7001 (line 60)
error name: OPTIX_ERROR_INVALID_VALUE
error string: Invalid value

Here’s my pipeline compile options and pipeline link options:

OptixPipelineCompileOptions compile_options = {};
    compile_options.usesMotionBlur = true;
    compile_options.traversableGraphFlags = OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_ANY;
    compile_options.numPayloadValues = 2;
    compile_options.numAttributeValues = 2;
    compile_options.exceptionFlags = OPTIX_EXCEPTION_FLAG_NONE;
    compile_options.pipelineLaunchParamsVariableName = "params";

OptixPipelineLinkOptions pipeline_link_options = {
        max_trace_depth,               // maxTraceDepth
        OPTIX_COMPILE_DEBUG_LEVEL_NONE // debugLevel
    };

I’ve also checked that CudaProgram::all_program_groups, which is a vector of program groups, contains no duplicated program groups.

What else could I try to solve this problem?

Hi APassbyDreg,
the OPTIX_ERROR_INVALID_VALUE indicates that a parameter you’re passing to optixPipelineCreate on host is causing problems. The post you mentioned and the advice to “bisect your optix program code” was about resolving a OPTIX_ERROR_PIPELINE_LINK_ERROR, i.e. a problem with the device code of the pipeline that’s being created.
I would start double-checking the parameters you’re giving optixPipelineCreate: In particular, are the pipeline compile parameters identical to the ones you specified for optixModuleCreateFromPTX?
Also: Is there anything reported in the log string you give pipelineCreate?
–Frank

Thanks for your reply. Checking the log helps a lot.

I checked the log (originally the program exit before I print the log LOL) and found that there’s no RAYGEN program in program groups. And then I realize I made a stupid assumed that the optixModuleCreateFromPTX should automatically identify the program kind by looking at the prefix of the OptixProgramGroupDesc::entryFunctionName. So I forgot to set the OptixProgramGroupDesc::kind field, which fails the later optixPipelineCreate.

1 Like