Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a laptop with on-board Intel graphics. I have been using OpenCV for years with this machine and I have managed to avoid manual compilation so far. But in Ubuntu 13.10, when I try to install libopencv-dev from the repositories, it brings along libopencv-ocl, which seems to be dependent on nvidia drivers. Letting the driver install messes up my xserver completely and when I do glxinfo afterwards, I get this:

name of display: :0.0
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Error: couldn't find RGB GLX visual or fbconfig

Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".

To solve this, I purge all nVidia drivers and reinstall xserver, much like it has been suggested here, and when I purge the nvidia drivers, OpenCV development libraries are also removed, as apt-get tells me they are no longer needed. This is foreign to me, because I expected a warning that I have installed packages that depend on this, but how can removing a dependency automatically remove the package I installed without warnings or asking? I understand it has something to do with nVidia being the provider of the libopencv-ocl in the repo. How could I get around it? I would rather not compile OpenCV if I can help it. I have seen similar questions, but not a suitable answer.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

I had the same problem, to get around it you can install an alternative provider of libopencl1. If there isn't one available for your specific graphics card (i.e. one for AMD/ATI appears to be absent from the repositories) you can use the generic one:

sudo apt-get install ocl-icd-libopencl1

If you already installed libopencv-dev, you will also want to remove the redundant packages it brought in:

sudo apt-get autoremove

Seems strange to me that the Nvidia provider is brought in by default rather than the generic one - maybe some packaging wizard can sort this out.

There is a bug for this issue here: https://bugs.launchpad.net/ubuntu/+source/opencv/+bug/1245260

share|improve this answer
    
I ended up compiling OpenCV 2.4.6 in the meantime, but this answer is sure to help many. Thank you! –  Subhamoy Sengupta Oct 30 '13 at 10:37
add comment
sudo apt-get install libopencv-highgui-dev

then compile from source, this also has a benefit that the nonfree moudle of SIFT and SURF is available.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.