Can't compile the MDL samples using VS 2015


Both the Optix 5 pre-compiled versions of optixMDLDisplacment and optixMDLExpression work fine on my machine. But if I try compile them using vs2015, they both crash while compiling. The other sample scenes compile without any problems.

In the optixMDLDisplacement sample, the crash happens in the createMDLMaterial() function and occurs on line 892 of sutil.cpp

const nvrtcResult compileRes = nvrtcCompileProgram( prog, (int) options.size(), );

Anybody else hitting this?

Which CUDA version do you use?

Thanks for the reply. I’m still using CUDA 8 … I guess it’s time to update.

Yes, when you look into the ptx files
in folder: C:\ProgramData\NVIDIA Corporation\OptiX SDK 5.0.0\SDK-precompiled-samples\ptx
you can see, that for the precompiled versions "Cuda compilation tools, release 9.0, V9.0.176" was used.

Btw, I really appreciated your post about “Trbvh” [url]Pick ray - OptiX - NVIDIA Developer Forums

Updating to CUDA 9.1 solved this problem and some other mystery crash I was having using MDL

“Btw, I really appreciated your post about “Trbvh””

Glad it was helpful to someone. I just made a lucky stab in the dark that found a workaround. :)

Thanks for the report.
This has been root caused to a bug inside the CUDA 8.0 runtime compiler when initializing a local structure variable. In this case the code parts doing
MDL_SDK_State state = { };

The solutions would be to use a constructor instead to let it work with CUDA 8.0, or build the solution without the CUDA_NVRTC_ENABLED flag enabled inside the CMake GUI, or to upgrade to CUDA 9.0 or 9.1,
The example code is going to be changed accordingly.