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.

  • dogsleg
    replied
    Originally posted by agd5f View Post
    fglrx handles it internally. It's a hack to workaround the limitations of the xserver. The open driver could do it internally as well, but time would be better spent on doing it right, plus it solves a lot of other problems (hotplug of USB displays, etc.).
    Thanks for your answers!

    Hope that with going X.Org GPU hot-plugging into mainline the support for muxless cards is a very near thing. Muxless support is a business not only for AMD, yep. May be there is some info on the progress to handle it?

    Leave a comment:


  • agd5f
    replied
    Originally posted by dogsleg View Post
    Well, I can switch between integrated and discrete cards when using fglrx (beginning from 11.8 version till up-to-date). So fglrx doesn't depend on X server architecture for switching? Is it contains some bypass that allows to support muxless systems?
    fglrx handles it internally. It's a hack to workaround the limitations of the xserver. The open driver could do it internally as well, but time would be better spent on doing it right, plus it solves a lot of other problems (hotplug of USB displays, etc.).

    Leave a comment:


  • dogsleg
    replied
    Originally posted by agd5f View Post
    You have a muxless systems (i.e., the laptop panel is only attached to the integrated GPU). The panel is not attached to the discrete card so there is no way to switch. To properly support muxless systems the X server needs significant architectural changes to decouple rendering and display (basically both GPUs are active and the discrete card renders into a buffer that is shared with the integrated card. The integrated card then composites that buffer with the rest of the desktop when it updates the screen. There is some work going on to support this, but it's not ready yet.
    Well, I can switch between integrated and discrete cards when using fglrx (beginning from 11.8 version till up-to-date). So fglrx doesn't depend on X server architecture for switching? Is it contains some bypass that allows to support muxless systems?

    Leave a comment:


  • agd5f
    replied
    Originally posted by dogsleg View Post
    Is it my fault or a bug in X/radeon/kernel? What you, guys, can advise me?
    You have a muxless systems (i.e., the laptop panel is only attached to the integrated GPU). The panel is not attached to the discrete card so there is no way to switch. To properly support muxless systems the X server needs significant architectural changes to decouple rendering and display (basically both GPUs are active and the discrete card renders into a buffer that is shared with the integrated card. The integrated card then composites that buffer with the rest of the desktop when it updates the screen. There is some work going on to support this, but it's not ready yet.

    Leave a comment:


  • dogsleg
    replied
    X segfaults...

    Sorry for digging out that thread...

    I'm trying to get vga_switcheroo working on my notebook (Debian testing+unstable installed)with:

    Code:
    lspci | grep VGA
    01:05.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RS880M [Mobility Radeon HD 4200 Series]
    02:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Whistler [AMD Radeon HD 6600M Series] (rev ff)
    VGA switcheroo is configured:
    Code:
    cat /sys/kernel/debug/vgaswitcheroo/switch 
    0:IGD:+:Pwr:0000:01:05.0
    1:DIS: :Pwr:0000:02:00.0
    I'm trying to do this:

    Code:
    echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
    After that I'm restaring X, but getting just a black screen, then I entering root and root's password, and then reboot.

    Well, here is my Xorg.0.log (from default IGD-session): http://pastebin.com/urC2jd2L.
    And here is my Xorg.0.log.old (from trying to switch to DIS session): http://pastebin.com/gs3kUQQC.

    Is it my fault or a bug in X/radeon/kernel? What you, guys, can advise me?

    Leave a comment:


  • allbread
    replied
    On my Thinkpad W500 (with Linux Mint 10) I've run through the "switcheroo" installation procedure and currently see the following:

    When selecting "Discrete(*)"
    allbread@Tomato ~ $ glxinfo | grep vendor
    server glx vendor string: SGI
    client glx vendor string: Mesa Project and SGI
    OpenGL vendor string: Advanced Micro Devices, Inc.

    When selecting "Integrated(*)"
    allbread@Tomato ~/Desktop $ glxinfo | grep vendor
    server glx vendor string: SGI
    client glx vendor string: Mesa Project and SGI
    OpenGL vendor string: Tungsten Graphics, Inc

    This looks promising... is this the expected (correct) behavior?

    Since installing switcheroo I seem to have run into a problem - i.e. my system hangs whenever I attempt to logout/restart/shutdown manually from the desktop... however oddly enough the reboot via the switcheroo code (or from applications such as UNetBootin) seems to work just fine. I'm not 100% sure this is attributable to the hybrid switcheroo but it does seem like an odd coincidence... any ideas?

    Also, assuming the switcheroo functionality is running as intended, is there a way to get it to load the proprietary ATI drivers (instead of the open source drivers)?

    Is there be a way for me to modify the script to detect if I'm running on battery vs AC power (and adjust my GPU to integrated or discrete respectively) on boot?

    Leave a comment:


  • Kano
    replied
    For hardcore users you could try dsdt editing which seems to be a sport for osx users on normal pcs

    Leave a comment:


  • Death Knight
    replied
    Thanks for the information. And Airlied to works on PRIME architecture.

    Not lucky, my MB, bios can't show even BIOS screen on integrated graphics too. Can't set onboard GPU as primary...(Using old bios to enable 4.th CPU core)

    Anyway, I can use manual switching with current code (after Northern Islands 3D acceleration arrives). As Airlied says at his blog, X doesn't allow driver without screen, so PRIME is not yet in usable stage. What about Wayland? Does its architecture allows such a thing or it looks like to support it near future? Its good to have open sourced hybrid-crossfire like solutions. (Really don't know the "diff -ruN X11 Wayland")

    Leave a comment:


  • Kano
    replied
    If you are lucky you can disable it in bios.

    Leave a comment:

Working...
X