Well, just for a recapitulation and ensuring my understanding. Basically, you would like a single program to be run twice (or even once) and run on two different cards simultaneously, all on a single monitor (so a single display). Am I wrong somewhere here ? Also, if you can give an example so that things will be definately clear to me.
Another thing: what things could you accept so that they won’t put you in a difficult situation ?
I guess libGL is responsible to communicate with the hardware. But maybe GLCore can do some stuffs too. libglx is also responsible of some things (mainly for contexts and so on). I’m personnaly not aware enough about GLCore in order to tell you more. You can checkout what function are in GLCore, but I don’t remember the command for that. I’ll try to have a look for this.
What you say about dlopen might not be true. You can make sort of a wrapper for GL, ie loading all GL functions threw glXGetProcAddress (even GL core functions) and then bound them depending on the card you have (C++'s polymorphism can help you for that purpose but is not necessary). This won’t break the future to my point of view.
When you say one program could drive multiple displays, what exactly do you mean ? Is this something like this:
./myprogram -display1 1 -display2 2
which will run out your program over, let’s say two Gnomes, so over two X connections ?
Or do you mean this program will run over a single Gnome, but will start out 2 windows, one requiring a card and the other the other card ?
If you use dlopen mapping displays to a specific library might not hurt so much (I never done it however).
For more understandings about DRI:
http://dri.freedesktop.org/wiki/
http://www.xfree86.org/current/DRI.html
(I couldn’t found the page that documented well DRI against X and glx).
For beeing quick and quite not full right, DRI is an interface that is able to directly communicate to GL without going to the underlying layers of X. This is done almost for ensuring fast queries and replies. DRI is full part of X and also the linux kernel provides facilities for DRI. This is so an 100% X/GNU framework. But some drivers are not compatible with it (let’s say they provide their own ‘DRI’), which are different. DRI can modifies some things under X and the kernel. So using DRI on a system not supporting DRI can result in very bad things.
As far as I know, ATI provides 2 drivers, one free that is supported over DRI and one other which, I guess, is like Nvidia, not over DRI.
Finally I think that what ameza said might help.
Sorry for the so bad informations. Hope that could help a bit however.