Hybrid graphics in Sony VAIO and Fedora 15
This a report on how i solved radeon driver related booting problem and automatically switched OFF the Radeon card of my Sony VAIO C series laptop in Fedora 15. This laptop has a AMD Radeon and Intel combination.
The steps may be somewhat similar for other laptops with ATI/Intel combinations in Fedora.
NOTE: This method disables the AMD Radeon card upon booting. The aim is to increase battery life(about 1.5 hrs in mine) and reduce the heat. I dont use any graphic intensive applications in linux, so the Radeon is better switched OFF. If you want 3D acceleration or looking for a method for hot switching of cards, you have no luck here.
Background
Fedora 15 comes with a open source radeon driver(not catalyst driver) and includes vgaswitcheroo a mechanism to support switch ON/OFF cards and login out/login card switching.
Upon booting, if the kernel detects hybrid graphics, a directory /sys/kernel/debug/vgaswitcheroo will be created with a file named switch.
The following commands are available,
cat switch – Displays the status of the cards.
[root@localhost ~]# cd /sys/kernel/debug/vgaswitcheroo/ [root@localhost vgaswitcheroo]# cat switch 0:IGD:+:Pwr:0000:00:02.0 1:DIS: :Off:0000:01:00.0
IGD – integrated ie Intel, DIS – discrete ie Radeon, Pwr – power ON, Off – power OFF, and + sign indicates which card if active.
echo OFF > switch – Turns OFF the inactive one.
echo ON > switch – Turns ON the card that is OFF
echo DIS[IGD] > switch – Switches the discrete card [or the IGD] active. You need to logout and login for this to take effect.
GNOME 3 doesnt load in my system with discrete card. So switching to discrete is pretty useless at the moment.
Note that vgaswitcheroo is gone if you have installed the proprietary ‘catalyst’ drivers either using RPMFusion or using the binaries provided at the AMD site.
Booting issue
I often had problem while booting with the system hangs at “dracut: starting plymouth daemon“.
I guess this was due to radeon driver. Not sure though.
The trick was to ‘blacklist’ the radeon driver, and load it once the system has finished booting. And then switch OFF the Radeon card. It worked for me.
You have to do this step only if you have problems during booting caused by the radeon driver. Else skip to here.
Add ‘blacklist radeon’ to the /etc/modprobe.d/blacklist.conf. This will cause the radeon driver not to load during boot.
[root@localhost ~]#echo blacklist radeon >> /etc/modprobe.d/blacklist.conf
Backup and then rebuild the initramfs.
[root@localhost ~]# mv /boot/initramfs-$(uname -r).img{,.bak}
[root@localhost ~]# dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
The dracut command may take a while to finish, and may report some warnings.
If you want, you can reboot now and see whether your issue at boot has resolved.
To load the radeon driver automatically once the boot is fine. We add the script to rc.local.
[root@localhost ~]# echo modprobe radeon >> /etc/rc.local
Note that Radeon is ON after booting whether driver is loaded or not. And radeon driver must be loaded to switch OFF the card,
Add the script to switch OFF the Radeon automatically after booting.
[root@localhost ~]# echo "echo OFF > /sys/kernel/debug/vgaswitcheroo/switch" >> /etc/rc.local
Suspend/Hibernate Issue
After a suspend or hibernate, the Radeon card gets switched ON. However, cat /sys/kernel/debug/vgaswitcheroo/switch wrongly shows the Discrete card as OFF. This can be confirmed by checking the remaining battery time or system temperature.
Now to switch the card OFF again, do
[root@localhost ~]# echo ON > /sys/kernel/debug/vgaswitcheroo/switch [root@localhost ~]# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
== To Do: automate this ==
To confirm whether the Radeon is switched OFF
One method is to check the remaining battery time before and after switching OFF. There should be a 1-2hrs difference.
Another method i use, is to check the system temperature by installing lm-sensors
[root@localhost ~]# yum install lm_sensors [root@localhost ~]# sensors acpitz-virtual-0 Adapter: Virtual device temp1: +42.0°C (crit = +96.0°C) temp2: +42.0°C (crit = +96.0°C) radeon-pci-0100 Adapter: PCI adapter temp1: -128.0°C
Here, the ‘-’ value indicates that the card is OFF.
A system temperature > 50C at idle also means Radeon ON in my system.
–
Thanks to,
http://ubuntuforums.org/showthread.php?t=1744188&page=1
doskey @ http://forums.fedoraforum.org/showpost.php?p=1492290&postcount=11
Tags: vgaswitcheroo howto, switchable graphics in fedora 15, turn off AMD/ATI, Hybrid graphics in fedora, switch off dedicated card in fedora, Sony VAIO VPCCB15FG





