Asus N10Jc : Mendeteksi dual GPU secara otomatis pada Ubuntu 8.10

Sebagaimana diketahui, Asus N10Jc memiliki 2 graphics processor units, Intel GMA dan Nvidia 9300.

Nah untuk mendeteksi kedua GPU tadi secara otomatis pada saat kita mengaktifkan Ubuntu, dpt dilakukan melalui script dibawah ini :

$ gedit /etc/init.d/n10jcvideo

isikan dgn script ini  (Copy paste saja, jangan diketik sendiri) :

#!/bin/bash
VIDEO=`/usr/bin/lspci |grep -c nVidia`
if [ “$VIDEO” = 1 ]; then
echo “[Nvidia Switch enabled, using Nvidia xconfig]”
cp -f /etc/X11/xorgNVtest.conf /etc/X11/xorg.conf
else
echo “[Nvidia Switch disabled, using intel xconfig]”
cp -f /etc/X11/xorgIntel.conf /etc/X11/xorg.conf
fi

Setelah itu, ketik perintah berikut :

$ chmod +x /etc/init.d/n10jcvideo

$ ln -s /etc/init.d/n10jcvideo /etc/rc2.d/S12n10jcvideo

Sampai sini, anda membutuhkan 2 xconfigs : 1 untuk Intel dan 1 untuk NVidia.

Untuk Intel, buat file menggunakan nama xorgintel.conf

$ sudo gedit /etc/X11/xorgIntel.conf

Masukkan script dibawah ini (Copy paste saja, jangan diketik sendiri) :

# xorg.conf.failsafe (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section “Module”
Load “i2c”
Load “bitmap”
Load “ddc”
Load “dri”
Load “extmod”
Load “freetype”
Load “glx”
Load “int10”
Load “vbe”
EndSection

Section “Device”
Identifier “Configured Video Device”
Driver “intel”
Option “MonitorLayout” “LVDS,VGA”
Option “DRI” “true”
Option “Clone” “true”
Option “AccelMethod” “EXA”
Option “MigrationHeuristic” “greedy”
VideoRam 229376
Option “CacheLines” “1980”

EndSection

Section “Monitor”
Identifier “Configured Monitor”
EndSection

Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
EndSection

Kemudian save.
Sedangkan untuk  NVidia, buat file dengan perintah :

$ sudo gedit /etc/X11/xorgNVtest.conf

Isikan dgn script ini (Copy paste saja, jangan diketik sendiri) :

# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section “Files”
EndSection

Section “InputDevice”
Identifier      “Generic Keyboard”
Driver          “kbd”
Option          “CoreKeyboard”
Option          “XkbRules”      “xorg”
Option          “XkbModel”      “pc105”
Option          “XkbLayout”     “us”
EndSection

Section “InputDevice”
Identifier      “Configured Mouse”
Driver          “mouse”
Option          “CorePointer”
Option          “Device”        “/dev/input/mice”
Option          “Protocol”      “ImPS/2”
Option          “ZAxisMapping”  “4 5”
Option          “Emulate3Buttons”       “true”
EndSection

Section “InputDevice”
Identifier      “Synaptics Touchpad”
Driver          “synaptics”
Option          “SendCoreEvents”        “true”
Option          “Device”        “/dev/psaux”
Option          “Protocol”      “auto-dev”
Option          “HorizEdgeScroll”       “0”
Option        “MaxTapTime”    “0”
EndSection

Section “Device”
Identifier      “nVidia Corporation GeForce 9300M GS”

# Enabling the nvidia drivers means that all acceleration processing is done internally
# NVidia provide’s its own GLX module
# NVidia does not use the X server’s DRI stack.
#       Instead, it uses a proprietary method to route call directly to the hardware and provide drect rendering
# Though the only possible driver is nvidia, it is also possible to override NVidia’s methods:
#       by force-enabling AIGLX in “ServerLayout”, loading dri, and enabling DRI in “Device”
#       by enabling XGL (which is a bad idea anyway)
Driver          “nvidia”
# lspci | grep -i nv            <- To find device
Busid           “PCI:3:0:0”

# Adds support for 32-bit rendering on ARGB colorspace windows and pixmaps
# ARGB = alpha, red, green, blue
# AKA you should enable this on the new NVidia driver
Option          “AddARGBVisuals”        “True”
Option          “AddARGBGLXVisuals”     “True”
Option          “NoLogo”                “True”

# Experimental : enable hardware acceleration of the X render extension
# Enabled by default in newer drivers however
Option          “RenderAccel”           “True”

# Enable RGB overlay. (Not available with X composite)
# Also slow with virtual desktops larger than 2046×2047
# Requires depth of 24 or higher
# Requires an NVidia quadro
Option          “Overlay”               “True”

# Improves performance by using OS to notify X to update direct-rendered visuals instead of running through the hardware.
# Enabled by default in newer drivers
Option          “DamageEvents”          “True”

# Disable clipping OpenGL rendering to the root window
Option          “DisableGLXRootClipping”        “True”

# An X server option to disable accel. writes into offscreen video memory
# Might be needed if using AIGLX instead of proprietary NVidia interface
# Probably ignored if using the NVidia method
#Option         “XaaNoOffscreenPixmaps”

# Might cause crashes in older NVidia drivers.
# Forces the driver to allow GLX when composite on the X server is enabled.
# Not necessary on modern X servers; might decrease stability
#Option         “AllowGLXWithComposite”         “True”

# An X server option to allow occluded window pixel data to be remembered
# Caution in enabling. It might be faster to redraw the information than to fetch it
# BackingStore is implemented in a very hackish but memory-efficient way. Therefore, it tends to be slow
Option          “BackingStore”                  “True”

# Use below in conjuction with v-sync (see nvidia-settings)
# v-sync will however cap framerate to a max of 60 fps on most monitors

# Only use with plenty of vram
# Allows the X server to render into the third buffer without waiting for the other two buffers to be cleared
# (buffer swapping happens every fps, for example every 60 times per second)
# This can possibly avoid screen tearing and sudden low fps
# Touchy on 256-MB vram (if you play games with 4x AA), probably ok on 512
Option          “TripleBuffer”                  “True”

Option        “UseDisplayDevice”        “DFP-0”
EndSection

Section “Monitor”
Identifier      “Generic Monitor”
# Power saving mode
Option          “DPMS”
# at start X will automatically probe EDID information of the monitor.
# This can be overridden, but not recommended.
Horizsync       28-96
Vertrefresh     43-60
EndSection

Section “Screen”
Identifier      “Default Screen”
Device          “nVidia Corporation GeForce 9300M GS”
Monitor         “Generic Monitor”
Defaultdepth    24
SubSection “Display”
Modes           “1024×600”
EndSubSection
EndSection

Section “ServerLayout”
Identifier      “Default Layout”
screen          “Default Screen”
Inputdevice     “Generic Keyboard”
Inputdevice     “Configured Mouse”
Inputdevice    “Synaptics Touchpad”

EndSection

Section “Module”
# To understand these comments, understand that there are three methods of running acceleration:
#       XGL, AIGLX, NVidia

# The GLX module provides the hardware OpenGL extensions to the X server
# Through AIGLX, this loads the open source GLX
# Through NVidia, this loads NVidia’s GLX modules (closed source)
Load            “glx”
Load            “dbe”
Load            “extmod”
# The freetype module completely replaces the “type1” module
Load            “freetype”
Load            “i2c”
Load            “bitmap”
Load            “ddc”
Load            “int10”
Load            “vbe”
# DRI = Direct Rendering Infrastructure
# DRI is an X server extensions that allows “3d” acceleration calls to bypass the X server.
#       This leads the term “Direct Rendering” as the calls are routed directly to the hardware
#       This also leads to dramatic speed improvements/increases
# DRI is AIGLX’s response to XGL. However, DRI provides the benefit that the entire screen is compositing as well.
# Loading this module is harmless unless it is enabled in the “Device” section.
# NVidia will not use this module as it’s direct rendering calls are processed internally
Load            “dri”
# Load the mesa software acceleration libraries
#Load           “GLcore”

EndSection

# Specific only to the DRI module.
Section “DRI”
# Allows all users to access DRI
Mode 0666
EndSection

# Transparency = compositing
# Fancy Effects = GLX
# Using compositing with NVidia or AIGLX should incur no performance penalties
# Therefore:
# Disabling composite will disallow compiz, transparency, etc…

Kemudian “save”

Cara berpindah dari 1 GPU ke GPU lain, sebaiknya stlh system shutdown (dimatikan) terlebih dahulu. Pada saat off, ubah/ pilih GPU yg diinginkan. Kemudian aktifkan komputer anda, maka sekarang Ubuntu dalam N10Jc akan otomatis mendeteksi GPU yg digunakan dan akan menggunakan driver yg tepat untuk monitor anda.

Perlu diingat, pada saat anda menggunakan GPU Intel GMA, compizfusion tidak akan befungsi, tetapi batere anda akan lbh hemat 1-2 jam tergantung setting kecerahan (brightness) monitor dan hardware apa yg aktif.

Selamat mencoba

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: