OpenCV Unspecified error - cvShowImage

asked 2015-09-09 10:20:18 -0600

Scherady gravatar image

updated 2015-09-10 01:18:08 -0600

berak gravatar image

Under Ubuntu 15.04 I am getting the following error:

****************************************
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/brian/opencv/modules/highgui/src/window.cpp, line 501
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/brian/opencv/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

I have re-installed libgtk2.0-dev and pkg-config and re-run cmake but it did not help.

Any idea what could be the problem?

Thank you

Updated information:

cmake output:

-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- !!!WARNING Qt5: resorting to default Qt5 paths (might fail): /usr/local/qt/5.3/gcc_64/lib/cmake
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- !!!WARNING Qt5: resorting to default Qt5 paths (might fail): /usr/local/qt/5.3/gcc_64/lib/cmake
-- Found ANTTWEAKBAR: /usr/local/lib/libAntTweakBar.so
-- AntTweakBar: /usr/local/lib/libAntTweakBar.so
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- !!!WARNING Qt5: resorting to default Qt5 paths (might fail): /usr/local/qt/5.3/gcc_64/lib/cmake
-- GLEW_LIBRARIES: /usr/lib/x86_64-linux-gnu/libGLEW.so
-- HOSTNAME FFTT
-- CUDA_PROPAGATE_HOST_FLAGS: False
-- CUDA_HOST_COMPILER: /usr/bin/cc
-- CUDA_NVCC_FLAGS:  -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -DNDEBUG -std c++11 -O3 -use_fast_math
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- !!!WARNING Qt5: resorting to default Qt5 paths (might fail): /usr/local/qt/5.3/gcc_64/lib/cmake
-- HOSTNAME FFTT
-- CUDA_PROPAGATE_HOST_FLAGS: False
-- CUDA_HOST_COMPILER: /usr/bin/cc
-- CUDA_NVCC_FLAGS:  -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -DNDEBUG -std c++11 -O3 -use_fast_math
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- HOSTNAME FFTT
-- CUDA_PROPAGATE_HOST_FLAGS: False
-- CUDA_HOST_COMPILER: /usr/bin/cc
-- CUDA_NVCC_FLAGS:  -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -DNDEBUG -std c++11 -O3 -use_fast_math
-- CMAKE_BUILD_TYPE Release
-- Compiler(Linux): g++-4.9
-- Found OpenNI: /home/brian/Scherady/htrack-1/openni/lib/libOpenNI2.so
-- !!!WARNING Qt5: resorting to default Qt5 paths (might fail): /usr/local/qt/5.3/gcc_64/lib/cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /home/brian/Scherady/htrack-1/build-apps-Desktop-Default

compile output:

16:36:18: Running steps for project htrack-helloworlds...
16:36:18: Starting: "/usr/bin/make" 
[  7%] Built target helloworld
[ 15%] Built target helloworld_opencv
[ 23%] Built target helloworld_qtopengl
[ 38%] Built target helloworld_atb
[ 46%] Built target helloworld_cudagl
[ 53%] Built target cudax
[ 61%] Built target helloworld_cublas_perfomance
[ 69%] Built target helloworld_cublas_simple
[ 76%] Built target helloworld_thrust
[100%] Built ...
(more)
edit retag flag offensive close merge delete

Comments

1

"I have re-installed libgtk2.0-dev and pkg-config and re-run cmake but it did not help." - well, how so ? build errors, cmake output ? you're kinda leaving a huge gap with the current problem.

berak gravatar imageberak ( 2015-09-09 13:20:26 -0600 )edit

just to make it clear, the opencv library depends on gtk, not your demo code.

you will have to rebuild the opencv libs (with gtk2 present), not only your project

berak gravatar imageberak ( 2015-09-10 01:19:45 -0600 )edit

OK ! My build failed: [ 32%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o nvcc fatal : Unsupported gpu architecture 'compute_11' CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message): Error generating /home/brian/opencv/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o

modules/core/CMakeFiles/opencv_core.dir/build.make:55: recipe for target 'modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o' failed make[2]: * [modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1

Scherady gravatar imageScherady ( 2015-09-10 03:50:11 -0600 )edit

sorry, can't help with that ;(

berak gravatar imageberak ( 2015-09-10 03:53:52 -0600 )edit

You are trying to build a GPU architecture that is not supported by your card. What GPU do you have in your system? Look up your compute capability right here: https://developer.nvidia.com/cuda-gpus

StevenPuttemans gravatar imageStevenPuttemans ( 2015-09-11 07:18:37 -0600 )edit

Thank you Steven I have a VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1)

Scherady gravatar imageScherady ( 2015-09-12 18:10:07 -0600 )edit

Okay so that card has compute capability 2.1. When you run CMAKE, you specify the following parameters -D CUDA_ARCH_BIN=2.1 -D CUDA_ARCH_PTX=2.1 and the build should work just fine or edit the value in the cmake-gui interface.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-09-14 05:40:44 -0600 )edit
  1. I had used -D CUDA_ARCH_BIN=3.2 -D CUDA_ARCH_PTX=3.2 as I had seen in another forum, is it a problem, even if it compiled OK?
  2. Now I have another error: OpenCV Error: Null pointer (NULL guiReceiver (please create a window)) in cvDestroyWindow, file /home/brian/opencv/modules/highgui/src/window_QT.cpp, line 497 terminate called after throwing an instance of 'cv::Exception' what(): /home/brian/opencv/modules/highgui/src/window_QT.cpp:497: error: (-27) NULL guiReceiver (please create a window) in function cvDestroyWindow The program has unexpectedly finished. /home/brian/Scherady/build-htrack-Desktop-Default/htrack_atb crashed' Thank you.
Scherady gravatar imageScherady ( 2015-09-14 14:59:45 -0600 )edit

@Scherady, your GPU card does NOT support the 3.2 architecture, so that is not correct. You need to recompile with the correct CUDA compute compability. As to your second problem, please open up a second question for that and add more information there.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-09-15 02:18:48 -0600 )edit

Strange! I followed your advice and I tried to recompile with 2.1 instead of 3.2 but I got this error: [ 1%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o nvcc fatal : Unsupported gpu architecture 'compute_21' CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:208 (message): Error generating /home/brian/opencv/release/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o. Thank you

Scherady gravatar imageScherady ( 2015-09-15 15:06:12 -0600 )edit