Hey everyone, I’m trying to build the OptiX 9.0.0 SDK samples on Windows using CUDA 12.8 and VS22. CMake generation works, but when I open the solution in Visual Studio and try to build the samples, all custom NVCC build steps fail with:
Custom build for ‘C:\ProgramData\NVIDIA Corporation\OptiX SDK 9.0.0\SDK\cuda\camera.cu’ exited with code 1.
Custom build for ‘C:\ProgramData\NVIDIA Corporation\OptiX SDK 9.0.0\SDK\cuda\geometry.cu’ exited with code 1. etc.
If you used the top-most CMakeLists.txt to build the solution, this should normally work out-of-the-box.
The first thing to analyze is what the actual nvcc command line and error message is.
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.
If that detailed build output doesn’t indicate what the problem was, please provide more information about the error message and your system configuration (GPU, exact MSVS and NVCC version numbers to determine if there are potential incompatibilities).
Yes. The SDK is headers, samples, and data for the samples. The data is the vast majority of that 54mb. All of the OptiX functionality and binary code is embedded in your display driver, not the SDK. Note that when building your own OptiX application, you can optionally use the Github headers-only repository, which weighs in at less than 1 MB. This comes without sutil or any other helpers or libraries or samples. https://github.com/NVIDIA/optix-dev
I increased the MSBuild verbosity to Detailed. According to the detailed log, the failure occurs during the custom NVCC build step (CUDA_WRAP_SRCS) used by the OptiX SDK samples.
The MSB8066 error happens during PTX generation for the .cu files in sutil
(e.g. geometry.cu, shading.cu, sphere.cu, solid_color.cu).
OK, but before the build finally fails with that custom build error, what exactly are the nvcc command lines and nvcc error messages inside the Visual Studio build output window or build logfile?
They should be printed now with the higher MSBuild verbosity settings.
NVCC error messages are not appearing in the Visual Studio Output window. Even with MSBuild verbosity set to Diagnostic, the build stops before any NVCC command line is shown. the output folder (build/lib/ptx/Release/..) is completely empty. So NVCC is not producing any PTX or OptiX-IR outputs at all.
Mine one has same issue, turns out Visual Studio pass a args -o ${projectpath}/{arch}/debug/kernel.obj to nvcc, So whatever nvcc build, It pushes content into an obj file.