close

image

image

image

image

image

image

image

image

image

Click <Configuration>

image

image

image

Click <Configuration>

Click <Generate>

Click <Open Project>


==================================================

c:\opencv\opencv4.2.0\download\opencv-4.2.0\modules\dnn\src\cuda\execution.hpp:52: error: (-217:Gpu API call) invalid device function in function 'cv::dnn::cuda4dnn::csl::make_policy'

==================================================

"invalid device function" means that CUDA binary code is not supported on your current GPU. Please check CUDA_ARCH_BIN CMake variable, it must contain actual compute capability of your card. For the list of compute capabilities per card please refer to https://developer.nvidia.com/cuda-gpus.

----------------------------------------------------------------

Seems fixed. Changed CUDA_GENERATION=AUTO and added 5.2 and 3.5 to CUDA_ARCH_BIN.

----------------------------------------------------------------

GPUs supported

image

image

Microsoft Windows [版本 10.0.18362.720]
(c) 2019 Microsoft Corporation. 著作權所有,並保留一切權利。

C:\Users\ryan wang>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130

C:\Users\ryan wang>nvidia-smi
Tue Mar 17 15:38:05 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 442.19       Driver Version: 442.19       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070   WDDM  | 00000000:01:00.0  On |                  N/A |
|  0%   46C    P8    10W / 200W |    672MiB /  8192MiB |      7%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1188    C+G   ... Files (x86)\Dropbox\Client\Dropbox.exe N/A      |
|    0      2664    C+G   ...6)\Google\Chrome\Application\chrome.exe N/A      |
|    0      3252    C+G   ...mmersiveControlPanel\SystemSettings.exe N/A      |
|    0      6072    C+G   ...DIA GeForce Experience\NVIDIA Share.exe N/A      |
|    0      9868    C+G   ...6.102.0_x64__kzf8qxf38zg5c\SkypeApp.exe N/A      |
|    0     10096    C+G   ...t_cw5n1h2txyewy\ShellExperienceHost.exe N/A      |
|    0     11064    C+G   ...11011.0_x64__8wekyb3d8bbwe\Video.UI.exe N/A      |
|    0     12336    C+G   ...hell.Experiences.TextInput.InputApp.exe N/A      |
|    0     12620    C+G   Insufficient Permissions                   N/A      |
|    0     12872    C+G   ...ost.CLR.x86\ServiceHub.Host.CLR.x86.exe N/A      |
|    0     13592    C+G   ...WindowsLiveWriter\WindowsLiveWriter.exe N/A      |
|    0     14900    C+G   ...1.0_x64__8wekyb3d8bbwe\WinStore.App.exe N/A      |
|    0     15576    C+G   ...osoft.LockApp_cw5n1h2txyewy\LockApp.exe N/A      |
|    0     17144    C+G   ...\2017\Enterprise\Common7\IDE\devenv.exe N/A      |
|    0     17452    C+G   ...ata\Local\LINE\bin\5.23.0.2134\LINE.exe N/A      |
|    0     17608    C+G   ...dows.Cortana_cw5n1h2txyewy\SearchUI.exe N/A      |
|    0     20248    C+G   C:\Windows\explorer.exe                    N/A      |
|    0     20416    C+G   ....135.0_x64__8wekyb3d8bbwe\YourPhone.exe N/A      |
|    0     21060    C+G   ...x64__8wekyb3d8bbwe\Microsoft.Photos.exe N/A      |
+-----------------------------------------------------------------------------+


image

-DANT_EXECUTABLE:FILEPATH="ANT_EXECUTABLE-NOTFOUND" -DWITH_CUDA:BOOL="1" -DCUDA_GENERATION:STRING="Auto" -DBUILD_EXAMPLES:BOOL="1" -DWITH_OPENGL:BOOL="1" -DOPENCV_ENABLE_NONFREE:BOOL="1" -DBUILD_opencv_gapi:BOOL="0" -DINSTALL_C_EXAMPLES:BOOL="1" -DOPENCV_EXTRA_MODULES_PATH:PATH="C:/OpenCV/OpenCV4.2.0/download/opencv_contrib-master/modules" -DCUDA_ARCH_BIN:STRING="6.0 6.1" -DOPENCV_DNN_CUDA:BOOL="1" -DINSTALL_TESTS:BOOL="1" -DCUDA_FAST_MATH:BOOL="1" -DBUILD_opencv_world:BOOL="1"







References

1. OpenCV Error: Gpu API call (invalid device function ) in unknown function. #4849

2. Accelerating OpenCV 4 – build with CUDA 10.0, Intel MKL + TBB and python bindings in Windows

3. How to install OpenCV 4.2.0 with CUDA 10.0 in Ubuntu distro 18.04

4. Building OpenCV with MediaSDK support

5. OPENCV4.2.0 +cuda10.0+cudnn7.6.5 with VS2017 on win10 ,unhandled exceptions: Microsoft C++ exceptions: cv::dnn::cuda4dnn::csl::CUDAException #16602

6. RGBD failing to compile with OpenGL enabled #2307

arrow
arrow
    全站熱搜

    me1237guy 發表在 痞客邦 留言(0) 人氣()