Ask Your Question

Revision history [back]

Building OpenCV 2.4.9 with CUDA Linking Problem

Hello world,

I've been trying to build OpenCV 2.4.9 (SVN) with CUDA support for a few days on Ubuntu 12.10 (x64).

During the linking I have the following error: Linking CXX executable ../../bin/opencv_perf_gpu ../../lib/libopencv_gpu.so.2.4.9: undefined reference to « cuCtxGetCurrent »

I have no idea on how to fix this and it doesn't seem to be a frequent problem.

I tried various methods in various (if not all) combinations:

  1. manually installing CUDA 5.0 using Nvidia's package for Ubuntu 11.10 x64
  2. building CUDA 5.0 and OpenCV using both gcc (and g++) 4.6 and 4.7
  3. installing the CUDA 4.2 dev and toolkit package provided by apt-get
  4. trying changing the display drivers: 304.48, 310, 304.54 (from the CUDA 5.0 package)

Each time I made sure to have all the cuda libs detected by ldconfig. Though I'm still not sure which lib file is supposed to contain the function cuCtxGetCurrent...

Thank you in advance.