External displays with Bumblebee
I have a W520. It is not the same setup as the T420 - the VGA output is wired to the nvidia card, so the "this" link from Samsagax will not work. I've prepared a blog post here outlining the options you have. I was unable to get either external monitor to work with Bumblebee, and I do not believe it is possible with the W520. However, you can use an extenal monitor in optimus mode, but you either have to use xinerama or open a separate X screen on the extenal monitor.
(redirected from linux-hybrid-graphics list)
I have a Thinkpad T420 which might be similar (but may be not).
On my T420, VGA is attached to the Intel and Display-Port is attached to the NVIDIA. So for the VGA output I can use the usual xrandr.
The Display-Port is a different story. For that I have to change the xorg.conf from bumblebee in /etc/bumblebee/xorg.conf.nvidia:
The option ConnectedMonitor
from DFP
(the default) to DP1
for DisplayPort.
Newer versions of the Intel driver include a program called intel-virtual-output
which greatly simplifies setup of double and triple displays on a W520.
The intel-virtual-output
command provides a way for an X server on the Intel card to duplicate screens to another X server. It looks at the available screens on the remote display and presents them on the Intel X server as VIRTUAL1, VIRTUAL2, etc.
The following script (run as root) works for me, but most likely you'll need to tweak things:
#!/bin/sh
# Power on the nvidia card with bumblebee.
modprobe bbswitch
echo ON > /proc/acpi/bbswitch
# Run X display :8 on the nvidia card.
optirun true
# Tell the intel card to create virtual screens on :0 and
# copy whatever they're displaying to equivalent screens on :8
intel-virtual-output
# Configure my monitors the way I like them.
xrandr --output VIRTUAL3 --auto
xrandr --output VIRTUAL1 --auto --right-of VIRTUAL3
xrandr --output LVDS1 --off
This setup enables my DisplayPort to DVI cable (VIRTUAL3) on the left and the VGA (VIRTUAL1) on the right. It also disables the laptop screen.
Note that since these are just virtual screens from the driver, in theory your GUI's display configuration tool should be able to figure it out after you've run intel-virtual-output
.
In practice, the display configuration tool in xubuntu did not really do coherent things. That's why those xrandr
commands are there. If you're running gnome or kde it might be worth trying the GUI tool before messing with xrandr
. Otherwise, before you run this you'll probably want to tweak some things for whatever setup you're actually using. Running just xrandr
tells you what displays are currently connected. You can connect and disconnect your monitors to see which plug connects to which VIRTUAL[0-9] display. The laptop screen is LVDS1. Then it's just a matter of doing the xrandr
commands with --right-of
, --left-of
, --below
, etc. to get things in their proper place.
When you want to go mobile again you can run this (again, as root):
#!/bin/sh
# Turn on the laptop screen.
xrandr --output LVDS1 --auto
# Turn off my the other screens.
xrandr --output VIRTUAL1 --off
xrandr --output VIRTUAL3 --off
# Kill the xorg server running on the nvidia card.
kill $(ps ax | grep Xorg | grep :8 | awk '{print $1}')
# Wait plenty of time for it to die.
sleep 5
# Remove the nvidia kernel module so we can shut down the card.
# If you're running another driver this might be something different.
rmmod nvidia
# Use bumblebee to turn off the nvidia card and save power.
echo OFF > /proc/acpi/bbswitch
I'm running xubuntu 14.04 using the proprietary nvidia driver version 337.25. I've also got bumblebee packages from https://launchpad.net/~bumblebee/+archive/ubuntu/stable.
Interestingly, this setup is the reverse of the usual Optimus setup. Usually you're selectively running programs on the nvidia card and copying buffers from the nvidia card to the intel card which actually talks to the monitors. In this case you're running everything on the intel card and copying the relevant screen buffers to the nvidia card.
If you're wondering, yes, this makes it hard to run nvidia accelerated applications. I've not yet figured out a way to make games perform well, and even with HD video it slows down over time. It even appears to not be double-buffering because you get visible left-right top-down scanning after playing fairly high-resolution video for a while. That said, most projectors will probably be fine.