I found a stopgap solution, for anyone finding this thread with the same issue, but I am not going to mark the thread as solved in case someone else has an even cleverer way of doing it.
I have been using /etc/rc.local to issue commands to vgaswitcheroo to select the card.
After some fiddling around with these over many reboots, I discovered that they had not been working reliably.
Overall vgaswitcheroo is not always working reliably for me, either from the command line, or with the switch built into the "ubuntu control center," or with the scripts found on this page, After many attempts, I discovered that when I could get my computer to switch to the radeon card at all (one in 10 tries probably), the card does not support 3D rendering and I can't run compiz or compositing. This reinforced my sense that for now what I really want to do is just power it off.
The best way I came up with to do this is to include a line at the end of my now quite lengthy /etc/rc.local which removes the radeon module 60 seconds after boot. So my /etc/rc.local now looks something like this:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo chmod a+w /sys/kernel/debug/vgaswitcheroo/switch
sudo echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
sudo echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
sleep 60; sudo modprobe -r radeon
exit 0
The first line changes permissions on the switch to allow users to operate it. The second selects the intel card; the third cuts power to the unused card. I am at a loss to explain why I had to put 'sudo' before those commands, which ought in theory to be running as root.
The last command removes the radeon module after a 60-second delay.
At shutdown I get a few unintelligible messages from vgaswitcheroo, but they don't repeat endlessly down the screen and it saves some time.
However, my boot is still really slow - about 1.5 minutes. I think there may be some trouble there too also related to this issue, but I haven't had time to look into that yet.
Please share your thoughts on these issues people, as I hope this will help all of this get smoother in future releases.
Bookmarks