Redirect nvcc build output to visual studio Output window

Hello everyone,

How do we redirect nvcc build output such as warning messages to visual studio Output window?
All can be seen by default is just something like:

6>Building NVCC optixir file lib/ptx/Debug/renderer_generated_miss_radiance.cu.optixir
6>miss_radiance.cu
6>miss_radiance.cu
6>Building NVCC optixir file lib/ptx/Debug/renderer_generated_raygen.cu.optixir
6>raygen.cu
6>raygen.cu

This is reproducible building optix sample projects.
I suppose some changes are required in those macros?

Many thanks and Happy New Year,
Bing

That would be the proper output for OptiX *.cu device code without errors or warnings and default MSVS settings.

Which OptiX SDK version are you using?

If that is OptiX SDK 7.5.0, there was a small CMake script error inside only that SDK version which prevented the compiler messages to appear but I thought that only affected Linux.

Please have a look into this post for the solution: https://forums.developer.nvidia.com/t/earlier-feedback-for-syntax-errors-in-shaders/230343/5

You could also update to a newer OptiX SDK version where this is solved as well.

If you’re interested in what actually happens inside the Visual Studio build process, you can increase the MSBuild output verbosity inside the option
Menu → Tools → Options… → Projects and Solutions → Build And Run

There are two combo-boxes for the MSBuild project build output verbosity and the log file verbosity.
The default is Minimal and only prints basic information.
If you want to see the NVCC command line of that custom build rule, you need to switch the build verbosity to Detailed.

Thank you Detlef for your answer.
I was using SDK7.5 in windows.
It turned out to be a mistake on my side. The warning messages are redirected to Output windows by default.
I’ve verified it by bypassing IDEs e.g. visual studio and jetbrains, and directly invoking nvcc following this tutorial.

Thank you for the prompt reply.
Bing