building advanced sample with optix 6.5.0, CUDA10.1 and MSVS2019

I try to build advanced samples with optix 6.5.0, CUDA10.1 and MSVS2019, but I can’t.

Error message is below.

CMake Error at cuda_compile_ptx_generated_phong.cu.ptx.cmake:245 (message):
Error generating
E:/src/optix_advanced_samples-master/src/build/lib/ptx/cuda_compile_ptx_generated_phong.cu.ptx

It seems to fail to generate the dependency file, but I don’t understand why.
Am I making any mistakes?

That is most likely the issue with the outdated FindCUDA.cmake inside that repository.

The host compiler location changed between MSVS 2015 and 2017 which broke the old logic to find the CUDA_HOST_COMPILER.
You’d either need to set it manually inside the CMake GUI or use the FindCUDA.cmake shipping with newer CMake versions.

Please see these threads for more information:
[url]https://devtalk.nvidia.com/default/topic/1049059/optix-6-0-0-build-error-with-vs2017-cuda-10-0/[/url]
[url]https://github.com/nvpro-samples/optix_advanced_samples/issues/7[/url]

Thank you for helping me again and again.
Finally I could build it!