Asus switcheroo

From Hybridgraphics

(Difference between revisions)
Jump to: navigation, search
m (Formatting)
(Attachments)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
The Asus Switcheroo module can be obtained at:
The Asus Switcheroo module can be obtained at:
-
 
https://github.com/awilliam/asus-switcheroo/
https://github.com/awilliam/asus-switcheroo/
Line 31: Line 30:
In cloned acpi_call git compile acpi_call, and then
In cloned acpi_call git compile acpi_call, and then
-
<pre>sudo cp acpi_call.ko into /lib/modules/$( uname -r )/kernel/drivers/acpi/.
+
<pre>sudo cp acpi_call.ko into /lib/modules/$( uname -r )/kernel/drivers/acpi/
sudo depmod -a</pre>
sudo depmod -a</pre>
asus-switcheroo:
asus-switcheroo:
-
* In cloned asus-switcheroo git, do sudo make install-ubuntu
+
* In cloned asus-switcheroo git, do <tt>sudo make install-ubuntu</tt>
-
* Make sure that both /etc/modules and /etc/initramfs-tools/modules have the lines:
+
* Make sure that both /etc/modules and /etc/initramfs-tools/modules have the lines: <tt>asus_switcheroo dummy_client=1 i915_jprobe</tt>
-
<nowiki>asus_switcheroo dummy_client=1
+
-
i915_jprobe</nowiki>
+
xorg.conf files:
xorg.conf files:
* IMPORTANT: If your PCI ID's are different, please modify. See lspci for the numbers.
* 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/.
+
* <tt>sudo cp xorg.conf.intel xorg.conf.nvidia /etc/X11/ </tt>
To get nice notifications for scheduled switches:
To get nice notifications for scheduled switches:
-
<nowiki>sudo apt-get install notify-osd</nowiki>
+
<pre>sudo apt-get install notify-osd</pre>
Finally, my scripts:
Finally, my scripts:
Line 59: Line 56:
tested on Linux Mint Debian. Change the user (U=user) to your user.
tested on Linux Mint Debian. Change the user (U=user) to your user.
-
Attachments:
+
***====Attachments====***
[[asus-switcheroo display-settings]]
[[asus-switcheroo display-settings]]
Line 72: Line 69:
[[asus-switcheroo switcheroo.txt]]
[[asus-switcheroo switcheroo.txt]]
-
 
-
--
 
-
Eemil
 

Latest revision as of 15:30, 21 June 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:

  1. User writes either "intel" or "nvidia" to /home/user/switcheroo.txt.
  2. Script detects this and waits for the user to log out (detected as user's gnome-session not running)
  3. Turns off gdm3 (debian) or gdm (ubuntu).
  4. Uses the awilliam module (asus-switcheroo) to switch to the desired card.
  5. Uses acpi_call to turn off nvidia if required
  6. Links appropriate version of libglx.so and libGL.so, and xorg.conf so that X and openGL apps can find them
  7. 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 compile acpi_call, and then

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.

      • ====Attachments====***

asus-switcheroo display-settings

asus-switcheroo graphics-switch.sh

asus-switcheroo graphics-switch-daemon

asus-switcheroo xorg.conf.intel

asus-switcheroo xorg.conf-nvidia

asus-switcheroo switcheroo.txt

Personal tools