8

I am trying to use OpenGL on my Ubuntu 12.04 LTS. I installed OpenGL with the following commands:

sudo apt-get install g++ cmake
sudo apt-get install freeglut3 freeglut3-dev
sudo apt-get install binutils-gold

I wrote a simple example in C++ and compiled it with g++ -lGL -lglut main.cpp -o test and then I tested it using ./test. A window opened but it was black and I didn't show anything. So, I installed my nvidia driver using the following commands:

sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nvidia-current
sudo apt-get install nvidia-settings
sudo reboot

And now when I try to run again the program it gives me the 2 errors:

Xlib:  extension "GLX" missing on display ":0".
freeglut (./test): OpenGL GLX extension not supported by display ':0'

What could be the problem?

Also, here is the output of the lspci | grep VGA command:

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 525M] (rev a1)
  • 1
    What graphics card do you have? Can you also paste /var/log/xorg.0.log to http://paste.ubuntu.com/ and drop a link here? Thanks. – Seth Mar 02 '14 at 18:25
  • Nvidia; here is the link http://paste.ubuntu.com/7023355/ – user1956190 Mar 02 '14 at 18:32
  • What Nvidia? Do you have an Intel card too? What is the output of lspci | grep VGA? (please edit it into your question). – Seth Mar 02 '14 at 18:36
  • I have edited my question. What could be wrong? – user1956190 Mar 03 '14 at 11:07
  • Normally that message indicates a graphic driver without proper 3D support. What is the output of glxinfo | grep vendor if it is NVIDIA Corporation you activated the proprietary nvidia driver. – user3793747 Apr 07 '15 at 00:13
  • This is a NVIDIA / Intel hybrid-GPU system and the active GPU is the Intel one. So Xorg tries to load the GLX extensions and fails because the Intel graphics driver doesn't support it. You have to switch to the NVIDIA GPU. Make sure you're using the latest kernel http://askubuntu.com/questions/330065/ubuntu-12-04-kernel-upgrade-to-3-10 and also the latest backported Xserver https://wiki.ubuntu.com/X/Config/HybridGraphics for Ubuntu 12.04 Then install the package 'nvidia-prime' and reboot. You'll have to use the nivida-settings tool to switch the GPU. After the next reboot, it should work. – NetAndif Apr 07 '15 at 17:04

0 Answers0