Page 1 of 9 123 ... LastLast
Results 1 to 10 of 81

Thread: natty: vgaswitcheroo, blacklist and modprobing!

  1. #1
    Join Date
    May 2010
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    natty: vgaswitcheroo, blacklist and modprobing!

    Gentlemen, I require your help to do some automation!

    I recently upgraded my notebook to 11.04 (fresh install), but cannot boot 2.6.38 kernel normally (blank screens, stuck in dmesg (?) output, no gui loads).

    In 10.10 I used vgaswitcheroo to turn the dedicated ATI card off (it didnt work anyway, loud fans and terrible heat - useless!) and ran compiz+effects nicely with the Intel Core i5 gfxchip.

    Now with the update, I cant boot without adding radeon.modeset=0 to grub, which then disables vgaswitcheroo. After some googling I found a post, where the user blacklisted the radeon driver and loaded it back in when everything booted fine.

    Now my actual question:
    How can i automate this process with a script that runs on login?

    Before Natty, I configured it like this in rc.local:
    Code:
    chown USER /sys/kernel/debug/vgaswitcheroo/switch
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    Now, with blacklisted radeon this does not exist of course. After successful booting I have to run
    Code:
    modprobe radeon
    and then (as ROOT, not with sudo) above lines to turn the ATI card off.

    My first thought was something like this:
    Code:
    #!/bin/bash
    sudo su &&
    modprobe radeon &&
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    ..but that does not work. I know, I should read more about scripting and bash..

    Any input would be much appreciated!
    Last edited by mexicanseaf00d; September 22nd, 2011 at 01:26 PM.

  2. #2
    Join Date
    May 2010
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    I'm such a fool..

    just added
    Code:
    modprobe radeon
    to the rc.local... doh

  3. #3
    aeronutt is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Feb 2009
    Location
    Central MD
    Beans
    759

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    Quote Originally Posted by mexicanseaf00d View Post
    I'm such a fool..

    just added
    Code:
    modprobe radeon
    to the rc.local... doh
    I'm a rookie when it comes to switcheroo, etc. But have been trying to get my i3 graphics and radeon discrete to work. So far, all I've done is add 'radeon.modeset=0' to grub list, which just turns it off completely.

    If you could, what does putting modprobe radeon into the rc.local do? And how do you then turn on/off the graphics cards using switcheroo after booting? Thanks in advance!

  4. #4
    Join Date
    May 2010
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    If its in rc.local, i dont have to do it 'by hand' after login everytime I turn on the pc!

    Now rc.local does the work for me -> re-loads the radoen driver, then powers the ati card down.

  5. #5
    Join Date
    Oct 2006
    Beans
    49

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    I am confused about what exactly you put in your rc.local. Would you mind posting the exact code that you put in to control the graphics?

    Thanks in advance,
    will

  6. #6
    Join Date
    May 2010
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    of course,

    Code:
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    modprobe radeon
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    # chown mart /sys/kernel/debug/vgaswitcheroo/switch #does not work since 11.04, dont know why
    exit 0

  7. #7
    Join Date
    Oct 2006
    Beans
    49

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    Thanks for posting that. When I put that code in my rc.local and put radeon.modeset=0 in my grub configuration, my ati card stays on and I get an error when I run cat /sys/kernel/debug/vgaswitcheroo/switch that says there is no such file. I get the same error when I try to do echo OFF > /sys/kernel/debug/vgaswitcheroo/switch in a terminal. Running modprobe radeon from the terminal does nothing for me, either. Any ideas?

  8. #8
    Join Date
    Oct 2006
    Beans
    49

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    Here is my Grub setup:

    Code:
    GRUB_DEFAULT=0
    GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux radeon.modeset=0"
    GRUB_CMDLINE_LINUX=""

  9. #9
    Join Date
    May 2010
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    yes, nomodeset or modeset=0 disables Kernel Mode Setting, as do the proprietary drivers btw. Vgaswitcheroo (and the "switch" file) exist only with KMS on.

    that was my problem too, so i left grub alone and edited
    Code:
     /etc/modprobe.d/blacklist.conf
    put blacklist radeon at the end of that file --> KMS will be enabled, but the problematic radeon driver will not load initially. After that, rc.local will reload radeon, but disable the card. Voila!

    The downside of this is "drm atom bios error" message which slows down logout/shutdown process a bit. As far as I can tell it does no harm to the system, but can be annoying. To fix that, one would have to turn the dedicated card on again before shutting down. There was a script somewhere on the net for that. I dont use it personally tho.

  10. #10
    Join Date
    Mar 2007
    Beans
    13

    Re: natty: vgaswitcheroo, blacklist and modprobing!

    Hi,

    Same problem here.

    Solution that you want to put in place, I think you should put this in your rc.local file :
    sleep 15
    rmmod radeon
    modprobe radeon modeset=1
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    # chown mart /sys/kernel/debug/vgaswitcheroo/switch #does not work since 11.04, dont know why
    exit 0

    I've added sleep as if this script is done before X start you can have troubles (I had so ...).

    Last thing : with this solution I had kernel panic as well sometimes on sleep/hibernate....(you are warned). Even when I add script in /etc/pm/sleep.d that manage to remove radeon module before suspend and reenable it after...(sometimes, with echo ON > ... there are kernel panic on my laptop...)

    Only good solution I've found is to use acpi_call (http://linux-hybrid-graphics.blogspo...tch-onoff.html)

    Other solution : use fglrx (as radeon is blacklisted during install) and do not use sleep/hibernate (or give a solution I didn't find...)

    Hope this help,

    Regards,

Page 1 of 9 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •