Vga switcheroo

Some laptops have both a low-power intel and a performance-oriented ati or nvidia graphics card. This page will describe how you can setup your system so it works under linux.

Unfortunately, under linux it isn't possible (yet) to switch graphics cards while X is running - it is possible however to switch GPUs with just a single command.

Kernel Configuration
The first thing you need to do is compile your kernel with the following options:

For Lenovo T400 with ATI:
 * CONFIG_EXTRA_FIRMWARE is 'radeon/R600_rlc.bin'
 * CONFIG_EXTRA_FIRMWARE_DIR is '/lib/firmware'

Choose a graphics driver from those available for your card and follow the linked guide.

Do not forget to add the following line to /etc/fstab (otherwise /sys/kernel/debug/vgaswitcheroo/switch is not accessible) none           /sys/kernel/debug debugfs defaults 0 0

Kernel parameters
For NVIDIA's (OR AMD )issues,I have tested some parameters that is successfully switched without any errors in kernel's If you have faced blank screen after with the tutorial,please check

1. Have you blacklisted the driver needed?

2. Have you not enabled the function in kernel's parameters?

In order to reduce the problem,kernel's parameter may need to change in order to load the modules needed. In grub.conf(/boot/grub/grub.conf,you know how to open it,I don't want to tell you much)

Please Check if you have these patterns in your config My being is from FEDORA 14,2.6.35-11 ,the setting is blocking the external driver,my stuff is NVIDIA

title Fedora (2.6.35.11-83.fc14.i686) root (hd0,2) kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686 rdblacklist=nouveau nouveau.modeset=0

Theoretically,just use nouveau.modeset=0 in order to disable the modules

Enabling the function:

title FedoraHybrid(2.6.35.11-83.fc14.i686) root (hd0,2) kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686 nouveau.modeset=1 initrd /boot/initramfs-2.6.35.11-83.fc14.i686.img

If you have made a custom-kernel, make sure you have add the followings before you boot,otherwise it will be default to switch to IGD or just both ON

Currently,the method is for second generation of 'smart-switch' only,the third one is still under development.

End of the update

Hprofile
After configuring (and installing) our kernel it is possible to switch graphics cards. However, changes in configuration files isn't taken care of; also, switching graphics cards isn't easy. That's why we will install hprofile, which will allow us to do some quick configuration switches. In hprofile we will create a new graphics profile: emerge hprofile ... mkdir -p /etc/hprofile/profiles/graphics

Then we need the following files to have a 'radeon' and 'intel' profile option:

Now we have the profiles set up. We still have to set up the commands to be executed to actually switch profiles.

also as mentioned earlier we can't switch graphics cards while X is running. so we will turn X off and on.

Additionally you have to set execute rights for this scripts chmod +x /etc/hprofile/profiles/graphics/scripts/*.start chmod +x /etc/hprofile/profiles/graphics/post-start chmod +x /etc/hprofile/profiles/graphics/stop chmod +x /etc/hprofile/profiles/graphics/ptest

now the final missing piece is setting up a different x configuration file for the different profiles. For more details look at guides on the individual cards.

after this we can switch profile with the commands hprofile graphics.intel or hprofile graphics.radeon

Links

 * http://en.gentoo-wiki.com/wiki/Intel_GMA
 * http://en.gentoo-wiki.com/wiki/Radeon