Asus switcheroo
From Hybridgraphics
(Created page with "https://github.com/awilliam/asus-switcheroo/") |
(Added notes on a script-based solution for semi-automatic hybrid graphics switching on asus platforms.) |
||
| Line 1: | Line 1: | ||
| + | The Asus Switcheroo module can be obtained at: | ||
| + | |||
| + | |||
https://github.com/awilliam/asus-switcheroo/ | https://github.com/awilliam/asus-switcheroo/ | ||
| + | |||
| + | |||
| + | Script-based solution ( by eemil@gmx.com ): | ||
| + | |||
| + | The script-based system includes several files, and allows automatic | ||
| + | switching between intel and nvidia, at least on pre-optimus UL30VT. | ||
| + | |||
| + | Here is how it works: | ||
| + | # User writes either "intel" or "nvidia" to /home/user/switcheroo.txt. | ||
| + | # Script detects this and waits for the user to log out (detected as | ||
| + | user's gnome-session not running) | ||
| + | # Turns off gdm3 (debian) or gdm (ubuntu). | ||
| + | # Uses the awilliam module (asus-switcheroo) to switch to the desired | ||
| + | card. | ||
| + | # Uses acpi_call to turn off nvidia if required | ||
| + | # Links appropriate version of libglx.so and libGL.so, and xorg.conf so | ||
| + | that X and openGL apps can find them | ||
| + | # Starts gdm again. | ||
| + | |||
| + | Attached: | ||
| + | * my xorg.conf files for both cards. | ||
| + | * display-settings, the script that does one-shot card switching | ||
| + | depending on switcheroo.txt, and runs at boot so that the last selected | ||
| + | card will be used | ||
| + | * graphics-switch.sh, the script that monitors switcheroo.txt and calls | ||
| + | display-settings when no user session is running | ||
| + | * graphics-switch-daemon, the script that starts graphics-switch.sh on | ||
| + | the background at boot | ||
| + | * an example switcheroo.txt. | ||
| + | |||
| + | Hopefully comprehensive installation procedure: | ||
| + | |||
| + | acpi_call: | ||
| + | -In cloned acpi_call git, do | ||
| + | -Compile acpi_call | ||
| + | -sudo cp acpi_call.ko into /lib/modules/$( uname -r )/kernel/drivers/acpi/. | ||
| + | -sudo depmod -a | ||
| + | |||
| + | asus-switcheroo: | ||
| + | * In cloned asus-switcheroo git, do sudo make install-ubuntu | ||
| + | * Make sure that both /etc/modules and /etc/initramfs-tools/modules have the lines: | ||
| + | <nowiki>asus_switcheroo dummy_client=1 | ||
| + | i915_jprobe</nowiki> | ||
| + | |||
| + | xorg.conf files: | ||
| + | * IMPORTANT: If your PCI ID's are different, please modify. See lspci for the numbers. | ||
| + | * sudo cp xorg.conf.intel xorg.conf.nvidia /etc/X11/. | ||
| + | |||
| + | |||
| + | To get nice notifications for scheduled switches: | ||
| + | <nowiki>sudo apt-get install notify-osd</nowiki> | ||
| + | |||
| + | Finally, my scripts: | ||
| + | * Make sure that U=your-user-name in the scripts | ||
| + | * Make sure that SESSION=your-session in the scripts (for example gnome-session or startx or ... ) | ||
| + | |||
| + | * sudo cp graphics-switch.sh graphics-switch-daemon display-settings /etc/init.d/. | ||
| + | * sudo update-rc.d display-settings defaults | ||
| + | * sudo update-rc.d graphics-switch-daemon defaults | ||
| + | |||
| + | These should run on Ubuntu and Debian, | ||
| + | tested on Linux Mint Debian. Change the user (U=user) to your user. | ||
| + | |||
| + | |||
| + | -- | ||
| + | Eemil | ||
Revision as of 09:13, 12 May 2011
The Asus Switcheroo module can be obtained at:
https://github.com/awilliam/asus-switcheroo/
Script-based solution ( by eemil@gmx.com ):
The script-based system includes several files, and allows automatic switching between intel and nvidia, at least on pre-optimus UL30VT.
Here is how it works:
- User writes either "intel" or "nvidia" to /home/user/switcheroo.txt.
- Script detects this and waits for the user to log out (detected as
user's gnome-session not running)
- Turns off gdm3 (debian) or gdm (ubuntu).
- Uses the awilliam module (asus-switcheroo) to switch to the desired
card.
- Uses acpi_call to turn off nvidia if required
- Links appropriate version of libglx.so and libGL.so, and xorg.conf so
that X and openGL apps can find them
- Starts gdm again.
Attached:
- my xorg.conf files for both cards.
- display-settings, the script that does one-shot card switching
depending on switcheroo.txt, and runs at boot so that the last selected card will be used
- graphics-switch.sh, the script that monitors switcheroo.txt and calls
display-settings when no user session is running
- graphics-switch-daemon, the script that starts graphics-switch.sh on
the background at boot
- an example switcheroo.txt.
Hopefully comprehensive installation procedure:
acpi_call: -In cloned acpi_call git, do -Compile acpi_call -sudo cp acpi_call.ko into /lib/modules/$( uname -r )/kernel/drivers/acpi/. -sudo depmod -a
asus-switcheroo:
- In cloned asus-switcheroo git, do sudo make install-ubuntu
- Make sure that both /etc/modules and /etc/initramfs-tools/modules have the lines:
asus_switcheroo dummy_client=1 i915_jprobe
xorg.conf files:
- IMPORTANT: If your PCI ID's are different, please modify. See lspci for the numbers.
- sudo cp xorg.conf.intel xorg.conf.nvidia /etc/X11/.
To get nice notifications for scheduled switches:
sudo apt-get install notify-osd
Finally, my scripts:
- Make sure that U=your-user-name in the scripts
- Make sure that SESSION=your-session in the scripts (for example gnome-session or startx or ... )
- sudo cp graphics-switch.sh graphics-switch-daemon display-settings /etc/init.d/.
- sudo update-rc.d display-settings defaults
- sudo update-rc.d graphics-switch-daemon defaults
These should run on Ubuntu and Debian, tested on Linux Mint Debian. Change the user (U=user) to your user.
--
Eemil