Friday, September 09, 2005

How I got 3d accel for the ati drivers in ubuntu

Had a bitch of a time, until i found some guide that suggested doing this. since then, ive had no problems. make sure that you "sudo apt-get install build-essential kernel-headers" if you havnt already. (note: at the moment, dri is broken in breezy, so even a correct install of the ati drivers wont give 3d acceleration. currently doing a massive update, hopefully it was fixed)

1. Download the binary installer off of ati.com. run it with "sudo ./ati-driver-installer-8.16.20-i386.run" do an automatic install. (note to breezy users: breezy uses gcc 4 which isnt what the kernel was compiled with. make sure gcc 3.4 is installed, and before doing the previous command, do "export CC=gcc-3.4" or the installer wont compile the driver, even though the gui says its successful)

2. Do "sudo modprobe fglrx" to load the driver into the kernel. If theres no output, it was successful (hopefully). to check, type "sudo lsmod | grep fglrx". if you see something like "fglrx 258664 0", the driver was loaded successfully.

3. Back up your xorg.conf (something like "sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak"). now do "sudo perl -pi -e 's/Driver.*ati/Driver \"fglrx\"\nOption \"UseInternalAGPGART\" \"no/' /etc/X11/xorg.conf". this will change the device section of the config file to use the new driver.

if that doesnt work (or you dont trust my leet regex skillz), open the xorg.conf (sudo gedit /etc/X11/xorg.conf), scroll to the Device section, and change the driver from "ati" (or whatever it is currently) to fglrx, and add "Option "UseInternalAGPGART" "No"" so it looks something like this:

Section "Device"
Identifier "ATI Technologies, Inc. Radeon 9600 (RV350 AS)"
Driver "fglrx"
Option "UseInternalAGPGART" "no"
BusID "PCI:2:0:0"
EndSection

(if your identifier or busid is different it doesnt matter)

4. this is what took me FOREVER to find. copy these lines and paste them into a terminal. turns out that some things just dont know where to look for the accelerated opengl driver, and x is one of them. these commands will copy the driver to every place that things would be looking for it.

cd /lib/modules/fglrx sudo
sudo cp fglrx.ko /lib/modules/`uname -r`/
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/
sudo mkdir /lib/modules/`uname -r`/kernel/video
sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/video
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/video
sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/drivers/video
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/drivers/video
sudo mkdir /lib/modules/`uname -r`/kernel/drivers/video/fglrx
sudo sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/drivers/video/fglrx
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/drivers/video/fglrx
sudo mkdir /lib/modules/`uname -r`/kernel/drivers/misc
sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/drivers/misc
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/drivers/misc
sudo mkdir /lib/modules/`uname -r`/kernel/drivers/misc/video
sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/drivers/misc/video
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/drivers/misc/video
sudo mkdir /lib/modules/`uname -r`/kernel/drivers/misc/fglrx
sudo cp fglrx.ko /lib/modules/`uname -r`/kernel/drivers/misc/fglrx
sudo cp fglrx.`uname -r`.ko /lib/modules/`uname -r`/kernel/drivers/misc/fglrx

5. restart the xserver. you can do this gracefully with "sudo /etc/init.d/gdm stop". that command will drop you to the command line. login, and type "sudo /etc/init.d/gdm start" to return to the graphical login. either that, or ctrl-alt-backspace will kill X, and gdm will restart automatically.

6. open a terminal, and run glxgears. if those gears arent spinning blindingly fast, something is wrong. either there is a different problem then the ones i encountered, or i havnt typed this up properly. in either case, feel free to ask me for help.

any suggestions/critisms/flames are welcome. i apologize for the lack of capitalizations, crappy grammer, etc. sometime in the near future ill clean all this up, if anything is unclear, feel free to drop me a line.

0 Comments:

Post a Comment

<< Home