Ubuntu

Installing libopencv-dev breaks OpenGl for Intel based gpu

Reported by Michal Navratil on 2013-10-27
136
This bug affects 27 people
Affects Status Importance Assigned to Milestone
opencv (Ubuntu)
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

Launchpad Janitor (janitor) wrote :

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

Changed in opencv (Ubuntu):
status: New → Confirmed
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

Michal Navratil (f-josef) wrote :

Worked like a charm.
Thank you very much!

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.

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) on 2013-11-11
Changed in opencv (Ubuntu):
importance: Undecided → High
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.

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.

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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers