![]() | here you will found how to configure your system for parallel use of Nvidia's GLX and XFree's DRI in case you do not have Nvidia cards, or you have only Nvidia cards, you do not need to read this section in the first case you do not need the Nvidia GLX at all, in the second you can use the standard procedure for installing GLX |
Why Nvidia, why closed source drivers:
a bit mixed up answer:
with the open source driver its almost impossible to bring up a secondary card, so we should use the closed one.
why Nvidia card? well currently these are the only available affordable PCI video cards with some acceleration,
<FIX ME is this really so> I tried to use DRI on 2 parallel X servers, but it didn't work, i posted mails to XFree, DRI, lkml list, but i got a single answer with no valuable information on my problem. I tried to run DRI on a Matrox G550 DH AGP & SiS63xx PCI, when enabled for both cards i got agp errors, but enabled only for one of the cards, i was getting DRI up and running. Please someone confirm or prove me wrong ! </FIX ME>
I'll explain several ways how to get working configuration for both Nvidia GLX and XFree86 DRI, there are probably a lot of other possibilities, and may be these are not the simplest, but that are the ones i know to work.
The reasons why this is needed:
Nvidia should use different module path for xf86: the glx extension module from Nvidia is incompatible with the one from XFree86
Nvidia should use different XF86Config file: because DRI should be disabled for Nvidia and enabled for others.
If You find a simpler way, please mail it me and I'll include it.
![]() | this can not be used as is on SuSE Linux in order to make it easy for the user to switch between Mesa, XFree and Nvidia GL libraries, SuSE uses very complicated setup for the GL libraries. In order to use this setup you have to switch your configuration to XFree86's GL libraries, |
This is the configuration that i use at my system: ( ATI AIW Radeon 7500 AGP and Nvidia TNT2 M64 PCI ) XFree configuration files:
create a directory /usr/X11R6/libNV
mkdir /usr/X11R6/libNV
create links to the original /usr/X11R6/lib :
cd /usr/X11R6/libNV
lndir -silent -ignorelinks ../lib
install the Nvidia driver and libraries in /usr/X11R6/libNV
install Nvidia's libGLcore.so.1.0.[driver version] or better libGLcore.so.1 in /usr/lib make a symbolic link from /usr/X11R6/libNV/libGLcore.so.1 to /usr/lib/libGLcore.so.1 (this will allow you to easyly update your Nvidia drivers )
cd /usr/lib
ln -s ../X11R6/libNV/libGLcore.so.1 ./
note: the Nvidia libGL.so is installed /usr/X11R6/libNV so its invisible to the system unless you tell the system about the existence of /usr/X11R6/libNV. For this setup you must not do this, as it will break the standard X server start-up, but you can use the XFree GL libraries with Nvidia graphic card and Nvidia closed source drivers as well with a non Nvidia graphic card using XFree's DRI, which the GL library from Nvidia can not do.
add a line in the XFree configuration file for the Nvidia card to point the X server to the right location of the library and module path:
Section "Files" .......... ModulePath "/usr/X11R6/libNV/modules" .......... EndSection |
install the Nvidia kernel driver
now everything should be fine and you should be able to use DRI and Nvidia GLX at the same time, you will have a bit smaller performance in comparison to a setup which uses Nvidia's libGL & libGLcore, but the difference is not that big on my PC.
this example will give you the full performance of both the Nvidia card/s, and the non Nvidia card, as it uses the XFree's libGL for the non Nvidia card and Nvidia's libGL for Nvidia cards, but will require one more "Xserver" to be precise a simple wrapper to add the path to the Nvidia libraries and symbolic links to it for additional Nvidia cards.
It is almost the same as the previous one, with the difference that the X servers for the Nvidia cards should start with environment where Nvidia's libGL is known, while the X servers for non Nvidia cards shouldn't know anything about the Nvidia libGL. This requires a wrapper to be used for starting the X servers driving Nvidia cards.
install the Nvidia libraries and kernel driver like in the previous example, you may skip step 4. as libGLcore.so.1 is installed in /usr/X11R6/libNV and we'll inform the X servers driving Nvidia cards about the proper path to the Nvidia libraries.
the missing part --the wrapper
#!/bin/bash export LD_LIBRARY_PATH=/usr/X11R6/libNV exec /usr/X11R6/bin/X0 $* |
copy this lines in your favourite editor, save the file as XNV, make it executable:
chmod +x XNV
copy the file to /usr/X11R6/bin and make some symbolic links to it for additional Nvidia cards: for additional cards just add more link
cp XNV /usr/X11R6/bin
cd /usr/X11R6/bin
ln -s XNV Xnv0
ln -s XNV Xnv1
ln -s XNV Xnv2
remember to use /usr/X11R6/bin/Xnv0, /usr/X11R6/bin/Xnv1 ... instead of /usr/X11R6/bin/X0, /usr/X11R6/bin/X1 ... for your Nvidia cards while configuring the display managers in the next chapter, or when starting X on Nvidia card/s from console.
using the new Nvidia installer (work in progress, do not use if you don't understand what happens here ;) todo: write a script to perform steps 1-4 (does the script in the Appendix->scripts look OK, please give some feedback)
manually:
make a backup of your XFree GL libraries:
cd [XFree prefix]
on my Mandrake system i can use
cd $OPENWINHOME
find lib -name "libGL.*" -o -name "libGLcore*" -o -name "libglx.*" | xargs tar rpfv libGL-backup.tar
then,run the Nvidia installer
./NVIDIA-Linux-x86-1.0-4349.run --no-opengl-headers --xfree86-prefix=/usr/X11R6NV --opengl-prefix=/usr/X11R6NV
copy the installed files to /usr/X11R6/libNV
cd /usr/X11R6NV/lib && tar cv * | tar xvC /usr/X11R6/libNV/
restore the backuped GL libraries:
cd [XFree prefix]
tar xvfp libGL-backup.tar && ldconfig