Make ION working properly in Fedora 15

As I was already writing here, I’m going to describe you how to make ION working as you will.
This post is the English translation of this Italian post.

The EeePc 1015PN, at least the European version, comes with these two video cards:

  • 00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller (rev 02)
  • 04:00.0 VGA compatible controller: nVidia Corporation GT218 [ION] (rev ff)
The first one is a nice Intel integrated card that allows you to have good performance in the 99.9% of the typical netbook user-cases.
In the other hand, the Nvidia ION is way more powerful than the integrated Intel card. ION is capable of running HD videos, full-screen Youtube HD videos, games, and much more. The downside of the nVidia card is the power drain. This version of ION does drain ~600mA more than the Intel integrated card. These 600mA, as you can imagine, need also to be dissipated, forcing the vent to spin at its maximum speed. Even with the vent at the maximum speed, the temperature increases from the 40~55°C (idle with ION deactivated) to 65~80° (idle with ION active). Therefore I’ve created a script that keeps ION deactivated by default and allows the user to active it when is needed and stop it when is no more needed.
The procedure I’ve used is pretty easy (I love the KISS idea) and it should work on 99.9% of Linux distributions and with 99.9% of computer mounting ION (so not only 1015PN). I can’t grant it because I only tried this on Fedora 15 with the 1015PN. Since we are using global paths, every command has to be run with “su” or “sudo”. My suggestion is to start a root shell (open a normal shell, type “su”, type the root password) and exec all commands in that shell.
  1. Firstly, we need to install some software that are mandatory like: stuff to compile (gcc), kernel sources (kernel-devel), git (git) and dkms (dkms):
    1
    
    yum install dkms git gcc kernel-devel
  2. We need to active dkms daemon:
    1
    
    chkconfig dkms_autoinstaller on
  3. Go to the right folder, download the sources, rename the folder according to dkms naming system and go into the folder:
    1
    2
    3
    4
    
    cd /usr/src/
    git clone http://github.com/mkottman/acpi_call.git
    mv acpi_call/ acpi_call-git/
    cd acpi_call-git
  4. Create the file /usr/src/acpi_call-git/dkms.conf with the following text:
    1
    2
    3
    4
    5
    
    PACKAGE_NAME="acpi_call"
    PACKAGE_VERSION="git"
    BUILD_MODULE_NAME[0]="acpi_call"
    DEST_MODULE_LOCATION[0]="/kernel/acpi/"
    AUTOINSTALL="yes"
  5. Teach to dkms to administer what we have just created:
    1
    2
    3
    
    dkms add -m acpi_call -v git
    dkms build -m acpi_call -v git
    dkms install -m acpi_call -v git
  6. Create the file /etc/init.d/ion with the following text:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    
    #!/bin/sh
    #
    # Startup/shutdown script for Nvidia ION.
    #
    # Linux chkconfig stuff:
    #
    # chkconfig: 12345 05 95
    # description: Startup/shutdown script for Nvidia ION.
    #
    # Copyright (C) 2011 by Fabio Alessandro Locati
    #
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program.  If not, see .
    #
    ### BEGIN INIT INFO
    # Provides: ion
    # Default-Start: 1 2 3 4 5
    # Short-Description: The ION Manager
    # Description: The ION Manager
    ### END INIT INFO
     
    # Source function library.
    . /etc/rc.d/init.d/functions
     
    prog=ion
     
    check() {
        echo "\AMW0.DSTS 0x90013" > /proc/acpi/call
        result=$(cat /proc/acpi/call)
        case "$result" in
            0x30003)
                echo "Both Videocard recognised"
            ;;
            *)
                echo "Oops, something went wrong"
            ;;
        esac
    }
     
    init() {
        echo "\OSGS 0x03" > /proc/acpi/call
        return 0
    }
     
    on() {
        echo "\_SB.PCI0.P0P4.DGPU.DON" > /proc/acpi/call
        return 0
    }
     
    off() {
        echo "\_SB.PCI0.P0P4.DGPU.DOFF" > /proc/acpi/call
        return 0
    }
     
    load() {
        modprobe acpi_call
        return 0
    }
     
    start () {
        load
        init
        off
    }
     
    status() {
        echo "I haven't found a way to check if ION is ON, yet. Sorry :(."
        echo "You may understand it from the speed of the vent"
        echo "or the battery drain."
        return 0
    }
     
    case $1 in
    	check)
    		check
    	;;
    	init)
    		init
    	;;
    	on)
    		on
    	;;
    	off)
    		off
    	;;
    	load)
    		load
    	;;
    	start)
    		start
    	;;
    	status)
    		status
    	;;
    	*)
        	echo $"Usage: $prog {check|init|on|off|load|start|status}"
    	exit 2
    esac
     
    exit $RETVAL
  7. Make the script executable:
    1
    
    chmod +x /etc/init.d/ion
  8. Tell chkconfig to take care of our script:
    1
    
    chkconfig --add ion

The first reboot will be quite the same as the previous ones. You need to reboot twice to make everything working.
To see if the computer sees both video cards, you need to execute (until you make the whole procedure and reboot twice, this check will fail) as normal user or root user:

1
service ion check

To power up ION execute as normal user or root user:

1
service ion on

To stop ION execute as normal user or root user:

1
service ion off

I’ve not yet developed a function to check if ION is on or off, but you can easily understand it putting your hand over the vent. If the temperature is some degrees higher than the room temperature ION is off. If the air is really hot, ION is on ;) .

Related posts:

  1. EeePc 1015PN e Fedora 15: ION
  2. EeePC 1015PN-RED018S

4 comments

  1. I tried this out on a fresh fedora install and got some problems with “>” and replaced them with “>”. It seemed to work okay, the service ion check command worked as expected (fail, reboot, fail, reboot, working) but on login the whole system crashes. I traced it to the on option. when I did a service ion on, in a virtual terminal I got the same crash but a lot more output.

    I’m not sure where to find this output again (except for reproducing the crash which I don’t feel very inclined to do), figured I’d find it somewhere in /var/log but there’s quite a bit of logs in there to start with. Do you have any idea if there’s a certain log file I’m looking for in this case?

    I also read somewhere about a memory leak when switching from the intel integrated graphics. Could that be the case here?

  2. I think that the cause of yours problem could be a memory leak. Did you updated (yum update) your system? Which kernel are you using?
    When I wrote the post I had just updated the whole system and it installed the kernel 2.6.38.8-35. Now I’ve updated to 2.6.40 and as soon as I’ll reboot I’ll be able to tell you if some problem occurs ;)

  3. I updated before I tried this first but I’m not sure if I rebooted before I took on these steps so I redid them (I’m not sure if removing and re-adding the module in dkms would have helped). Got the same errors and hanging as before so I guess I got it right from the start.

    I’d pastebin the errors but I’m still a bit clueless as to where they might be found.

  4. It seems to have some problems with the kernel 2.6.40.. It also seems that the wl driver is broken with this version. I’m looking to fix it because is boring to choose the 2.6.38 kernel at every boot.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">