Module creation not identifying my __direct_callable__ functions

But when I try to create my module I get an error that it is invalid.
If I add for example a raygen program to the same ptx the raygen program is identified but not the direct callables.

That’s most likely because the NVCC compiler command line is missing the option --relocatable-device-code=true (or short -rdc).
Compare with the setting I use in my examples: NVCC_OPTIONS

The reason why that is required since CUDA 8.0 is explained here:
https://forums.developer.nvidia.com/t/loading-callable-program-from-file-fails-with-rt-invalid-source/48648/2

Make sure to pull that OptiX 7 Course repository again. There has been a bug fix when using it with OptiX SDK 7.2.0 yesterday:
https://forums.developer.nvidia.com/t/optix-sdk-7-2-0-out-of-host-memory-error-7002/157558/3

Also note the other things I recommended to change in that function.
Use OPTIX_COMPILE_DEFAULT_MAX_REGISTER_COUNT.
Default-initialize all OptiX structures! You’re missing pipelineCompileOptions = {};
usesMotionBlur is an int type (The C API has no bool.)

1 Like