Replacing FindCUDA.cmake and OpenCVDetectCUDA.cmake from https://github.com/opencv/opencv/tree/master/cmake (master branch- opencv 3.4.1) works for me for opencv_2.4.13 with NVIDIA TitanXP graphics card of Pascal Architecture and with cuda-9.0 on Ubuntu 16.04.