PDA

View Full Version : Linux and nVidia: an OpenGL How-to [deprecated]


Estral LC
06-06-2003, 09:16 AM
***Note: This little guide has been deprecated now that all mainstream Linux distributions use the Xorg-X11 base rather than XFree86. Xorg enables render acceleration by default.



There are some games streeting for Linux that require hardware GL support (such as Return to Castle Wolfenstein: Enemy Territory). However, many Linux distros use software GL support by default. If you try running a hardware GL-requiring game with software GL it will restart your X server - never fun.



The first thing to do is upgrade your driver to nVidia's latest release. As of today it's build 4496. I won't go into detail here of how to install it because there is already extensive documentation on this at nVidia's site and in their Linux Community Forum. The other prerequisite is that you must be using XFree 4.1 or higher. If you need to upgrade your X server you should get the update from your distro's site.



To find out if you are using hardware GL run # glxinfo and look at one of the first lines that says "Direct Render: x". If x = "yes" you are running hardware GL and are good to go, if it says "no" you are using software GL.



I don't know how to manipulate this on non-nVivia cards but I'm sure it will be about the same as all video properties are established in your X config file.







Here's how to modify your settings if you use an nVidia driver:



1. Log out and hit CTRL+ALT+1 or, depending on your flavor, CTRL+ALT+F1 to switch to a console.



2. Log in as root.



3. # init 3 (to kill the X server softly)



4. # emacs /etc/X11/XF86Config-4 (substitute the path for wherever your XF86Config-4 file is)...(vi can also be used to edit but Emacs is a lot friendlier)



5. In the Module section delete any lines that include "glx" other than a "glx" entry by itself (i.e. delete 'Load "/usr/X11R6/lib/modules/extensions/libglx.so"')



6. Also in the Module section add an entry: 'Load "glx"' if one does not already exist.



7. Hit CTRL+X, then hit S and then Y (this saves the buffer)



8. Hit CTRL+X, then CTRL+C to exit Emacs.



9. # init 5 (to start the X server normally)



10. Run # glxinfo again to ensure it now reports "Direct Render: yes"



If it still says "Direct Render: no" or if X doesn't start properly then something has gone wrong either in your config or in the process of the load. Look at /var/log/XFree86.0.log for clues as to where it went wrong.





Here are some snippets from my XF86Config-4 file you can use as an example (notice the tweaks I've added in the Device section - you may want to use them for your nVidia card, too):



Section "Module"

Load "dbe" # Double-Buffering Extension

Load "v4l" # Video for Linux

Load "extmod"

Load "type1"

Load "freetype"

Load "glx" # Added for hardware GL support

EndSection





Section "Device"

Identifier "device1"

BoardName "NVIDIA GeForce4 Ti4200" # Hand-tweaked from the original 'NVIDIA generic' entry

Driver "nvidia" #This changed at build 3123... used to be just "nv"

Option "DPMS" # Power Management

Option "NoLogo" # Turns off the nVidia logo splash

Option "NvAGP" "3" # Tells the driver to first try NvAGP, if it fails then use AGP-Art for accel. rendering

Option "RenderAccel" "TRUE" # Enables hardware acceleration - good stuff

Option "DigitalVibrance" "1" # Enables a small color/brightness boost, increments from 0-255

EndSection


</p>Edited by: <A HREF=http://p201.ezboard.com/bmonklybusiness43508.showUserPublicProfile?gid=est rallc>Estral LC</A> at: 7/3/05 10:14 am

Sebby
07-26-2003, 09:43 PM
Thanks Estral, been waiting to see how well games run on Linux. Now if I can just get my sndconfig to work right.






<div style="text-align:center">http://home.wi.rr.com/mustaine/sebby.jpg</div></p>

WiouXev
08-04-2005, 10:27 AM
umm.. it lost its stickey?


<div style="text-align:center">http://i4.photobucket.com/albums/y132/wiouxev/haha.jpg</div>

</p>

Estral LC
08-04-2005, 11:09 AM
As this information has been deprecated for months now I requested that it be un-stickied.


</p>