eee1015pn-acpitools
Linux Graphics Card Switching for the Asus EeePC-1015PN
Our Netbooks (EeePc 1015PN) are a corner case of hybrid graphics because they have a rather unusual hybird setup. The nvidia chip is directly wired to the display device and hdmi port (most muxless hybrid setups are build without this feature) allowing this model to switch the GPU modes manually or use a dual gpu mode (there is no bios change required - or available - to set the gpu mode. Everything is done in 'user space' via sending a acpi_call ).
This Laptop defaults to nvidia - only mode in Linux (the intel GPU is not visible via lspci) but via sending a specific acpi-call you can set the VGA Mode for the next boot cycle manually.
Available VGA Modes are:
- Intel GMA 3150 only Mode (the nvidia chip is powered off and not visible via lspci)
- Nvidia GT218 only Mode (the intel chip is not visible via lspci)
- Optimus Mode (both chips are visible via lspci => bumblebee only works in this mode)
We have prepared some gui scripts to manage the GPU states for the 1015pn as painless as possible.
Release Announcements
Installation
ubuntu ( precise - trusty ) & derivates; arch: amd64 / i386
- check that your System is fully updated and that the 'universe' and 'multiverse' Repositories are enabled.
sudo apt-get update && sudo apt-get dist-upgrade
If the update installs a new kernel reboot. You need to use the latest installed kernel before proceeding!
- Install the latest version of the VGA switching scripts as well as its dependencies (like the nvidia drivers, the acpi_call kernel module, yad, ect.).
sudo add-apt-repository ppa:mtron/eee1015pn
sudo apt-get update
sudo apt-get install build-essential eee1015pn-acpitools
After the install completed reboot to initialize the acpi-state.
debian testing / mint debian edition 1 (amd64 / i386)
TODO
Abstract:
download and install acpi-call-tools (dkms) [ all ]
download and install bbswitch-dkms [ all ]
download and install yad from ppa [ i386 | amd64 ]
download and install nvidia binary driver via repo: apt-get install nvidia-glx nvidia-settings
install other dependencies via repo: apt-get install mesa-utils openbox libnotify-bin gksu
download and install eee1015pn-acpitools: [ all ]
remove ubuntu upstart files: rm -rf /etc/init
add init.d startup links: update-rc.d fixvga.debian defaults
reboot
Other Distributions
Currently only debian & ubuntu are supported.
... but you are invited to extend support for your distro. Look at the ubuntu / debian examples in the scripts to handle the glx libs, kernel modules and xorg configs. Also upstart or sysinit scripts are needed to trigger the automatic configuration at the right time of the boot process. Make sure the display manager starts after the script finished running.
Configuration
Default Options
Default Options can be set in the /etc/eee1015pn/ds.conf configuration file. You do not need to edit this file manually. All settings (except the overrides) can be altered via the VGA-Selector GUI. Lines beginning with ## are comments.
### Configuration file for the EeePC-1015PN GPU Tool
### You can edit this file manually or use the provided gui
## set the default GPU mode
## Options: intel|nvidia|optimus
defaultgpu=intel
## print debug info
## Options: 0(off)|1(on)
debug=1
## enable logging to file
## Options: 0(off)|1(on)
logtofile=0
## Optimus mode - Auto power down the nvidia chip during boot
## Options: 0(off)|1(on)
nvautopowerdown=1
## uncomment next Line to override the automatic Desktop Session detection
## Options: gnome|kde|mate|cinnamon|xfce|LXDE
#DESKTOP_SESSION=gnome
## uncomment next Line to override the automatic Operating System detection
## Options: ubuntu|debian|fedora|arch
#distconf="arch"
## uncomment next Line to override the automatic architecture detection
## Options: i386|x86_64
#arc="i386"
Configure Monitors
Open the VGA Selector and double click on the icon of the active GPU. In intel and optimus mode the default randr manager of your Desktop Environment will open (in nvidia mode the nvidia-settings gui is launched) and assist you in setting up the new screens. The VGA Port works in intel & Optimus mode, the HDMI Port in nvidia & Optimus mode
Default X-Server settings
The default settings for the x Server depend on the VGA Mode. /etc/X11/xorg.conf is linked automatically during boot and all changes to this file will be lost.
To change the Default setup edit
Mode # active GPU Xorg Configuration file to edit
Mode 1 Intel GMA 3150 /etc/X11/xorg.conf.asus1015pn.intel
Mode 2 Nvidia GT-218 /etc/X11/xorg.conf.asus1015pn.nvidia
Mode 3 Optimus (Dual GPU) /etc/X11/xorg.conf.asus1015pn.intel
Mode 4 HDMI out in Optimus /etc/X11/xorg.conf.asus1015pn.optimushdmi
Optimus Mode: Second X-Server settings
Optimus Mode uses the intel GPU & config as default. Same as in bumblebee you can start a new X-Server that draws to the Nvidia GPU (see 'Advanced - Optimus : Start Xserver (nvidia) on HDMI' ) and run another independent X-Server on a external HDMI Display.
So what makes this approach different from bumblebee?
Bumblebee draws the window also on the nvidia gpu but puts its output via virtualgl "embedded" into the main
Xservers Screen. This brings some drawbacks to us like a unusable HDMI port and no vdpau acceleration. Sarting a new Xserver on the Nvidia GPU does not show this negative side effects.
The current configuration allows you to hook up a Display device to HDMI and either play a media file on the device via vdpau or start a simple openbox desktop (in the screenshot i use Ambience OB openbox theme, tint2 panel and conky). Your main X-Server on the laptop display will run in the background.
To switch between the two X-Servers use STRG+ALT+F8 (Intel X-Server drawing to the Laptop Screen) or STRG+ALT+F9 (Nvidia X-Server drawing to the external HDMI Device).
To edit the default xorg configuration for this second X-Server adjust/etc/X11/xorg.conf.asus1015pn.optimushdmiConfigure System for second X-Server:
- install openbox & tint2 panel & gmrun (a Program Launcher):
sudo apt-get install openbox tint2 gmrun
- check that your Xserver is set to allow "anybody" in the "/etc/X11/Xwrapper.config" file:
sudo less /etc/X11/Xwrapper.config | grep allowed
if the terminal output reads "allowed_users=anybody" you're ready to proceed. If not fix it.
- add magic cookie to xauth
xauth
list
and you should get an output like:
<your hostname>/unix:0 MIT-MAGIC-COOKIE-1 9fde426e5g03b20f4b7e51cb329d3033
Your long alphanumeric string WILL be different, thats ok. You need to add a new line and then exit to save it. Type in (of course replace <your-alpha-numeric-string>) :
add :1.0 MIT-MAGIC-COOKIE-1 <your-alpha-numeric-string>
and exit the xauth shell
exit
- add user to audio group & run 'ck-launch-session' in the new X-Screen
Usage / Screenshots
Run the gui script via 'System Tools - VGA Selector'
Main Screen
...shows the current GPU Mode. Double click on the icon to open the native xrandr manager of your Desktop Enviroment. (Supported DE's are unity, unity-2d, gnome-shell,
gnome-fallback, xfce, lxde and kde)
Reboot Window
To switch between the power saving intel GMA3150 mode and the nvidia mode click on the "reboot with..." button. Now choose the GPU Mode you want to use and press ok.
Settings Window
Each line in the table represents a settings option and it's current status (green=on / red=off / yellow=not supported on your Desktop Environment) . To change a setting double click on the corresponding line.
The available Settings are:
- Optimus: Auto Disable nvidia chip on boot
If active (green status icon) the nvidia chip is turned off autonatically in Optimus Mode
NOTE: Set this to inactive if you want to use bumblebee!
- Optimus : Start Second X-Server (nvidia) on HDMI
Start a new X-Server that draws to the Nvidia GPU (see 'Optimus Mode: Second X-Server settings' above) and outputs to a external HDMI Display Device. (vdpau & 3d fully works!)
- Shortcut: GPU info notify-osd
If active the Keyboad shortcut 'Ctrl+2' will show a notify-osd bubble with GPU Info
- Shortcut: Battery info notify-osd
If active the Keyboad shortcut 'Ctrl+1' will show a notify-osd bubble with the current Power consumption and remaining battery load value.
- Shortcut: Toggle Super Hybrid Engine (SHE)
If active the Hardware button to toggle the CPU state (left on top of the keyboard) will be mapped to Jupiter's 'Toggle SHE State' Script.
- Log to File
If active (green status icon) all debug output of the display-settings script will be saved in the logfile /var/log/acpi-call.log only. (you won't see any terminal debug output!)
- Generate Debug info
If active (green status icon) some basic system info is written to a debug file $HOME/eee1015pn-debug.txt
Set Default GPU Window
To set your primary GPU Mode go to the Settings Window and click on the "set default..." button.
FAQ
How to tweak ubuntu for this Netbook?
I have collected some tweaks for the 1015PN here
My ubuntu unity desktop does not load after installing the package. How can i fix this?
Most of the time this is due to broken glx links. Did you mess with video drivers? Press "AltGr + Print + K" to kill the session and return to the lightdm login window. Now change to a text console (Strg+Alt+F2) and run: (You need to restart lightdm for the changes to take effect)
sudo display-settings regenerate-glx && sudo display-settings fix
Mint Display-MAnager
Mint comes with Cinnamon DE and a Login Manager called Mint Display Manager (mdm). This display manager is still buggy and does not emit a notification event to the system i use to trigger the auto display configuration.
So replace mdm with lightdm. Instructions are here
Upgrades from earlier ubuntu releases
To regenerate the GLX libraries after a system upgrade (or mesa/nvidia update) run
sudo display-settings regenerate-glx
Configure HDMI Video out with Nvidia
Video out via HDMI works in nvidia or Optimus mode only. To configure it in nvidia mode use the nvidia-settings program. For Optimus mode see "Optimus Mode - Second Xserver settings" above.
Configure HDMI Audio out
Use the Volume control panel icon to open the pulse sound settings and choose the Nvidia Device in the Output tab. If you still get no audio via hdmi check via 'alsamixer' that the hdmi output is unmuted.
Bumblebee/ironhide project
the bumblebee project [url]https://launchpad.net/~bumblebee[/url] is working on a way to use the nvidia gpu on demmand. Our eeepc needs to be in Optimus mode to work with bumblebee. bumblebee and this helper script can be installed next to each other but be aware that this is in a very early development state and might break anytime.
See post http://ubuntuforums.org/showpost.php?p=11657158&postcount=274 for a short bumblebee install howto.
Supported Distributions
ubuntu & it's direct spins are fully supported (Lubuntu, Xubuntu, Kbuntu, Mint). Debian testing (Mint Debian Edition) is mostly done but gdm start might fail (see debian below)
Debian
Debian support is mostly done. Manually install the acpi_call dkms package, yad and the lastest eee1015pn-acpitools deb from the ppa. The package does not add any init.d scripts automatically because I'm having problems with them. Since debian does not use upstart, how can i make sure that my scripts finishes before gdm tries to start ?
If you want to test the init scripts add it via update-rc.d
update-rc.d fixvga.debian defaults
With the traditional init.d scripts i managed to get it working most of the time but sometimes gdm starts too fast and the script is not done preparing the configuration for the xserver so you will be dropped to a terminal login shell. Just login and run as root:
display-settings fix && /etc/init.d/gdm restart
Command Line Switches
usage: sudo display-settings <option> - where <option> is one of the following
auto ... In this mode the script will look for a .vga-selector file written by the GUI script and executes the acpi_call for the desired option (Intel,Nvidia or Optimus mode). It will also prepare the xorg configuration and glx libraries for the next boot. If the script can't find any .vga-selector file it will use the selected default GPU.
status ... will output current VGA Mode. E.g "Active GPU: Intel GMA3150 on PCI 00:02.0"
fix ... will automatically fix the display configuration depending on the available VGA Chips that can be accessed via lspci. It will also update the nvidia glx libraries after the install of a new(er) nvidia driver version.
regenerate-glx ... will regenerate the gpu dependant glx libraries. Use this option if 3d does not work after a distribution upgrade. It will reinstall the xserver & nvidia packages and symlinks the libglx.so files to work with this script.
reboot-intel ... activate intel for next boot. The nvidia chip won't be visible via lspci and is disabled so it won't draw any power from the battery.
reboot-nvidia ... activate nvidia for next boot. The intel chip won't be visible via lspci.
reboot-optimus ... activate both gpu's for next boot and prepare xorg conffiles for intel.
nv-off ... Optimus Mode only! This will disable the nvidia chip to save some energy.
nv-on ... Optimus Mode only! This will enable the nvidia chip.
config-intel ... prepare libglx.so and xorg.conf for intel
config-nvidia ... prepare libglx.so and xorg.conf for nvidia
Note that command Line switches override gui settings. e.g. if you set intel for reboot via the gui, and later run 'display-settings reboot-nvidia' via the terminal, the system will reboot to nvidia mode.
Devel
install bzr:
sudo apt-get install bzr
Optional: (usually not needed; just for me to remember... ) configure bzr to sign in to launchpad:
bzr whoami 'username <user@mail.com>'
=> create ssh key for username <email> and upload to launchpad (only once per key)
=> copy secret key to .ssh (mode 600) and create .ssh/config (replace username below)
Host bazaar.launchpad.net
User username
IdentityFile /home/mtron/.ssh/launchpad_id_rsa
Optional: login to launchpad with your Launchpad username. If no error is shown all is good ;)
bzr lp-login username
bzr checkout:
bzr branch lp:~mtron/+junk/eee1015pn
generate diff:
bzr diff
Optional: commit changes to local repository:
bzr commit -m "commit message"
Optional: sync local with online repository:
bzr push
update local snapshot from online repository:
bzr pull
Report Bug
Please use the included "Report a Bug" Wizard. It automatically collects some needed debug information that i'm tired asking about. A list of outstanding bugs is here. If your bug disappears from this list it means that the issue is fixed in current trunk.
Support / Help
To get help post your problem in this ubuntuforums.org thread (english lang only!). Crowdsourcing is much better than waiting for me to answer ;)