Infos zu Linux und die Unterlagen zu den Linux-Kursen am Wifi Wien.

Easily switching from fglrx to radeon and back

Once you have installed and set up the graphics card with the fglrx and the radeon driver (including multi-monitor setups), it's helpful to make the switch from one setup to another rather easy.

Basically, switching involves exchanging the xorg.conf file and the GL library file. But since the drivers are different in other respects too (suspend/resume, 3D acceleration), it's also convenient to change configuration files
at the same time, for example the xscreensaver configuration file to run different screensavers (radeon: no 3D; fglrx: all the 3D you can find Wink) or the hibernate.conf file for suspending the ThinkPad.

The attached radeonswitch script does exactly that.

You can switch the configuration either at boot time (if you set up GRUB/LILO to do so, see below) or while the system is up and running.

Note: switching while the system is running only work from radeon to fglrx, not the other way around. The fglrx driver seems to do some magic initialization to the graphics card which makes it unusable for the radeon driver. In other words, switching from fglrx to radeon needs a reboot of the system.

Prerequesites

  • Debian unstable running the latest X.org packages (6.9.Innocent.
  • the fglrx driver installed from a Debian package, see the "Problems with fglrx" page in the ThinkWiki if you have troubles. The script will not work if you install the fglrx driver not from a .deb file!

Installation

If you only want switch while the system is running, no special installation is needed. If you want to switch at boot time, as root issue

mv /path/to/downloaded/radeonswitch /etc/init.d
chmod 755 /etc/init.d/radeonswitch
update-rc.d radeonswitch defaults 95

to integrate it into the boot sequence of the Debian system.

Configuration

Put the xorg.conf files for the various configurations you use into /etc/X11, renaming them to xorg.conf.<config>. For <config>, use a word starting with fglrx for the fglrx driver or a word starting with radeon for the radeon driver, e.g. xorg.conf.fglrx.tv is my TV-Out configuration for the fglrx driver. The example configuration files on this site all use this naming convention.

If you want to switch other configuration files, add them to the CONFIGS variable at the beginning of the radeonswitch file (an example can be found as comment inside the script) and provide one version with a .fglrx suffix and one with a .radeon suffix. For example the I created one /home/spiney/.xscreensaver.fglrx file with almost all 3D screensavers active and another /home/spiney/.xscreensaver.radeon with mostly 2D screensavers configured. The file corresponding to the chosen driver will be copied to /home/spiney.xscreensaver when radeonswitch is run.

Usage from the command line

As root issue

/etc/init.d/radeonswitch set <config>

to switch to the corresponding configuration and restart X.

Usage at boot time

You have to configure your boot loader to switch the driver at system startup. For GRUB this means adding

RADEONDRIVER=<config>

to your kernel configuration line in /boot/grub/menu.lst. For LILO (not tested) it should work with adding

append="RADEONDRIVER=<config>"

to your /etc/lilo.conf line and running

/sbin/lilo

to install the new LILO configuration.

Of course you have to provide multiple menu entries for GRUB or LILO, otherwise you can't really switch. Wink If you provide menu entries where RADEONDRIVER is not appended, the graphics card setup will be left as it is.

Disclaimer

Use this script own your own risk! I give no warranty whatsoever that the script works as intended, so if it accidentally deletes your whole harddisk, you're on your own. But I'm using it myself for quite some time now, so that's unlikely. Smile Bug reports or feature requests are very welcome, feel free to use the feedback page.

AttachmentSize
radeonswitch1.21 KB