Installing libopencv-dev breaks OpenGl for Intel based gpu

Bug #1245260 reported by Michal Navratil
174
This bug affects 33 people
Affects Status Importance Assigned to Milestone
opencv (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Installing libopencv-dev on Saucy installs also nvidia-319-updates and nvidia-settings-319-updates (indirect dependency through libopencv-ocl-dev), regardless of what GPU is being used.

The above mentioned packages install also NVidia's GLX module, that fails to load on non NVidia GPUs (Intel GMA in this case) and that in turn prevents running OpenGl applications.

Summary:
Description: Ubuntu 13.10
Release: 13.10

Packages in question:
libopencv-dev 2.4.5+dfsg-0ubuntu4
libopencv-ocl-dev 2.4.5+dfsg-0ubuntu4
libopencv-ocl2.4 2.4.5+dfsg-0ubuntu4
nvidia-319-updates 319.60-0ubuntu1
nvidia-settings-319-updates 319.60-0ubuntu1

Steps to reproduce:
On system running non NVidia GPU (Intel GMA in my case) run:
sudo apt-get install libopencv-dev
Log out/log in or reboot to restart X

Result:
Excerpts from Xorg.0.log:
[ 11149.382] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so
[ 11149.716] (II) Module glx: vendor="NVIDIA Corporation"
[ 11149.716] compiled for 4.0.2, module version = 1.0.0
[ 11149.716] Module class: X.Org Server Extension
[ 11149.716] (II) NVIDIA GLX Module 319.60 Wed Sep 25 14:24:11 PDT 2013
[ 11149.728] Loading extension GLX
...
[ 11150.063] (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

Other symptoms:

sbuilder@netty:~$ glxgears
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual
sbuilder@netty:~$ glxinfo
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".
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".

Would it be possible to somehow decouple the libopencv-dev from those NVidia stuff, so installing the former doesn't break the OpenGl?
Kind regards,

Michal Navratil

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in opencv (Ubuntu):
status: New → Confirmed
Revision history for this message
Jeremy Powell (molesmoke) wrote :

To work around this issue I have installed the generic provider of libopencl1:

sudo apt-get install ocl-icd-libopencl1
sudo apt-get autoremove

Hope this helps

Revision history for this message
Michal Navratil (f-josef) wrote :

Worked like a charm.
Thank you very much!

Revision history for this message
Martin Schröder (martinschroeder) wrote :

The workaround by Jeremy works. But who is responsible for this mess? Please fix it!
It's anything but obvious that my graphical interface stops to work because of OpenCV being installed.

Revision history for this message
Jeremy Powell (molesmoke) wrote :

Looking at the changelogs, the problem started with 2.4.5+dfsg-0ubuntu3 when libopencv-ocl was added to the dependencies of libopencv. This is quite a reasonable change I think, but libopencv-ocl has the virtual package libopencl1 as a dependency.

According to the Debian Policy Manual (http://www.debian.org/doc/debian-policy/ch-relationships.html) a real package (ocl-icd-libopencl1) can be declared as the preferred alternative for a virtual package by using a vertical bar in the Depends filed. I.e. change:

Depends: libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libopencl1, libopencv-core2.4 (= 2.4.5+dfsg-0ubuntu4), libopencv-imgproc2.4 (= 2.4.5+dfsg-0ubuntu4), libopencv-objdetect2.4 (= 2.4.5+dfsg-0ubuntu4), libstdc++6 (>= 4.4.0), libtbb2, libopencv-highgui2.4 (= 2.4.5+dfsg-0ubuntu4)
F

to

Depends: libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), ocl-icd-libopencl1 | libopencl1, libopencv-core2.4 (= 2.4.5+dfsg-0ubuntu4), libopencv-imgproc2.4 (= 2.4.5+dfsg-0ubuntu4), libopencv-objdetect2.4 (= 2.4.5+dfsg-0ubuntu4), libstdc++6 (>= 4.4.0), libtbb2, libopencv-highgui2.4 (= 2.4.5+dfsg-0ubuntu4)
F

Seems to me like this would be a good solution, if one of the package maintainers can implement it.

Timo Aaltonen (tjaalton)
Changed in opencv (Ubuntu):
importance: Undecided → High
Revision history for this message
Josh McFadden (mindsound) wrote :

This was very troublesome in my case! The presence of the nvidia packages caused my Ubuntu VirtualBox VM to log in to an unresponsive black screen. I was only able to solve the problem after recreating the entire install from scratch several times.

Revision history for this message
Doran Doran (ebvdoran) wrote :

Jeremy Powell's fix also appears to work for me, even though I have an Nvidia graphics card (GTX 660).
My thanks to him and this forum.

Revision history for this message
Marco (charco) wrote :

This bug is six months old, high priority and it looks like the fix is just one line. What would it take to fix it? I just installed opencv and was really surprised when I couldn't get into X after rebooting, and even more when I realized that it was opencv's fault.

Jeremy, thank you for your help :) Your fix solved my problem.

Revision history for this message
Krishna Kumar (krishna-kumar-c) wrote :

I am another unfortunate user who tried to build opencv 2.4.9 on ubuntu 13.10 and ended up with an unusable system. My hardware is AMD A6 with Radeon Graphics card.

I had the AMD catalyst drivers installed in my machine, I couldn't recover back to my old drivers, I didn't find this page when I was searching for a solution. I tried to upgrade to 14.04 using the command line boot up sequence expecting that to reinstall the drivers and fix everything, but that was not to be.

So I tried to re-install 14.04 using a live CD, for some reason it failed on the first attempt.

 I ended up getting in to Busybox shell and my previous ubuntu 13.10 partition had become unbootable nor was it recognised by the live CD on further attempts.

Finally, I partitioned my hard disk to save my old ubuntu 13.10 installation and reinstall ubuntu 14.04 on a separate partition.

This resulted in 48 hours wasted in productivity with out a bootable machine and further several hours to re-install software on 14.04.

I hope whoever is incharge of opencv reads through these sob stories and fixes this before this creates pain for many.

Revision history for this message
Dario Limongi (limee) wrote :

Hello people! I had to install ROS Hydro on Ubuntu 13.10 for a University project and here I am after black screen and lots of googling.

This is what I've done (thanks to you all):

1) sudo apt-get autoremove
(apt-get was telling me that libopencv-dev had some conflicts)

2) sudo apt-get remove libopencv*

3) sudo apt-get autoremove
(it automatically removed ROS and everything else)

3) sudo apt-get remove nvidia*
(don't ask me why but I tried doing it without removing ROS and OpenCV before it wasn't removing anything)

Finally I could boot again but only with Guest account!! I was stucked in a log-in loop caused by 'lightdm'. So in order to fix this:

1) CTRL + ALT + F1 to open "text mode" ubuntu after boot. Log-in as normal
2) sudo dpkg reconfigure lightdm
3) sudo chown -R $USER:$USER $HOME
4) sudo reboot (or restarting lightdm or x server probably will work also)

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

opencl support has been implemented a little differently in debian, using ocl-icd-libopencl1, which avoids this bug, which should not be present anymore now.

Changed in opencv (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.