Display.getAdapter/getVersion Issues

Started by Jimmy, August 13, 2007, 10:43:45

Previous topic - Next topic

Jimmy

I am getting some strange results on Windows using the getAdapter functions.  The documentation seems to suggest it will return the name of the display adapter, but I end up getting odd results.  I believe this is most likely two separate problems.

First problem
The strings being returned by this function appear to be the driver's service name instead of the adapter name.  This information is in the same part of the registry, it just appears to be grabbing it from the wrong place.  For example, for an intel integrated chip, the string returned is "ialmrnt5".  The only reason I know this is an intel chip is because it's my computer.  Here's a partially more intuitive one from an ATI card: "ati2dvag".

When you navigate to the part of the registry this information is gathered from, it has the actual device strings there instead of just the service name.  The lwjgl documentation examples given seem to imply that those are the strings that will be returned.  This could just be a Windows specific problem, as I have not been able to test this behavior on a Linux system yet.

Second problem
On Windows Vista with an NVIDIA 8600M GT chip, my driver name returned is just "vga".  This is because lwjgl looks at device0, but device0 doesn't seem to be the correct adapter for my system.  In the registry you can see which one is the right one (it's present, it's just not device0).  This is probably due to Vista handling the way display drivers work slightly differently, but it's worth checking out and I can provide any information you need to help fix the compatibility if you don't have access to a Vista machine.

Endolf

Hi, I use the following to get information.

GL11.glGetString(GL11.GL_VENDOR);
GL11.glGetString(GL11.GL_RENDERER);
GL11.glGetString(GL11.GL_VERSION);


They have to be called after the display is created.

HTH

Endolf

Jimmy

Thank you very much sir, these strings are exactly what I needed.

elias

To make a long story short, we'd still like to improve getAdapter() and getVersion(), so patches in that area are more than welcome.

The long story is that GL11.glGetString is great - if you have a working opengl implementation, that is. getAdapter/Version() is meant for debugging when opengl can't be initialized for some reason. You'd need a way to create a more helpful response that "it didn't work, sorry", or you'd like automatic bug reports that keep track of the graphics driver name and version.

And finally, getAdapter() and getVersion() are only implemented on windows, mostly because that's where all the crap drivers are.

- elias


Endolf

Quote from: elias on August 13, 2007, 21:58:49
getAdapter() and getVersion() are only implemented on windows, mostly because that's where all the crap drivers are.

Would that explain why my Geforce 4200 in a Athlon 2100 running ubuntu has a higher frame rate than my laptop with a Geforce FX 5650go and a Pentium M 1.5 running XP? :)

Endolf

Jimmy

OK, after a few weeks of beta testing using the GL getString, I now have an appreciation for exactly the situation elias described.

So far out of about 970 users, 31 of them have 'GDI Generic' as their OpenGL renderer.  This has always been due to extremely old or improperly installed display drivers.  It's hard to help these people find the correct drivers without any information, so I am going to again put in a request that we improve the LWJGL versions of this.

Here's the ideas I had to improve it.

Correct Adapter Detection
getAdapter simply returns the first display adapter listed (device0).  However, on my system and several others I have tested, that is the incorrect display device.  One of the following would work:
-Allow the devices to be enumerated.  That way we could simply enumerate them and have a list of all of them (instead of being stuck with a generic vga one, which is unhelpful).  Would be implemented just going from device0 up until it got an error reading the base key.
-Find the currently active display adapter using the Windows registry.

Get Device Name
The drivers I have looked at in the registry seem to usually have a "Device Description" key, which the Device Manager uses to tell you what your actual card model is.  These keys are more useful for finding drivers, so it would be good to implement them somehow.  It could either look for these keys and if they exist return them instead, or we could possibly just add a new getAdapterName function or something similar

elias

Sounds reasonable to me. I don't have time to fiddle around with this at the moment, so if you want this, I'm afraid you'll need to fiddle around with the LWJGL source code. There is a generic registry query facility in place already, so if you're lucky you might even avoid touching native code! Alternatively, there might be an official windows API to fetch this information, so we can avoid this registry guesswork.

If/when you get this working, I'll be more than happy to accept a patch to include in lwjgl proper.

- elias