Compiling and installing the glx module Utah-GLX, xfree4 version IMPORTANT: This version of Utah GLX will only work with XFree86 4.x See "BUILDING THE MODULE(S) FROM SOURCE" lower down, if you want compilationdirections IMPORTANT ALSO: Currently, the only working hardware submodules are: nv (The nVidia TNT/TNT2/GeForce.... family of cards) INSTALLING THE GLX MODULE ============================== There are two parts to install: libglx.so, and libGL.so Step 1: ------- libGL.so is the client side of things. In theory, if you have a "pure" libGL.so from somewhere else, you can use your existing one. Otherwise, do a (g)"make install" in the libGL directory, and it will install the lib to /usr/local/lib, or somewhere on your system. Step 2: ------- libglx.so is the X-server side of things. You must add the servGL/libglx.so file(s) to the appropriate module directory for the X server. A (g)"make install" in the servGL directory normally installs it to /usr/X11R6/lib/modules/extensions This should work for most sites. You must now modify your XF86Config file. This file is usually found in the /etc/X11 directory. YOU MUST READ docs/README.yourcardhere for specific issue first. eg: docs/README.nv Step 3: ------- First, you must tell xfree to stop hogging the video ram. Unfortunately, the xf86AllocateOffscreenLinear() call does not seem to work sanely, which makes this hack neccessary. Look for the part with options for your video card; Section "Device" Now either add a new entry, or alter an existing entry, for VideoRam. If you are running at 1280x1024x32, you will need 8 megs untouched for GLX. So if you have a 16-meg card, tell xfree to only use 8 megs, with VideoRam 8192 This tells xfree to use only 8192k of video memory, == 8 megs (which leaves us the remaining 8 megs) If you have less than 16 megs of video memory, try setting your display to 800x600 and having xfree use about half the actual videoram. Step 4: ------- Now look for a section called "Module", and add an entry for glx. The module section entry may already exist, or be commented out. It may or may not also contain other module entries. If it is not there, you will have to add it yourself. The location within the file is not important, so long as itis outside any of the other sections. The module entry should look like this: Section "Module" < possible other modules > Load "glx" EndSection Step 5: ------- You may also want to edit the options in the glx.conf file. We try to put this in the same directory as your XF86Config. There are a variety of options for debugging and behavior. Most importantly, this is where you can enable DMA transfers which are essential for good performance with those drivers that support it. See the glx.conf file itself for details. Step 6: ------- Restart X, and you should now have hardware accelerated OpenGL applications. Please also check the chipset-specific README files in the docs directory for special issues that may affect your particular driver. ====================================================================== BUILDING THE MODULE(S) FROM SOURCE You need to have a copy of the Mesa source code to build the module. Look at www.mesa3d.org for a copy. Currently, the driver only works with the MesaLib-3.2.1 distribution, or with the 3.2dev branch of Mesa cvs. You can use either. MesaLib-3.1/3.2 may also work, but you will have to edit the makefiles to account for filename changes. Once you have the Mesa source code and have unpacked it, type: ./autogen.sh --with-mesa= make depend make make install (as root) This will build and install the glx.so X server extension and the libGL.so client-side library, and the config file. We try to put the config file in the same directory as your XF86Config; you can override this with the --sysconfdir configure option. You should not configure or build anything within the Mesa source directory. The relevent files will be imported by the glx build process. More information is available through the project homepage at: http://utah-glx.sourceforge.net/ See particularly the faq for troubleshooting help and the mailing list for the latest updates. There is also a quickstart mini-Howto at which you may find helpful. It's oriented toward getting the driver up-and-running for gaming. If you don't already have the Mesa libraries installed, you will want to build GLU and glut. These are utility and toolkit libraries required by many programs. You can build them as part of the glx module by passing --enable-extra to configure. You may want to place a symlink to the glx module's libGL.so as libMesaGL.so. That way existing binaries that expect the old Mesa 3.0 libraries will use the glx module instead. Available configure options: autogen.sh is just a shell script that calls autoconf to build the configure script, and calls it passing any command line arguments along. After you've run it the first time, you can pretty much use either script equivilently as long as you don't modify configure.in. ./configure --help will give you a list of options you can set manually. If you've previously built the glx module, you may want to run 'make real-clean' before trying any new config options to ensure that everything is rebuilt from scratch, especially if you didn't run 'make depend'. It defaults to building drivers for *all* the supported chipsets. If you're concerned about the size of glx.so, you can --disable the chipsets you don't want to support individually. The hardware specific code is quite small however. WARNING *** WARNING *** WARNING *** WARNING *** Not all the drivers have been ported yet. So you have to explicitly tell the configure script to disable them. Additionally, mmx ASM , etc. have not been tested. So the configure string that actually WORKS right now, is ./configure --without-x86-asm --without-mmx-asm --without-3dnow-asm \ --disable-mga --disable-mach64 --disable-i810 --disable-s3virge \ --disable-s3savage --disable-sis6326 configure looks for the Mesa source in a directory './Mesa' or './mesa' in the top level of the glx source. You can either symlink your Mesa source tree to one of those directory names, or pass the true location in the --with-mesa= option --enable-extra will ask configure to build and install libGLU and libglut from your Mesa source distribution. libglut may only be available with the cvs version of Mesa. --enable-debug builds with debugging symbols, minimal optimization. --enable-profile builds with less optimization and profiling hooks. see docs/profiling.txt for more info on this feature. --sysconfdir sets where to put glx.conf. If you don't specify a location with this option, we try to set an intelligent default by looking on some standard paths for your XF86Config file and placing it in the same directory. Basically we pick the first of the following directories to have an XF86Config file: /etc /etc/X11 /lib/X11 /usr/X11R6/lib/X11. This location gets compiled in, so you'll have to rebuild /servGL/serverglx if you change this. --with-moduledir sets where to put glx.so, the driver library. This is loaded both by the X server at (startup) as an extension for indirect rendering, and by direct client applications. By default it's installed in the same place as libGL.so. If you're packaging for distribution, you probably want to set this to the server modules directory, e.g. "--prefix=/usr --with-moduledir=/usr/X11R6/lib/modules". In that case, you can dispense with the absolute path in the "Modules" section of XF86Config. This location is compiled into libGL. A note on assembly: The configure script tries to enable assembly options based on the capabilities of your compiler, so it may include 3dnow support even if your version of the x86 processor doesn't support it. This is generally what you want since Mesa autodetects at runtime which routines to use, giving the best performance for distribution. You can also pass your processor type through the --host option to try to optimize for your particular machine. for example, '--host=k6-pc-linux-gnu' for the AMD K6 processors. If your compiler doesn't understand that particular architecture, configure will fall back on more generic options. --- Ralph Giles $Date: 2002/02/10 04:51:09 $