dense_flow icon indicating copy to clipboard operation
dense_flow copied to clipboard

camke and make -j are completed,but when i test the command like this,some mistake happened

Open Yinhance opened this issue 5 years ago • 1 comments

The opencv-3.1.0 and its contrib is installed.then I am going to install dense_flow. everything looks ok,but when I input the command below ./extract_gpu -f=test.avi -x=tmp/flow_x -y=tmp/flow_y -i=tmp/image -b=20 -t=1 -d=0 -s=1 -o=dir

then I get OpenCV Error: Gpu API call (no kernel image is available for execution on the device) in call, file /home/yh/opencv-3.1.0/modules/cudev/include/opencv2/cudev/grid/detail/transform.hpp, line 318 terminate called after throwing an instance of 'cv::Exception' what(): /home/yh/opencv-3.1.0/modules/cudev/include/opencv2/cudev/grid/detail/transform.hpp:318: error: (-217) no kernel image is available for execution on the device in function call

how can I solve this problem? Thx a lot!!!

Yinhance avatar Jan 10 '20 10:01 Yinhance

计算力不匹配的问题 未设置前opencv在cmake的输出是这样的:计算力是30 35 37 NVIDIA CUDA Use CUFFT: YES Use CUBLAS: YES USE NVCUVID:NO NVIDIA GPU arch: 30 35 37 NVIDIA PTX archs: Use fast math:NO #Note:6.1为GTX1080的计算能力,不同显卡需要根据自己的计算能力进行修改 #查询显卡计算能力,可以通过运行cuda samples中的deviceQuery得知。 #(文件夹NVIDIA_CUDA-*_Samples下编译示例, *为版本号) 如果设置成功,cmake界面会有如下显示(我的显卡是1080ti): NVIDIA CUDA Use CUFFT: YES Use CUBLAS: YES USE NVCUVID:NO NVIDIA GPU arch: 61 NVIDIA PTX archs:61 Use fast math:NO

GPU arch/PTX archs都被设置为6.1 但如果运气不佳,添加编译选项并不能解决问题。 这时候需要修改opencv中关于CUDA计算能力这部分的配置文件./cmake/OpenCVDetectCUDA.cmake。 在 set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported") set(CUDA_ARCH_PTX ${__cuda_arch_ptx} CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for") 之前添加 set(__cuda_arch_bin "6.1") set(__cuda_arch_ptx "6.1") 保存后cmake上面那一段,重新将opencv cmake make make install一遍出现正确的计算能力显示61

最后重新编译dense_flow

ZWJ-here avatar May 25 '20 03:05 ZWJ-here