Hey peeps, long time no see, and yes, you did read that right…
With Via’s release a short while ago of OSS drivers for chrome9 cards, it’s now possible to have chrome9-powered Compiz-fusion on whichever distro you like! Officially they only support Ubuntu 8.04, but the source is readily available, so as long as you’re not scared of the command prompt (would you be using linux if you were? :P) you can compile your way to compiz-enabled beauty. This guide will outline the basics for compilation on Slackware 12.0, but it shouldn’t be too hard to port it to any other distro. Anyway… On with the guide…
To start with, you will need:
- Kernel source for a 2.6.24 variant. In this case I used 188.8.131.52 from www.kernel.org. I tried it with 2.6.26, but wasn’t able to get the via_chrome9 kernel module to compile, although it’s probably possible.
- The xf86 VIA vga driver source from here.
- The chrome9 patch package from here.
- A basic knowledge of how to compile and install a customised kernel.
Step 1: Unpack and patch your kernel
On a console in the folder you’ve downloaded the kernel source to:
tar xvjf linux-184.108.40.206.tar.bz2
Now unpack the chrome9 patch tarball (GUI is easiest with this one, as the folder and file names are a pain to deal with in the console). Copy these files to the linux source folder and run the following commands:
patch -p0 < via-agp.patch-2.6.24
patch -p0 < via-chrome9-drm.patch-2.6.24
Step 2: Configure, compile and install your kernel
Now you’re ready to configure your kernel. In Slackware, you’ll want to use the following (as root):
cp /proc/config.gz .
mv config .config
Now make sure that these items are compiled as modules (a little blob in the checkbox)
- Device Drivers –> Graphics Support –> /dev/agpgart (AGP Support) –> VIA Chipset support
- Device Drivers –> Graphics Support –> Direct Rendering Manager –> Via unichrome9 video cards
Now compile the kernel as follows:
make modules modules_install bzImage
When this finishes (it’ll take a good hour and a half), install the kernel with these commands (as root):
cp arch/x86/boot/bzImage /boot/vmlinuz-custom-220.127.116.11
cp System.map /boot/System.map-custom-18.104.22.168
cp .config /boot/config-custom-22.214.171.124
If you need an initrd you should create it now. As long as you’ve compiled support for your main filesystem (e.g. ext3, reiserfs) into your kernel, you don’t really need one though.
Something to note is that the kernel
installed the via_chrome9_dri to the wrong location for Slackware for some reason. I had to find where it was installed and move it to /usr/lib/modules/dri. requires via_chrome9_dri.so to be installed, so if you can’t find it, just rip the file from the “chrome9.83-242-u804.tar.gz”, downloadable from here. On Slackware, this file needs to be in /usr/lib/modules/dri, and in Ubuntu (I have subsequently learned) in /usr/lib/dri. Also, I have seen reports of the modules having the wrong read-permissions. Reset these with the chmod command.
Now set up your bootloader to boot from this kernel. In lilo, add these lines to your /etc/lilo.conf…
image = /boot/vmlinuz-custom-126.96.36.199
root = /dev/sda1 # Replace sda1 with your main HDD device node
label = NewKernel
Also, it is essential that you have your current kernel as an entry in there as well… If anything goes wrong and you haven’t, you’ll be in for a world of hurt, er, fun… Yes, fun.
To install lilio use the following command (as root):
lilo -v # I always use the -c flag as well to speed up booting, but I can't guarantee it'll work for you.
Now reboot, select NewKernel from the boot loader, and cross your fingers!
Step 3: Compile the VIA xf86 driver
First up, in a console, navigate to the folder in which you’ve got the driver tarball. Now… (as root)
chmod +x config_x11r7 configure autogen.sh
Step 4: Configure X.org
Now you can get to editing your xorg.conf. This bit was the most time consuming for me, as there were an unholy number of problems I experienced trying to get the configuration right… Insert the following lines under the section named (if they’re not already there). I always switch to runlevel 3 (text mode) before messing with my xorg.conf, as it makes it a lot easier to fix it if you screw up.
Device (modify the Driver line, don’t add a new one):
Option "LCDPort" "DFP_HIGHLOW" # This line is necessary to avoid the 'black screen' problem
Option "AIGLX" "on"
You’ll have to add in the following two sections to the end of the file…
Option "Composite" "enable"
Now restart your X-server (ctrl-alt-backspace), open up a console, and type the following:
glxinfo | grep render
It should come back with “direct rendering: Yes”. If it does then we’re nearly there! If not, then check your Xorg log files for anything which looks broken, and google the problem.
Section 5 (almost there!): Install Compiz-Fusion/Emerald
I’m not going to go into details about this section, as you may well suffer dependency hell trying to get them to install. I used the slackbuilds and instructions from SlackBuilds.org.
The problem I next faced was whenever I started compiz with “compiz –replace kconfig”, the window decorator died with the error “glx_ext_texture_from_pixmap is missing”. I spent a long while trying to get this to work, and ultimately did not find an answer… However, when I installed and ran the fusion-icon package, it just worked first time.
One of the most valuable things to take to heart if it all goes wrong is – “If at first you don’t succeed, try and try (and try) again”. It took me many hours to work through all of the problems I encountered along the way, but it was ultimately worth it for all the compiz-enabled gooey glory!
Until next time (whenever that may be!)… Enjoy!