Optix7.2 sutil::getPtxString

Please note that the sutil::getPtxString() is returning the PTX source code itself, not its filename.
You’re only constructing the filename which is not what you use with the optixModuleCreateFromPTX() function.

That should be easy to solve.

If there is not a specific reason to use that OptiX SDK 7.2.0 version, for example because you cannot upgrade to newer drivers, it’s always recommended to use the newest available display drivers and OptiX SDK version which would be 7.4.0 at this time. Note that the sutil::getPtxString() has been replaced by the helper function sutil::getInputData() there.

I’m not a fan of these sutil helper functions, because they use hardcoded paths to the local samples source directory inside the executables.

OptiX 7 example code which is not using the sutil library at all can be found here: https://github.com/NVIDIA/OptiX_Apps
The function where I read the PTX source code from a file is here: https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/nvlink_shared/src/Device.cpp#L200
Example usage: https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/nvlink_shared/src/Device.cpp#L589