EeePc 1015PN e Fedora 15: ION

Come vi avevo già anticipato in questo post, vi scrivo come ho piegato ION al mio controllo.

Il portatile EeePc 1015PN arriva equipaggiato con due schede video:

  • 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)
La prima è una schedina Intel che, per come la vedo io, basta nel 99.9% dei casi tipici di un netbook (cioè tutti tranne films in HD e giochi) e che fa consumare al portatile circa 600mA meno rispetto a ION.
Nvidia ION, dal canto suo, è decisamente più potente della scheda Intel integrata. Riesce a far girare molto fluidamente anche filmati youtube a pieno schermo ad alta qualità (quelli a bassa girano già bene sull’Intel), film in alta definizione, e permette ai giochi di girare. Come già detto, lo svantaggio è che consuma 600mA in più. Come tutti voi potete ben immaginare, se 600mA in più vengono drenati dalla batteria, da qualche parte devono andare. È facilmente intuibile che diventano calore che la ventola si trova a dover disperdere. Con la scheda avviata, la ventola sta al massimo e sensors registra temperature tra i 65° e i 80° in base al componente. Con ION disattiva la ventola va decisamente più lenta (rovinandosi meno, consumando meno e facendo meno rumore) e le temperature sono tra i 40° e i 55°. Per questo motivo lo script che ho fatto e che uso spegne di default ION e permette di attivarlo e disattivarlo su richiesta dell’utente.
La procedura che io ho usato è abbastanza semplice (almeno da replicare con una guida sotto mano) e dovrebbe funzionare sul 99.9% delle distro linux, ma non ve lo assicuro perché non ho modo di testare. Io vi consiglio di eseguire tutti i comandi come root. So che non è il massimo della finezza ma dati i path che stiamo usando è praticamente obbligatorio. Per ottenere una shell di root basta eseguire “su” e dare la password di root (mi raccomando, di root, non la propria)
  1. Installiamo il necessario per compilare (gcc), i sorgenti del kernel (kernel-devel), git (git) e dkms (dkms):
    1
    
    yum install dkms git gcc kernel-devel
  2. Attiviamo il demone di dkms:
    1
    
    chkconfig dkms_autoinstaller on
  3. Andiamo nella giusta cartella, scarichiamo i sorgenti, rinominiamo la cartella e ci entriamo:
    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. Creiamo il file /usr/src/acpi_call-git/dkms.conf con il seguente contenuto:
    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. Istruiamo dkms su quanto abbiamo appena fatto:
    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. Creiamo il file /etc/init.d/ion con il seguete contenuto:
    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. Rendiamo lo script così generato avviabile:
    1
    
    chmod +x /etc/init.d/ion
  8. Istruiamo chkconfig di prendersi cura del nostro script:
    1
    
    chkconfig --add ion

Il primo riavvio non porterà (quasi) nessuna differenza. Dovrete riavviare la macchina 2 volte per fare in modo che il tutto vada alla perfezione.

Per vedere se il pc vede entrambe le schede (questo dovrebbe funzionare dal secondo riavvio) eseguite:

1
service ion check

Per avviare ION eseguite:

1
service ion on

Per stoppare ION:

1
service ion off

Non ho ancora sviluppato una funzione per controllare se ION è attivo o meno, ma potete facilmente capirlo mettendo la mano davanti alla ventola (sul lato sinistro, vicino a voi). Se l’aria è molto calda, ION è attivo, se è pochi gradi più calda della temperatura ambiente non è attivo.

Related posts:

  1. EeePC 1015PN-RED018S
  2. YUM non ha e idee chiare sullo stato dei pacchetti se viene eseguito in cartelle di sshfs

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="">