Ask Your Question

[GPU] OpenCV 2.4.2 with Cuda support + Ubuntu 12.04 Laptop

asked 2012-07-20 10:44:27 -0600

victorocv3 gravatar image

updated 2012-07-20 11:00:15 -0600

I keep getting this error and can't get rid of it:

Linking CXX executable ../../bin/opencv_perf_core
../../lib/ undefined reference to `cuDeviceGetAttribute'

I have installed CUDA & CUDA SDK in my ubuntu 12.04 laptop and the cudalibrary and c examples are working perfectly. The problem comes when trying to compile OpenCV 2.4.2 with CUDA=ON.

Any ideas are welcome! Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2012-07-24 17:52:55 -0600

MarcoMartins gravatar image

I solve this problem by going to CMakeCache.txt after generating UNIX makefile using cmake-gui, in the directory you set to build the binaries, and adding the path for the "" to this line "CUDA_CUDA_LIBRARY:FILEPATH=" so in my case i ended up with "CUDA_CUDA_LIBRARY:FILEPATH=/usr/lib/nvidia-current-updates/"

edit flag offensive delete link more


Thanks for your reply, it worked so I guess that it must be a problem of cmake-gui

victorocv3 gravatar imagevictorocv3 ( 2012-09-05 05:11:51 -0600 )edit

Just wanted to confirm that this also worked for me on Fedora 17, despite the comment saying "//"cuda" library (older versions only)." Thanks!

Armin Samii gravatar imageArmin Samii ( 2013-01-12 03:22:51 -0600 )edit

Question Tools


Asked: 2012-07-20 10:44:27 -0600

Seen: 3,794 times

Last updated: Jul 24 '12