Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL Linux Problems

Started by Aztral Sep 30, 2009 at 1:56 PM 16 replies 1.8k views
Original Post
Aztral
Aztral
I'm having some difficulties with OpenGL/SDL in Kubuntu 9.04. I can compile my OpenGL fine but when I try to run my openGL app, nothing graphical happens at all. The program is clearly running, as print statements in the program behave properly, but no opengl window displays whatsoever. When I terminate the program (via kill -KILL because input isn't being handled), I get the message "Warning: Program '/bin/bash' crashed." Am I missing some driver for my video card that would allow openGL to work properly? It doesn't seem like I'm missing a package/library as everything compiles just fine. Also, the program works perfectly in OS X, so I'm not sure what else to try to fix this. Any suggestions? Thanks a lot.
alexcg
alexcg
Quote:
Also, the program works perfectly in OS X

It seems that you have problems with your video card driver in Kubuntu.

Have you tried to run any OpenGL programs (except yours, of course) (games, screensavers, etc.) on your computer?

For instance, try to enter the following command in terminal (konsole in Kubuntu iirc):
glxgears
Aztral
Aztral
That's what I would thinking and the glxgears output seems to prove that theory.. I went into System->Hardware Drivers and loaded one of the video drivers as it said no drivers were currently loaded. Unfortunately that seems to have blown up my Kubuntu as on restart it doesn't progress past the loading bar.

I guess I'll get back to you after I either figure that one out or reinstall Kubuntu.
Bregma
Bregma
Quote:
Original post by Aztral
Warning: Program '/bin/bash' crashed.

Is the program you're running actually called /bin/bash? If not, that may be a hint as to what's wrong.

How are you building this app? Where is it finding its data &c?

Stephen M. Webb
Professional Free Software Developer
Aztral
Aztral
No it's not called bin/bash. bin/bash I thought is the konsole I'm running it from. I'm simply running it from the command line with ./exename. I haven't managed to crash bash before which is part of why I'm here for help.
Dunge
Dunge
Are you using virtualization software like VMwares? If so, I'm sorry but you won't be able to get hardware-accelerated display drivers and OpenGL won't work. Searched a while myself. If you have a true native installation though, it should work.

Be sure to install the video card drivers, you can use the graphical sypnatic package manager, or simply type in a console
sudo apt-get install nvidia-glx-180 nvidia-180-modaliases nvidia-kernel-common

Or the equivalent for ATI cards. You should google it and check a guide too (there's multiples), they seems to have a lot of safe failproof methods, cause simply installing the packages might gives you strange errors.
lmelior
lmelior
What hardware are you running? You can probably fix your current Kubuntu install manually from either OSX (if you're dual-booting) or the LiveCD without too much effort.

Also for future reference, run ps -ef in another shell and you can kill just your program instead of taking the shell down with it using "kill -9 PID" (process ID, second column I think). To make it easier you can pipe the output through grep with your program name "ps -ef | grep program name".

EDIT:
Actually Dunge I believe the latest release of VirtualBox is supposed to have accelerated OpenGL capabilities.

[Edited by - lmelior on September 30, 2009 4:24:38 PM]
Aztral
Aztral
Imelior - Kubuntu is on a laptop along with Vista - OS X is on a different machine entirely. (A Lenovo t400 to be precise.) That is exactly what I do. I run the program, open another terminal, ps -ef | grep exename and then kill the pid.

Dunge - Nope no virtualization software. It's a full blown installation. I attempted to install drivers via System->Hardware Drivers and destroyed my Kubuntu install via that. I'll definitely attempt it via synaptic next time.
lmelior
lmelior
A quick Google search says that switchable graphics is only supported in Vista on the T400. Have you gone into the BIOS and explicitly chosen the External graphics setting?
Aztral
Aztral
Humm. Well, upon reinstalling Kubuntu and grabbing all of the SDL and OpenGL packages again it seems to be working. I'm not sure how or why this is but - it is - I can now run the openGL app.

Thanks for all of the advice and suggestions. While I'm here I might as well ask, though this may not be the appropriate place for it - I'm not entirely sure which video card is defaulted in linux being that there are two on this system with switchable graphics (in Vista). I assume that it would be the integrated rather than the discrete card but as I understand it (and as you mentioned, Imelior) it is possible via the bios to alternate between the two? In that case would it be possible for me to write a program to alternate between the two? Just kind of curious.

Thanks again all.
lmelior
lmelior
This is way out of my league, but at the very least enabling switchable graphics would involve restarting X. I'd wager it's even lower level than that, though, since I believe graphics drivers are loaded with the kernel.
Aztral
Aztral
Well thanks for the reply... Something to look into when I'm bored I guess =).
lmelior
lmelior
Oh, I forgot to say that the integrated graphics are probably default. Try "lspci" and you should have an entry that says something about graphics or display. For example mine says "01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]." Failing that, the command to see what kernel modules are loaded is "lsmod." My graphics driver is near the bottom, and it only says "fglrx 2376104 31."

I'm curious to know what you find, because the things I found while searching suggested you couldn't get a display unless you explicitly chose one or the other.
alexcg
alexcg
Also you could enter the following command in terminal:
glxinfo | grep "OpenGL"

It lists information about the default OpenGL renderer on the X Server.

It should look like this (the following text is the result of the above mentioned command on my computer):
OpenGL vendor string: NVIDIA CorporationOpenGL renderer string: GeForce 9600 GT/PCI/SSE2/3DNOW!OpenGL version string: 3.2.0 NVIDIA 190.18.04OpenGL shading language version string: 1.50 NVIDIA via Cg compilerOpenGL extensions:


P.S. Sorry for my poor English :(
Aztral
Aztral
Imelior - lspci results in the following:
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:01.0 PCI bridge: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:03.0 Communication controller: Intel Corporation Mobile 4 Series Chipset MEI Controller (rev 07)
00:03.2 IDE interface: Intel Corporation Mobile 4 Series Chipset PT IDER Controller (rev 07)
00:03.3 Serial controller: Intel Corporation Mobile 4 Series Chipset AMT SOL Redirection (rev 07)
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)d
01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3400 Series
03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)

as for lsmod I think intel_agp is the module being used.

alex - Yeah before when I ran glxinfo I got nothing (well, a message that told me I wasn't openGL capable, I don't remember it exactly) and now when I run it I get a whole lot of text. At this point I'm just not sure why it's working now as opposed to before.


The only thing I can think of is that my openGL/SDL dev files may have been out of date and when I reinstalled the OS and installed them again I grabbed the up to date files.
Bregma
Bregma
Quote:
Original post by lmelior
This is way out of my league, but at the very least enabling switchable graphics would involve restarting X. I'd wager it's even lower level than that, though, since I believe graphics drivers are loaded with the kernel.

Device drivers are loaded with the kernel. Unlike Microsoft Windows, X11 is a userspace program. If you want to know what X is doing, you need to ask X. The file /var/log/Xorg.0.log will tell you useful information. You can tell X what devices to use by modifying the file /etc/X11/xorg.conf. Depending on what version of the X server you're running you may even be able to switch on the fly (try the command 'xrandr' and see what it tells you).

Stephen M. Webb
Professional Free Software Developer
lmelior
lmelior
Quote:
Original post by Aztral
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
...
01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3400 Series
...
The only thing I can think of is that my openGL/SDL dev files may have been out of date and when I reinstalled the OS and installed them again I grabbed the up to date files.

That's interesting, it appears to have found both cards. Alex saves the day though, I had the dumb yesterday and should've told you to run glxinfo just as he said. That'll tell you what's running for sure.

My guess is that it choked on the switchable graphics and didn't know what to install, so you may have had a plain old VESA driver. But that doesn't make sense either, because you still should've had software OpenGL support through Mesa. It may be that you installed ATI's binary blob fglrx, which is notoriously buggy and may have been fighting the intel_agp module. I've found a couple of cases of people having to blacklist intel_agp to get their discrete cards working.

Quote:
You can tell X what devices to use by modifying the file /etc/X11/xorg.conf. Depending on what version of the X server you're running you may even be able to switch on the fly (try the command 'xrandr' and see what it tells you).

Beware, the version of X in Jaunty (7.4) actually doesn't need to have a /etc/X11/xorg.conf file, as it tries to configure itself. A lot of newer distros are shipping without one, but it does use it if it's there. It seems like startup would be slower without it (though I haven't verified this), and I inevitably want to make some change to it anyway so I always generate it.
Aztral
Aztral
Thanks Bregma I'll look into that. I'm using Kubuntu 9.04 and the Xorg config file is definitely there.

It doesn't make a lot of sense to me either Imelior - especially since I didn't do anything differently in the older install of the OS that I did in this one.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.