3D Acceleration or How I got DRI to work without tearing out my hair
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have seen ALOT of questions concerning this issue.
After starting this thread, I have also noticed alot of people reading this. If you have ANY experience, good or bad, trying to enable DRI on your card/chip, please post them. All experiences can be learned from.
This is also a constantly changing post. Come back and read it again. I'm adding/removing/changing the post constantly, to try to reflect new information as it becomes revealed.
But first, a disclaimer:
READ YOUR DOCUMENTATION
I use Slackware 10.2. I do not know if any of the following will definitely work in any other distribution!
Also, be aware that this may not work on your hardware.
My experience with this issue is mostly with the i810 family of chipsets, but as a general guide, it can be applied to most circumstances.
Check the various sections for your chipset/video card
But remember: Sometimes, because of BIOS limitations, or the card/chip itself, it just won't work
Links to external sites for various related topics:
A link for getting VIA\S3 Savage graphics by /bin/bash is here
Mostly about the i810 series: (Check further down for NVidia and ATI)
READ YOUR DOCUMENTATION
Direct Rendering (DRI) is dependant on many things, among them are kernel support, BIOS (both video and system), memory for the video (either onboard the card itself, or shared system memory), your xorg.conf, and the driver for your card/chip itself.
There are three things that are generally needed for 3D Acceleration (DRI) to take place:
1. Correct drivers for your video card/chipset. In the case of Intel, most use the supplied i810 driver in X. It will work fine. Some ATI and almost ALL NVidia cards/chips need their own drivers. Go ahead and download them. DO NOT COMPILE/INSTALL YET. Unless you want to do it again later. (I prefer the compile/install once method. You might like to do it multiple times. It's your life. Do as you wish)
2. Recompile the kernel. As long as you're at it, use the newest from www.kernel.org or the one on the second cd, whichever you want.
3. Edit /etc/X11/xorg.conf
Those are the quickies. Now for details
Download them. Borrow from a friend. Steal them from your roommate/brother/sister/that weird guy from down the street.
As I said, with the Intel card/chip, the ones installed w/X11 are fine (i810). ATI (if needed)and all NVidia, get them.
Compile the kernel:
Things to have enabled as MODULES:
* agpgart I don't care if it's a PCI-X bus, DRI requires this. You must also have DRM enabled too.
* chipset Enable the chipset support for whatever chip you use, ATI, NVidia or Intel.
* In Character Devices, also enable the same support (i.e., chipset). Also with Intel, enable the i810 AND i910 (As modules)
There are many other things you will need to be able to boot, but look in other threads for details. I'm only going to talk about the DRI enabling here.
Compile, install, and test your kernel. After it is functional, time for the next step. If neccesary, compile and install your driver now, with the new kernel.
Now come the variables. There are three general things that must be done (Your hardware driver may not allow these,check your documentation):
1. Load the DRI driver. Make sure this is showing:
# This loads the GLX module Load "glx" # This loads the DRI module Load "dri"
*** Some higher end cards do not want/will not work with DRI module loaded. READ YOUR DOCUMENTATION
2. Memory. Must have enough. in the "Graphics device section", find your card. Here is mine as an example:
*** Note: these are from MY xorg.conf. I do not know if they will work with your hardware.
Also, the "LFP,CRT" is for my laptop, and the i810 driver. You may have to change it to "CRT,CRT" for yours to work. Check the man i810 pages. ***
3. At the end of the file, look for this,and add it if you don't have it:
Section "DRI" Mode 0666 EndSection
You must have the Mode 0666 if you want anybody else to have DRI but root.
There maybe other tweaks that are needed, depending on your configuration and needs.
Checking if DRI is working:
Restart your X session, (restart it, reboot, whatever). When X is up, get a terminal window open. Type "glxinfo". On the second or third line it should say "Direct rendering: yes" .If so, it's working. Type "glxgears", and see what the frames per second is. Disable DRI by not loading the DRI driver in xorg.conf. Restart x and see what the FPS is now in glxgears. SHould be radical. Edit xorg.conf again, renable DRI, restart X, and try glxgears again...Wow. Big difference.
What if DRI is not running:
Try logging in as root, and trying. Your driver may not show that it is functional if you are not root. Also, look in /var/log/Xorg.0.log and see if there are any errors (EE) in there, and what was going on just prior to the error. That ought to steer you in the correct direction.
If this post helps, let us know. And, by the same token, if it doesn't let us know.
Let me know.
As things change, I will edit this.
This is not an all-emcompassing howto. It is just a general guide. Your experience may vary.
If you would like a copy of my xorg.conf, or my kernel config, they can be found here: www.cwwilson721.dyndns.org/slack
The individual files are: xorg.conf and config
Other Chips and other contributions:
READ YOUR DOCUMENTATION
Download and run the install script.
It's that easy.
This was posted by evilDagmar on the Nvidia install:
Originally Posted by evilDagmar
How about "nVidia users who are using the binary driver from nVidia not only don't need DRI (unless they want to install a second non-nVidia card in parallel) but merely have to run nVidia's installer script and tell it "yes" to everything."
nVidia-binary installs are markedly simpler than ATI to the point where nVidia users should probably be warned that literally none of the DRI documentation pertains to them. nVidia's latest installer will remove older versions of itself, make the necessary device nodes, push spurious copies of libGL.so out of the way, deploy the module, run depmod, and even modify the current xorg.conf now if you let it.
All that's necessary is to have a copy of the kernel source installed configured to match the running kernel and *not* be trying to run the installer through X (since the installer can't rmmod a previous in-use module, or test the sanity of the new module with X running).
nVidia is the lazy man's best friend in this respect.
**Note: When the Nvidia install asks you if you want to download a kernel interface from Nvidia's website, tell it 'No' and have it compile it's own driver**
Synt4x_3rr0r has posted the following script for Nvidia.
You may try it, but read the notes following after the script too.
Here's the script, save it as a .sh file:
#!/bin/sh # Usage: nvidia-use <enable|disable> # Switch between nvidia and nv use. You need to restart X for "nv" # (c) GPL by jlo VERSION="2005.04.07" if [ "$1" == "enable" ]; then ln -f -s ../../lib/libGL.so.1.0.7174 /usr/X11R6/lib/libGL.so.1 ln -f -s ../../lib/libGL.so.1.0.7174 /usr/X11R6/lib/libGL.so perl -pe 's/^\s+Driver\s+\"nv\"\s*$/\tDriver "nvidia"\n/;' -i /etc/X11/xorg.conf else ln -f -s libGL.so.1.2 /usr/X11R6/lib/libGL.so.1 ln -f -s libGL.so.1.2 /usr/X11R6/lib/libGL.so perl -pe 's/^\s+Driver\s+\"nvidia\"\s*$/\tDriver "nv"\n/;' -i /etc/X11/xorg.conf fi
You have to change the nvidia driver version number with the one u're running.
As root type:
sh nvidia-use.sh enable
Remember: This may not work with your driver. It does change the xorg.conf file, so back it up first
READ YOUR DOCUMENTATION
This was sent to me by Old_Fogie (Had to edit for length...Sorry dude. Read the complete post in this thread)
1. I installed slackware 10.2 with full install and the default kernel 2.4.
2. I never installed the testing kernel.
3. I installed/compiled a new kernel which is version 2.6.10
*********Note from cwwilson721: Get the complete kernel.config ouput here************
4. Once I got that working, I made a backup image using powerquest drive image so I allways had a place to go back to if I messed up the computer. Remember you are going to see an error at boot saying no AGP and that is correct as you have no video drivers installed. You are going to be running at 60hz flickery VESA mode. Once you get the drivers in, they run as Modules and load up and your AGP video card kick in just before X loads and get's into KDE desktop.
5. Then I went to ATI's website. I downloaded the XORG drivers there. The filename was fglrx_6_8_0-8.19.10-1.i386.rpm.
6. In the ATI readme/release notes, it clearly says that Posix shared memory must be enabled. I verified that the following line was in my Mepis ( I have an image of that too, so I had to go into windows to pull out that file and verify it), but this POSIX shared memory setting was NOT in my slackware; so I added the following to my /etc/fstab file.
tmpfs /dev/shm tmpfs defaults 0 0
then you have to mount this "tmpfs" drive by the following line in console:
root@pooter:~# mount /dev/shm
then you have to double-check that the mount was correct (again from the readme file) with :
root@pooter:~# mount | grep "shm"
I had no errors which ATI said was good.
6. Now to installing these drivers. I had saved them to my desktop.
that line converts the RPM to a usable .tgz file for Slacker's.
****Note from cwwilson721: get the full text of the install here)**********
NOTE: I did not do any manual module loading of chipsets or AGP stuff like Shilo lists in his "this is how I do it all" post.
Then I just went through the config program and rebooted. I used the defaults that the configure program gave to me. I figured I would play it the safeway.
Here are the respective items in my Xorg.conf file once modified by ATI.
*****Note from cwwilson721:(Get the xorg.conf file here)
That is what the default gives me. I'm sure there is some hard core tweaking that I have to do but I have not gotten to that yet.
Ok so I reboot. I notice errors for the no AGP as I mentioned previously, then X loads and my monitor changes frequency. I can hear it on my monitor it makes a pop sound. I clicked the button on it to see my monitor settings and it showed me I had 85 Hz. Very good sign. X finishes loading.
Once I'm in X I open up console.
I type in "glxinfo"
and the console returns this:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
there's a bunch of other stuff listed but those few lines there is what is of concern.
Sorry about the editing and putting some of the text off-site, but this post is getting LONG....lol
Thanks again to all who contributed