PDA

View Full Version : Need help getting OpenGL to work



sam2012
05-26-2012, 01:16 PM
OS = Ubuntu 10.04 64 bit
Video card = N450GTS Cycllone 1GD5 with Geforce GTS 450

When I first installed Ubuntu (several years ago), OpenGL rendering worked fine. My GLMatrix screensaver rendered well.
Recently, while attempting to install other software for robotics simulation, /usr/lib/libgl.so was showing as red. GLMatrix screensaver stopped working.

I did: sudo apt-get install --reinstall freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev and it did not help.

The following commands give these results:

sam@Mecha:~$ glxgears
Error: couldn't get an RGB, Double-buffered visual

sam@Mecha:~$ glxinfo | grep '^direct rendering:'
Error: couldn't find RGB GLX visual or fbconfig

Please help me solve this problem.
(unfortunately, I did not make an image backup of Ubuntu....mainly because I don't know how to do that under Linux....it would have been nice to just reinstall a working image)
Thanks.

thokra
05-26-2012, 01:20 PM
Have you installed the proprietary NVIDIA drivers or are you running on nouveau?

sam2012
05-26-2012, 02:35 PM
Have you installed the proprietary NVIDIA drivers or are you running on nouveau?

Proprietary drivers

I got glxgears to render by doing the following: export LIBGL_ALWAYS_INDIRECT=1
This forces indirect rendering to be used.
I still have a problem though because I need **direct** rendering to be used since the newer versions of the GLX library favor direct software rendering over accelerated indirect rendering.

How am I able to make glxgears work with direct rendering?

thokra
05-27-2012, 01:37 PM
First if all, if you demand indirect rendering you fall back to Mesa's software pipe which is nonsense given that you have a GPU which supports much faster rendering. Another thing is that reinstalling


freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

doesn't help to get a valid GL visual when you're using proprietary drivers since they bring their own implementation and create symlinks accordingly. You need to reinstall the NVIDIA blob. In general their installers are pretty stable under Ubuntu and produce valid installations most of the time.

sam2012
05-27-2012, 05:38 PM
First if all, if you demand indirect rendering you fall back to Mesa's software pipe which is nonsense given that you have a GPU which supports much faster rendering. Another thing is that reinstalling



doesn't help to get a valid GL visual when you're using proprietary drivers since they bring their own implementation and create symlinks accordingly. You need to reinstall the NVIDIA blob. In general their installers are pretty stable under Ubuntu and produce valid installations most of the time.


When I did the following:
sam@Mecha:~$ ls -al /usr/lib/libGL*
-rw-r--r-- 1 root root 487480 2010-01-17 00:07 /usr/lib/libGLEW.a
lrwxrwxrwx 1 root root 16 2012-05-23 17:03 /usr/lib/libGLEW.so -> libGLEW.so.1.5.2
lrwxrwxrwx 1 root root 16 2012-05-23 17:03 /usr/lib/libGLEW.so.1.5 -> libGLEW.so.1.5.2
-rw-r--r-- 1 root root 358456 2010-01-17 00:07 /usr/lib/libGLEW.so.1.5.2
-rw-r--r-- 1 root root 654 2011-07-29 03:02 /usr/lib/libGL.la
lrwxrwxrwx 1 root root 13 2012-05-26 10:23 /usr/lib/libGL.so -> mesa/libGL.so
-------------------------------------------------------------------------------------------------lrwxrwxrwx 1 root root 15 2011-07-29 03:02 /usr/lib/libGL.so.1 -> libGL.so.275.21
----------------------------------------------------------------------------------------------- -rwxr-xr-x 1 root root 1023120 2011-07-29 03:02 /usr/lib/libGL.so.275.21
-rw-r--r-- 1 root root 929838 2010-04-28 23:54 /usr/lib/libGLU.a
lrwxrwxrwx 1 root root 11 2012-05-26 10:23 /usr/lib/libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root 20 2012-05-26 01:55 /usr/lib/libGLU.so.1 -> libGLU.so.1.3.070701
-rw-r--r-- 1 root root 461488 2010-04-28 23:54 /usr/lib/libGLU.so.1.3.070701

it showed 2 symbolic links that are pointing to NVIDIA drivers instead of the mesa drivers.
How do I make these symbolic links point to mesa? Wouldn't that fix the problem? (this way, wouldn't I have direct rendering?)

What must I do (don't have a clue) to "reinstall the NVIDIA blob"?

thokra
05-28-2012, 01:22 AM
You download from http://www.nvidia.com/object/linux-display-amd64-295.53-driver.html and install. The old installation will be removed before installing the new driver. After that you should be good to go. I noticed you're using 10.04 which is pretty dated. Have you thought of upgrading to 12.04?

sam2012
05-28-2012, 05:50 PM
=========ABSOLUTE SOLUTION TO THE PROBLEM=========May 28, 2012
The following is THE ABSOLUTE SOLUTION TO THE PROBLEM:
1- When Ubuntu 10.04 is initially installed, an open source display driver called Nouveau is automatically installed.
2- When installing a proprietary display driver to use instead of Nouveau (in this case an Nvidia driver) it is best to do it as described at this URL: http://www.youtube.com/watch?v=Sh4ZmBdFCuU ----It is best to use the Ubuntu Software Center to install proprietary display drivers. If one circumvents the Ubuntu Software Center by manually installing a proprietary display driver file from the proprietary website, updates to the driver will not occur properly because the Ubuntu Software Center will not recognize the installation done outside the Ubuntu Software Center purview. Problems with conflicts almost certainly occur later as a side-effect of circumventing the Ubuntu Software Center.
3- Used Ubuntu Software Center to install NVidia binary X.Org driver (version 185) and all my OpenGL application worked, but in indirect rendering only.
4- I booted my machine, and then direct rendering was enabled.
=========END ABSOLUTE SOLUTION TO THE PROBLEM======

Thank you so much for your patience and your help!

thokra
05-29-2012, 01:06 AM
Yeah, the prop. driver doesn't like the nouveau kernel module. In fact, newer NVIDIA blobs spit out a warning and offer to blacklist the kernel module automatically. This, however, will probably not suffice because you'll have to uninstall the drivers and rebuild the initramfs.


If one circumvents the Ubuntu Software Center by manually installing a proprietary display driver file from the proprietary website, updates to the driver will not occur properly because the Ubuntu Software Center will not recognize the installation done outside the Ubuntu Software Center purview. Problems with conflicts almost certainly occur later as a side-effect of circumventing the Ubuntu Software Center.

Complete nonsense. All the "mighty" software center does is install the exact same driver offered by NVIDIA, only that it's already packaged into a DEB which some other packages may depend upon, and handle the proper deinstallation of nouveau itself.

That doesn't mean that



you can't install a newer version directly as long as other packages don't depend on the blob from the repository (in 10.04 and later the package is called nvidia-current)
you can't build your own DEB which exactly replaces the repo version and will leave dependencies intact


Before I made the mistake to buy an Optimus machine before checking for proper Linux support, I didn't touch the repositories for this at all. Now using bumblebee I'm too lazy to build my own DEB so I'm sticking with the repo. The advantage of installing the driver with an NVIDIA installer is that you get fresh and most of times improved software as soon as it's available and don't have to wait for some package maintainer to build and release a new DEB for you. For older releases nothing like that will even happen, especially with a LTS release since new, cutting edge software, including drivers, will not be backported. Lucid (i.e. 10.04) brings nvidia-current at version 195.36.24 - Precise (i.e. 12.04) brings 295.40 and Quantal (12.10) will of course bring at least 295.53 and most likely jump to 302 as soon as they're stable.

Everyone who tells you that using a GUI for installing a drivers is absolutely necessary to avoid complications is just telling you, excuse me, plain bullshit. What's necessary to avoid complications is to learn how Linux works.

BTW, to reply to your statement that 10.04 is a LTS release, guess what, so is 12.04. Do you have any reason to stick with an LTS release?

sam2012
05-29-2012, 11:51 AM
Yeah, the prop. driver doesn't like the nouveau kernel module. In fact, newer NVIDIA blobs spit out a warning and offer to blacklist the kernel module automatically. This, however, will probably not suffice because you'll have to uninstall the drivers and rebuild the initramfs.



Complete nonsense. All the "mighty" software center does is install the exact same driver offered by NVIDIA, only that it's already packaged into a DEB which some other packages may depend upon, and handle the proper deinstallation of nouveau itself.

That doesn't mean that



you can't install a newer version directly as long as other packages don't depend on the blob from the repository (in 10.04 and later the package is called nvidia-current)
you can't build your own DEB which exactly replaces the repo version and will leave dependencies intact


Before I made the mistake to buy an Optimus machine before checking for proper Linux support, I didn't touch the repositories for this at all. Now using bumblebee I'm too lazy to build my own DEB so I'm sticking with the repo. The advantage of installing the driver with an NVIDIA installer is that you get fresh and most of times improved software as soon as it's available and don't have to wait for some package maintainer to build and release a new DEB for you. For older releases nothing like that will even happen, especially with a LTS release since new, cutting edge software, including drivers, will not be backported. Lucid (i.e. 10.04) brings nvidia-current at version 195.36.24 - Precise (i.e. 12.04) brings 295.40 and Quantal (12.10) will of course bring at least 295.53 and most likely jump to 302 as soon as they're stable.

Everyone who tells you that using a GUI for installing a drivers is absolutely necessary to avoid complications is just telling you, excuse me, plain bullshit. What's necessary to avoid complications is to learn how Linux works.

BTW, to reply to your statement that 10.04 is a LTS release, guess what, so is 12.04. Do you have any reason to stick with an LTS release?


Thank you so much for providing the truth.
I'm currently dealing with robotics software that is tied to the Ubuntu 10.04 release. Once robotics-related software migration to Ubuntu 12.04 is stable I may upgrade.
The only other deterrent to upgrading is that I don't want to spend a lot of time with new problems due to the upgrade.
I'll need to reinstall all my currently installed software and settings (?!) (Please let me know of a better way)

You write that "Lucid (i.e. 10.04) brings nvidia-current at version 195.36.24", but the Ubuntu Software Center only shows me verion 185.
Why do I not see version 195.36.2? What must I do to have Lucid list version 195.36.2 in the Ubuntu Software Center?

Thanks again for you input.