Hi. Try including cuda_runtime.h first, before any OptiX headers.
There is also an SDK sample, optixRaycasting, that post-processes an OptiX buffer using a separate CUDA runtime kernel. The OptiX part of the sample might not be relevant to what you’re doing, but it could help you chase down issues with the CUDA part.
And if you’re doing pixel-by-pixel post processing and the kernel is fairly simple, consider writing an OptiX ray generation program and attaching it as another entry point. It can process pixels instead of generating rays. This may be less boilerplate than a full CUDA kernel since you already have the OptiX context.
One other option just in case it matters for you: there is a simple builtin tonemapper as a post-processing stage in 5.0, along with a denoiser option. Check the OptiX Programming Guide in the SDK and look for the “Post-processing framework” section.
Thank you for your suggestions.
Including the cuda_runtime before optix headers did fix the issue.
The idea of using raygen program is very relavent in my application and I will definetly give it a try.
Thank you once again and I wish you happy Holidays and a Merry Christmas.