First time here? Check out the FAQ!

Ask Your Question
1

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

asked Jul 20 '12

victorocv3 gravatar image

updated Jul 20 '12

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

Linking CXX executable ../../bin/opencv_perf_core
../../lib/libopencv_core.so.2.4.2: 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.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Jul 24 '12

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 "libcuda.so" to this line "CUDA_CUDA_LIBRARY:FILEPATH=" so in my case i ended up with "CUDA_CUDA_LIBRARY:FILEPATH=/usr/lib/nvidia-current-updates/libcuda.so"

Preview: (hide)

Comments

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

victorocv3 gravatar imagevictorocv3 (Sep 5 '12)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 (Jan 12 '13)edit

Question Tools

Stats

Asked: Jul 20 '12

Seen: 3,862 times

Last updated: Jul 24 '12