I ran a grep over the entire source code of the optix SDK and didn’t find a single reference to a nvrtc call.
You’re doing it wrong. ;-)
Searching over all *.h and *.cpp files inside the OptiX SDK 7.1.0 turns up 40 hits for nvrtc.
The NVRTC compilation happens inside the OptiX SDK 7.1.0\SDK\sutil\sutil.cpp file in function getPtxFromCuString().
Also, I am now faced with a different problem, that sutil::samplePTXFilePath couldn’t locate geometry.cu for said example project.
From your description of adding an own example to the OptiX SDK examples, that should have worked.
Did you run it from within the debugger? If yes, is the debugger’s working directory the same as the module directory?
If not, does it work when starting the application without the debugger from the location it was built to?
I’m asking because the OptiX SDK examples compile hard-coded paths to the PTX and data folders into the executable and won’t work when run from another location unless two environment variables are set. You can find them inside the code. Look in sutil.cpp again for getSampleDir() and samplePTXFilePath().
https://forums.developer.nvidia.com/t/compile-optix-7-0-as-exe/124791/12
I’m not using any of that in my own OptiX 7 application framework. (Find github links in the sticky posts.)
See this post about possible solutions. (That post also linked to the NVRTC related link above, two post earlier there.)
https://forums.developer.nvidia.com/t/sdk-samples-sutil-getptxstring-file-path/70963/2
I realized that I didn’t know enough about the NVRTC vs. NVCC capabilities and the entire dependency chain from Optix. Is there any documentation on the Optix 7.1 compilation process basically a “who calls who” with their respective capabilities?
The NVRTC compilation is isolated to the getPtxFromCuString() function. That explains it all.
The CUDA to PTX compilation using NVCC inside the example projects is done with custom build rules per *.cu file generated by CMake. Please see this thread for more information on what the actual NVCC command line arguments are and how to print them in CMake.
https://forums.developer.nvidia.com/t/cmake-dont-compile-cuda-kernels/140937
https://forums.developer.nvidia.com/t/optix-7-and-msvs-2017-hello-world-on-windows-10/141711
https://forums.developer.nvidia.com/t/how-would-you-generally-compile-and-run-a-program-which-has-optix-without-make-or-cmake/75302/2