<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cyberey66</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cyberey66"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Cyberey66"/>
	<updated>2026-05-09T17:24:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50735</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50735"/>
		<updated>2011-02-26T04:36:54Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.  You must double check that the libraries are stored correctly as named below!  I would first &lt;br /&gt;
&lt;br /&gt;
the original xorg libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
then the fglrx libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        cp video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50734</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50734"/>
		<updated>2011-02-26T04:35:58Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Initial Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.  You must double check that the libraries are stored correctly as named below!  I would first &lt;br /&gt;
&lt;br /&gt;
the original xorg libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
then the fglrx libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50733</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50733"/>
		<updated>2011-02-26T04:35:20Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.  You must double check that the libraries are stored correctly as named below!  I would first &lt;br /&gt;
&lt;br /&gt;
the original xorg libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
then the fglrx libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50732</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50732"/>
		<updated>2011-02-26T04:34:37Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.  You must double check that the libraries are stored correctly as named below!  I would first &lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
To save these, before installing fglrx and while running the integrated card execute:&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
then the fglrx libraries must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
To save these, after fglrx and while running the discrete card execute:&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50709</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50709"/>
		<updated>2011-02-23T05:21:12Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50708</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50708"/>
		<updated>2011-02-23T05:19:15Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Auto detection and configuration for switchable graphics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Switchable_Graphics&amp;diff=50707</id>
		<title>Switchable Graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Switchable_Graphics&amp;diff=50707"/>
		<updated>2011-02-23T05:17:17Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Development status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.&lt;br /&gt;
&lt;br /&gt;
In Windows XP this switching requires a logout/login, while in Vista and Windows 7 there is support for runtime switching.&lt;br /&gt;
&lt;br /&gt;
Under Linux, the switching so far had to be done by entering BIOS setup and changing between &amp;quot;Internal&amp;quot; (low power, integrated), &amp;quot;External&amp;quot; (high performance, discrete) or &amp;quot;Switchable&amp;quot; (OS selectable) options.&lt;br /&gt;
&lt;br /&gt;
Depending on which Linux version you use, you could have the following effects&lt;br /&gt;
* On Ubuntu 8.10 (Intrepid) BIOS setting has to be either on Internal or External, not Switchable.&lt;br /&gt;
* On Ubuntu 9.10 (Karmic) the Integrated Intel card works with both Integrated or Switchable set&lt;br /&gt;
&lt;br /&gt;
Lenovo has published a [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-70495 Switchable Graphics FAQ] you may want to review.&lt;br /&gt;
&lt;br /&gt;
== Switchable Graphics and Docks ==&lt;br /&gt;
&lt;br /&gt;
ThinkPads with switchable graphics can only drive DVI or DisplayPort outputs on Docks by using the high-performance discrete graphics card, the integrated GPU is just not attached to the DVI or DisplayPort outputs (though VGA output through the dock is possible).&lt;br /&gt;
&lt;br /&gt;
== Development status ==&lt;br /&gt;
David Arlie has been working on switching between GPUs without having to reboot, and changing BIOS settings. An initial version of a new driver (vga_switcheroo) has been merged in the 2.6.34 kernel. This driver allows switching between graphics cards, but requires that the Xserver is restarted. Full seamless runtime switching support will require significant Xserver work.&lt;br /&gt;
&lt;br /&gt;
http://www.phoronix.com/scan.php?page=news_item&amp;amp;px=ODAyMg&lt;br /&gt;
&lt;br /&gt;
A script to switch between ATI discrete graphics with the fglrx driver and Intel integrated graphics with xorg driver through rebooting and selection in the bios is posted here.  The user must reboot, but no further configuration is needed as the script detects the card used and copies the correct libraries and configuration file.&lt;br /&gt;
&lt;br /&gt;
http://www.thinkwiki.org/wiki/Auto_detect_drivers_for_switchable_graphics&lt;br /&gt;
&lt;br /&gt;
== ThinkPad models which may have this feature ==&lt;br /&gt;
* {{R400}}&lt;br /&gt;
* {{T400}}, {{T500}}&lt;br /&gt;
* {{W500}}&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50706</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50706"/>
		<updated>2011-02-23T05:13:23Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Auto detection and configuration for switchable graphics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
The purpose of this script is to allow a user to select either the integrated or discrete graphics chip in the BIOS and boot into Linux and have it work without any configuration.  This scripts allows the user to switch between integrated Intel graphics using the xorg driver and discrete ATI graphics using the fglrx driver.  This script was tested on a W500 running Debian Wheezy on Kernel 2.6.32-5 and Fglrx 11.2.  At the time of writing this page, this is the quickest way to switch between integrated graphics and discrete graphics while using the binary ATI drivers.&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50705</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50705"/>
		<updated>2011-02-23T05:05:44Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Initial Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
    Section &amp;quot;Device&amp;quot;&lt;br /&gt;
        Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
        Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
    EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
    cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx	&lt;br /&gt;
    cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
    aticonfig --initial&lt;br /&gt;
    cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50704</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50704"/>
		<updated>2011-02-23T05:04:58Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
    /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
    /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
    /etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
    /etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50703</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50703"/>
		<updated>2011-02-23T05:04:25Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
	/etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
	/etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    #check for intel integrated drivers&lt;br /&gt;
    intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
    ATI=`lspci | grep ATI`&lt;br /&gt;
    &lt;br /&gt;
    if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for intel Xorg driver&lt;br /&gt;
        cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
        &lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
        # when xorg drivers were installed&lt;br /&gt;
        # switch libraries to Xorg libraries&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        &lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
    fi&lt;br /&gt;
    if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
        #setup drivers for ATI fglrx driver&lt;br /&gt;
        &lt;br /&gt;
        cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
        # switch libraries to fglrx libraries&lt;br /&gt;
        # need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
        # /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        # I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
        # when fglrx drivers were installed&lt;br /&gt;
        cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
        # link the other two libraries&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
            ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
        #same as before, stored a backup when fglrx was installed&lt;br /&gt;
        cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50702</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50702"/>
		<updated>2011-02-23T04:58:04Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
	/etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
	/etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
{{code}}&lt;br /&gt;
	#!/bin/bash&lt;br /&gt;
	#check for intel integrated drivers&lt;br /&gt;
	intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
	ATI=`lspci | grep ATI`&lt;br /&gt;
&lt;br /&gt;
	if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for intel Xorg driver&lt;br /&gt;
		cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
		# when xorg drivers were installed&lt;br /&gt;
		# switch libraries to Xorg libraries&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	fi&lt;br /&gt;
	if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for ATI fglrx driver&lt;br /&gt;
		&lt;br /&gt;
		cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
		# when fglrx drivers were installed&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
		# link the other two libraries&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
		#same as before, stored a backup when fglrx was installed&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
{{/code}}&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50701</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50701"/>
		<updated>2011-02-23T04:57:52Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
	/etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
	/etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
{{code}}&lt;br /&gt;
	#!/bin/bash&lt;br /&gt;
	#check for intel integrated drivers&lt;br /&gt;
	intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
	ATI=`lspci | grep ATI`&lt;br /&gt;
&lt;br /&gt;
	if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for intel Xorg driver&lt;br /&gt;
		cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
		# when xorg drivers were installed&lt;br /&gt;
		# switch libraries to Xorg libraries&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	fi&lt;br /&gt;
	if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for ATI fglrx driver&lt;br /&gt;
		&lt;br /&gt;
		cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
		# when fglrx drivers were installed&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
		# link the other two libraries&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
		#same as before, stored a backup when fglrx was installed&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
{{code}}&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50700</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50700"/>
		<updated>2011-02-23T04:56:17Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: /* Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
	/etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
	/etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
	#!/bin/bash&lt;br /&gt;
	#check for intel integrated drivers&lt;br /&gt;
	intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
	ATI=`lspci | grep ATI`&lt;br /&gt;
&lt;br /&gt;
	if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for intel Xorg driver&lt;br /&gt;
		cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
		# when xorg drivers were installed&lt;br /&gt;
		# switch libraries to Xorg libraries&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	fi&lt;br /&gt;
	if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
		#setup drivers for ATI fglrx driver&lt;br /&gt;
		&lt;br /&gt;
		cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
		# switch libraries to fglrx libraries&lt;br /&gt;
		# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
		# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		# I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
		# when fglrx drivers were installed&lt;br /&gt;
		cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
		# link the other two libraries&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
			ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
		#same as before, stored a backup when fglrx was installed&lt;br /&gt;
		cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50699</id>
		<title>Auto detect drivers for switchable graphics</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Auto_detect_drivers_for_switchable_graphics&amp;diff=50699"/>
		<updated>2011-02-23T04:52:13Z</updated>

		<summary type="html">&lt;p&gt;Cyberey66: â†Created page with '== Auto detection and configuration for switchable graphics ==  Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high perform...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Auto detection and configuration for switchable graphics ==&lt;br /&gt;
&lt;br /&gt;
Select ThinkPads feature switchable graphics, where a low power consumption integrated GPU and high performance dedicated GPU is combined and you have the ability to switch between them, sacrificing either performance or battery life.  Switching under Linux requires a reboot and if one wishes to use binary drivers, switching is generally not possible without first uninstalling the binary drivers and reinstalling the open source drivers and viceversa.&lt;br /&gt;
&lt;br /&gt;
Recently purchasing a W500, I wanted to be able to easily switch between the discrete ATI Fire GL graphics using the fglrx drivers and integrated Intel HD graphics with the open source Xorg drivers.  I decided to write a simple init script to detect which card is selected (using the BIOS) and configure xorg and provide the correct libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The script only works to switch between and ATI video card with fglrx drivers and Intel Integrated graphics with xorg drivers.  To select between the drivers, you simply select either 'Discrete' or 'Integrated' in the bios and then boot as normal.  The fglrx and xorg drivers use different libraries and this is the reason they are not compatible with each other.  The two specific libraries are: libGL.so.1.2 and libglx.so.  The script requires copies of the libraries to be stores in /usr/lib/ and /usr/lib/xorg/modules/extensions/ respectively.&lt;br /&gt;
&lt;br /&gt;
Specifically, the fglrx libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
and the original xorg libraries are stored as:&lt;br /&gt;
&lt;br /&gt;
	/usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	/usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
In addition, xorg.conf files for each driver, intel and fglrx, must be stored as:&lt;br /&gt;
&lt;br /&gt;
	/etc/X11/xorg.conf.intel for integrated graphics&lt;br /&gt;
	/etc/X11/xorg.conf.fglrx for discrete graphics&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
The first step is select the integrated graphics chip in the bios and boot into Linux without fglrx installed.  One then makes copies of the two libraries mentioned above.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.xorg&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg&lt;br /&gt;
&lt;br /&gt;
The next step is to create a simple xorg.conf and save it in the same directory as xorg.conf as xorg.conf.intel.  Simply is must contain:&lt;br /&gt;
&lt;br /&gt;
	Section &amp;quot;Device&amp;quot;&lt;br /&gt;
		Identifier  &amp;quot;Anyname here will work&amp;quot;&lt;br /&gt;
		Driver      &amp;quot;intel&amp;quot;&lt;br /&gt;
	EndSection&lt;br /&gt;
&lt;br /&gt;
The next step is the same but with the ATI card selected in the BIOS and the fglrx drivers installed.&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1.2.fglrx&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx&lt;br /&gt;
&lt;br /&gt;
Next we need a copy of an xorg.conf for fglrx.  You can simply generate one and make a copy using:&lt;br /&gt;
&lt;br /&gt;
	aticonfig --initial&lt;br /&gt;
	cp /etc/X11/xorg.conf /etc/X11/xorg.conf.fglrx&lt;br /&gt;
&lt;br /&gt;
Now we are ready to setup the script.&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
&lt;br /&gt;
The script is below and can be saved as video_switch.&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#check for intel integrated drivers&lt;br /&gt;
intel=`lspci | grep Integrated\ Graphics`&lt;br /&gt;
ATI=`lspci | grep ATI`&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$intel&amp;quot; ] ; then&lt;br /&gt;
	#setup drivers for intel Xorg driver&lt;br /&gt;
	cp /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;br /&gt;
&lt;br /&gt;
	# switch libraries to fglrx libraries&lt;br /&gt;
	# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
	# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
	# I stored a copy of libGL.so.1.2 to libGL.so.1.2.xorg&lt;br /&gt;
	# when xorg drivers were installed&lt;br /&gt;
	# switch libraries to Xorg libraries&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2.xorg /usr/lib/libGL.so.1.2&lt;br /&gt;
    	ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
    	ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.xorg /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	echo &amp;quot;Switched to Xorg Intel drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fi&lt;br /&gt;
if [ &amp;quot;$ATI&amp;quot; ] ; then&lt;br /&gt;
	#setup drivers for ATI fglrx driver&lt;br /&gt;
	&lt;br /&gt;
	cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf&lt;br /&gt;
	# switch libraries to fglrx libraries&lt;br /&gt;
	# need to switch /usr/lib/libGL.so.1.2 and &lt;br /&gt;
	# /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
	# I stored a copy of libGL.so.1.2 to libGL.so.1.2.fglrx&lt;br /&gt;
	# when fglrx drivers were installed&lt;br /&gt;
	cp /usr/lib/libGL.so.1.2.fglrx /usr/lib/libGL.so.1.2&lt;br /&gt;
	# link the other two libraries&lt;br /&gt;
    	ln -s /usr/lib/libGL.so.1.2 libGL.so.1&lt;br /&gt;
    	ln -s /usr/lib/libGL.so.1 libGL.so&lt;br /&gt;
	#same as before, stored a backup when fglrx was installed&lt;br /&gt;
	cp /usr/lib/xorg/modules/extensions/libglx.so.fglrx /usr/lib/xorg/modules/extensions/libglx.so&lt;br /&gt;
&lt;br /&gt;
	echo &amp;quot;Switched to Discrete fglrx drivers&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	echo &amp;quot;Switched to ATI fglrx drivers&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
We now set this as an init script to run during boot:&lt;br /&gt;
&lt;br /&gt;
First copy the script&lt;br /&gt;
        sudo cp scripts/video_switch /etc/init.d/&lt;br /&gt;
&lt;br /&gt;
Set it as executable:&lt;br /&gt;
        sudo chmod +x /etc/init.d/video_switch&lt;br /&gt;
&lt;br /&gt;
And set the script to run during boot&lt;br /&gt;
        sudo update-rc.d video_switch defaults&lt;br /&gt;
&lt;br /&gt;
Now you can select your graphics card in your bios and you are all ready to go!&lt;br /&gt;
&lt;br /&gt;
Sorry for the bad formatting, I just wanted to copy this somewhere and share it while it was still fresh in my head.  I will come back to clean it up.&lt;br /&gt;
--[[User:Cyberey66|Cyberey66]] 05:52, 23 February 2011 (CET)&lt;/div&gt;</summary>
		<author><name>Cyberey66</name></author>
		
	</entry>
</feed>