CMake CUDA_SELECT_NVCC_ARCH_FLAGS Bug Optix 7.0.0

Hi: I’m using OptiX 7.0.0 and I’ve encountered a bug in the CMake provided with the SDK (specifically SDK/CMake/FindCUDA/select_compute_arch.cmake). This CMakeLists.txt:

project( example )
cmake_minimum_required( VERSION 3.14 )
set( OptiX_INSTALL_DIR "c:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0" CACHE PATH "Path to OptiX installation" )
set( CMAKE_MODULE_PATH "${OptiX_INSTALL_DIR}/SDK/CMake" )
find_package( CUDA REQUIRED )
cuda_select_nvcc_arch_flags( arches )

produces a long string of error messages from cuda_select_arch_flags on windows (VS2017)) when the project is initially configured. Seems to work OK on linux, though.

At least as of CMake 3.16, the standard CMake-provided CUDA cuda_select_nvcc_arch_flags function works OK on both windows and linux, so I guess the FindCUDA provided with OptiX 7.0.0 is somewhat out of data.

Thanks,
Allen

I’ll let the developers know. That looks quite outdated.

I’m not sure why there is still a FindCUDA.cmake inside the SDK at all. I simply use CMake’s version since a long time in my own OptiX application frameworks. (Link in the OptiX advanced samples on github sticky post at the top of this sub-forum.)

Which CUDA Toolkit version did you use and on what GPU?

CUDA 10.1 and a Quadro M4000.