Build opencv 3.0 - error: "...only when targeting sm_20 or higher"

asked 2014-07-23 23:02:55 -0500

Compvis gravatar image

updated 2014-07-24 01:36:37 -0500


I'm building latest opencv 3.0 from source with CUDA SDK 5.5. My graphics card is Gigabyte NVidia GeForce 9800GTX+ with 1.1 computability. When building opencv_core module, i get this error:

"*nvcc : fatal error : nvcc supports '--relocatable-device-code=true (-rdc=true)' , '--device-c (-dc)' and '--device-link (-dlink)' only when targeting sm_20 or higher
CMake Error at *

CMake settings:
CUDA_ARCH_BIN: 1.1 1.2 1.3 2.0 2.2(2.0)

Enviroment and tools:
Visual Studio C++ 2012
Windows 7

What i was wrong? I need your help. Thanks

edit retag flag offensive close merge delete


Afaik you need to specify your compute capability. Change the parameters for your CUDA implementation in CMAKE like this:


You are trying to compile functionality for your device that is only possible with capability 2.0 or higher. If this doesn't work, try downloading CUDA5, that one worked on my 1.1 capability card with those settings.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-24 03:03:57 -0500 )edit

Also, do you really need the 3.0 functionality? It is not a stable branch and it is possible someone added GPU code that isn't stable for 1.1 compute capability, while 2.4.9 should ensure everything works just fine.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-24 03:05:00 -0500 )edit

And as explained in this OpenCV GPU documentation:

At the first call, the PTX code is compiled to binary code for the particular GPU using a JIT compiler. When the target GPU has a compute capability (CC) lower than the PTX code, JIT fails.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-24 03:06:57 -0500 )edit