Announcement

Collapse
No announcement yet.

Hybrid ATI/ATI - Intel/ATI solution: small switcheroo how to

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hybrid ATI/ATI - Intel/ATI solution: small switcheroo how to

    First of all, this "how to" is intended to people like me with almost no knowledge about compiling and patching kernels. Also to people that may want to share their experience using the switcheroo patch from David Airlie with their own machines with switchable graphics.

    Notes:
    GNU/Linux used: Fedora 12 with all updates
    Machine: ASUS M51Ta
    Graphic card configuration:
    - Integrated: 01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]

    - Discrete: 02:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3650

    (0) Downloads:
    http://www.kernel.org/pub/linux/kern...33-rc7.tar.bz2 and untar it to: /usr/src/
    http://people.freedesktop.org/~airli...ation-v6.patch and copy it to: /usr/src/
    http://people.freedesktop.org/~airli...ondition.patch and copy it to: /usr/src/

    (1) Patch kernel & compile kernel:
    su
    cd /usr/scr/linux-2.6.33-rc7/
    patch -p1 <../0001-vga_switcheroo-initial-implementation-v6.patch
    patch -p1 <../0002-vga-switch-hi-my-name-is-race-condition.patch
    make mrproper
    cp /boot/config-"kernel" .config # in my case: "kernel" = 2.6.31.12-174.2.3.fc12.x86_64
    yum install qt3-devel gcc-c++ libXi-devel # install development tools (just in case)
    make xconfig # make changes and save before quitting
    make
    make modules_install
    cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.33-rc7
    cp System.map /boot/System.map-2.6.33-rc7
    install mkinitrd
    new-kernel-pkg -v --mkinitrd --depmod --install 2.6.33-rc7
    gedit /boot/grub/menu.lst # edit grub to add the new compiled kernel

    (2) Run the new kernel and test:
    su
    mount -t debugfs none /sys/kernel/debug
    cd /sys/kernel/debug/vgaswitcheroo
    cat switch # to see which card is active
    echo DDIS > switch # to go to discrete card (log off and then log in after this command)
    echo DIGD > switch # to go to integrated card (log off and then log in after this command)
    echo OFF > switch # to just poweroff the card you aren't using

    (3) My tests:
    [root@FEDORA12x64test vgaswitcheroo]# cat switch
    0:+:Pwr:0000:01:05.0
    1: :Off:0000:02:00.0
    [root@FEDORA12x64test vgaswitcheroo]# glxgears
    1918 frames in 5.0 seconds = 383.455 FPS
    2090 frames in 5.0 seconds = 417.909 FPS
    2147 frames in 5.0 seconds = 429.261 FPS

    [root@FEDORA12x64test vgaswitcheroo]# cat switch
    0: :Off:0000:01:05.0
    1:+:Pwr:0000:02:00.0
    [root@FEDORA12x64test vgaswitcheroo]# glxgears
    1683 frames in 5.0 seconds = 336.440 FPS
    1618 frames in 5.0 seconds = 323.554 FPS
    1735 frames in 5.0 seconds = 346.940 FPS

    In my case there was no 3D acceleration with this kernel, even if I installed "mesa-dri-drivers-experimental". I think it is because the firmware R600_rlc.bin was missing in /lib/firmware/radeon. Anyway, the switcheroo works great. May be with the next stable kernel all will work with 3D acceleration. Special thanks to David Airlie that explained me how to use his switcheroo.

  • #2
    update with kernel-2.6-git 2010-02-12

    Yesterday I made exactly the same process but this time I used kernel-2.6-git instead of using kernel linux-2.6.33-rc7:

    su
    cd /usr/src/
    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    cd linux-2.6-git/
    patch -p1 <../0001-vga_switcheroo-initial-implementation-v6.patch
    patch -p1 <../0002-vga-switch-hi-my-name-is-race-condition.patch
    make mrproper
    (...)

    This time 3D acceleration works great!! I tested with a software to visualize and manipulate 3D images. It works perfect. Compiz also works faster and the computer is not as hot as before.

    Comment


    • #3
      desktop launchers for hybrid switch ASUS M51Ta

      # first of all, to use these two launchers you will need this program:
      $ yum install beesu

      These two desktop launchers can be used to switch graphics when the computer is iniciated. They work great on my laptop ASUS M51Ta. Like both cards are on when the computer is turned on, to use HD3200 card (integrated one) I just have to turn off the HD3650; so this launcher is used:

      # this should be copied on an "file.desktop" (you sould give it execute permission):

      [Desktop Entry]
      Version=1.0
      Encoding=UTF-8
      Name=HD3200 switch
      Exec=beesu 'mount -t debugfs none /sys/kernel/debug ; cd /sys/kernel/debug/vgaswitcheroo/ ; echo OFF > switch'
      Type=Application
      Categories=Other;
      Icon=media-flash
      Terminal=false

      And to use the discrete card (HD3650), it must switch and logout with this other launcher, then you login and the switch is made:

      [Desktop Entry]
      Version=1.0
      Encoding=UTF-8
      Name=HD3650 switch
      Exec=beesu 'mount -t debugfs none /sys/kernel/debug ; cd /sys/kernel/debug/vgaswitcheroo ; echo DDIS > switch ; killall -u USERNAME'
      Type=Application
      Categories=Other;
      Icon=media-flash
      Terminal=false

      # change USERNAME -> your user name

      I hope this helps to others trying to use hybrid graphics in their laptops. Don't hesitate to write to
      hybrid-graphics-linux@lists.launchpad.net
      https://launchpad.net/~hybrid-graphics-linux

      Comment


      • #4
        How does X handle this? I have a Thinkpad W500 with a integrated Intel i965 and a ATI 3650. The W500's switchable graphics work find in Vista and Windows 7. You can switch between graphics chips on the fly. Can switcheroo do this with two different brands of graphics chips? What is the xorg.conf config look like?

        Comment


        • #5
          Actually, looking at the patch, it does specifically mention that this works on the W500. How does X11 handle this What does your xorg.conf look like?

          Comment


          • #6
            Dug further into this. Looks like you have to log out of X and back in once you switch the graphics. Like to see a xorg.conf that knows about both cards.

            Comment


            • #7
              Originally posted by Ryushin View Post
              Dug further into this. Looks like you have to log out of X and back in once you switch the graphics. Like to see a xorg.conf that knows about both cards.
              An uneducated guess would be that you don't configure any cards in xorg.conf and rely on autodetection?

              Comment


              • #8
                I'll need to have an xorg.conf as I have specific settings for the mouse buttons in a Thinkpad. I guess I could have the script swap xorg.conf files as well.

                Comment


                • #9
                  I didn't say to go without an xorg.conf, just don't configure any video card (remove the "Driver" line) and leave the rest.

                  Comment


                  • #10
                    In my case (ASUS M51Ta - HD3200 / HD3650), I even don't have a xorg.conf and the switcheroo works fine.

                    @Ryushin: Just something important: if you are going to compile your own kernel to test don't forget to copy "R600_rlc.bin" and "R700_rlc.bin" (radeon firmware files) to /lib/firmware/radeon/ before your compilation. You can fin them at http://people.freedesktop.org/~agd5f/radeon_ucode/

                    Comment


                    • #11
                      Originally posted by rmartinez View Post
                      In my case (ASUS M51Ta - HD3200 / HD3650), I even don't have a xorg.conf and the switcheroo works fine.

                      @Ryushin: Just something important: if you are going to compile your own kernel to test don't forget to copy "R600_rlc.bin" and "R700_rlc.bin" (radeon firmware files) to /lib/firmware/radeon/ before your compilation. You can fin them at http://people.freedesktop.org/~agd5f/radeon_ucode/
                      Thank you for the link to the files. I had not done that yet. I'll be testing this morning.

                      Comment


                      • #12
                        Well, I got to say I'm pretty excited about this. I got this to work to a limited degree.

                        I ran into one issue with the /sys/kernel/debug/vgaswitcheroo not showing up when you mount /sys/kernel/debug. The issue was resolved after digging further and finding out the KMS has to be enabled on both the Intel and ATI drivers. I was disabling the KMS on the ATI driver because the power management does not work with KMS enabled.

                        Now this is the problem that I've encountered and I boot into single user mode to test this:

                        Upon boot up, both the Intel and the ATI card are powered up and the Intel card is the primary. Everything works find. I can start X and glxinfo shows DRI is working fine.

                        Switching to the ATI card works fine using:
                        echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch

                        I think I started X as well and it also worked. But I can't remember at this point.

                        Now comes the problem. If I switch back to the Intel card using:
                        echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
                        it powers off the ATI card. Once the ATI card has been powered off, switching to it again shows a blank screen. It even seems as if the back light is turned off as well.

                        So I've troubleshooted some more. If the ATI card is ever powered off, it's not possible to reconnect to it again and have the screen work. Steps I've taken to troubleshoot:

                        Method 1:
                        Fresh Boot
                        echo "OFF"> /sys/kernel/debug/vgaswitcheroo/switch
                        ATI card is now turned off.
                        echo "On"> /sys/kernel/debug/vgaswitcheroo/switch
                        ATI card is now turned on.
                        echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch
                        Result is a blank screen with I think the black light turned off.

                        Method 2:
                        Fresh Boot
                        echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch
                        Everything works correctly as the ATI card is swiched over. The Intel graphics is powered off at this point.
                        echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
                        Everything works correctly as the Intel graphics is turned on and the screen switches over to it. The ATI card is powered off at this point.
                        echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch
                        Switching to the ATI card again results in a blank screen.

                        So the problem seems to be, once the ATI card is powered off even once, I can never switch to it again and have the screen work.

                        Any ideas or debugging issue I should post?

                        Comment


                        • #13
                          Oh as a side note, I can now run switchable graphics in the BIOS and have the ATI graphics powered off while using Intel graphics. The problem was before that the ATI graphics would remain on and in a full speed mode using a lot of power and making the laptop quite hot. At least now I can power down the ATI card while using the Intel graphics and have the laptop remain nice and cool. So even this is a nice feature for me.

                          Comment


                          • #14
                            it really DOES work! awesome!
                            thanks!!!

                            battery performance increased from 1h to 2h (as in windows)

                            although the command "install mkinitrd" didn't work.
                            Code:
                            install mkinitrd
                            install: missing destination file operand after `mkinitrd'
                            Try `install --help' for more information.
                            thank you!

                            Comment


                            • #15
                              however suspend mode does not work. fan is running at full speed and the display stays blank.

                              Anyone else experiencing the same problem? (asus m51ta (hd 3200 + hd 3650))

                              Comment

                              Working...
                              X