rtProgram without PTX

Hello all,

Is there anyway to create rtProgram directly from .cu files without passing through .ptx files

Thank you

Not really. That’s not a viable solution for a shipping application, because compiling *.cu files requires the CUDA toolkit and a supported host compiler(!) installed on the target system. The CUDA driver only supports PTX as just-in-time compilation source.

On a development system with everything installed you could use the OptiX utility functions rtuCUDACmpileString() and rtuCUDACompileFile() you’ll find inside the OptiX API Reference, but that doesn’t give you any benefit during OptiX program development over compiling inside your development IDE.
That would rebuild the programs everytime you launch the application and you would need to manually care about the error locations.
If you planned to dynamically generate CUDA files at runtime, that won’t work when deployed on clean end user systems.