My Lenovo T420S has a discrete graphic card with nvidia optimus technology. What I'm basically trying to achieve is the following:
- use a second display - connected via DVI/viewport - at work (VGA is blurry)
- achieve a moderate to good battery performance while travelling (2 hours)
As far as I figured out, I have the following options:
- disable Optimus, use internal graphics exclusively
- disable Optimus, use nvidia exclusively
- enable Optimus, use bumblebee (homepage) / ironhide
(1) disqualifies as I read (and experienced) that DVI / viewport is technically not usable via internal graphics
(2) haven't really tried so far, just a quick test-install that booted into a black screen after I added the nvidia drivers :-(
(3) followed this blog, used bumblebee instead of ironhide. Bumblebee worked (I can see impressive FPS on glxgears), but I did not get the second display to be recognized. I also felt lost in the nvidia-driver-hell and had no chance to run nvidia-xconfig, simply because it was not installed. No idea if a second display is supposed to be recognized out of the box? Do I need to install more? Do I need to mess with my xorg.conf? Many questions, few answers.
So, what can I do to achieve my goals? Which path to follow, and what are the next steps?
Any hint is welcome :-)
Update: Thanks to everyone who answered. I will migrate my work environment to a "discrete" installation, and will use "optimus/bumblebee" as a parallel play project and see how far I get... I will post future questions in new threads.
I have managed to connect two external monitors (in addition to the built-in panel) to my ThinkPad T430 on Ubuntu 13.04, with Optimus ("Switchable graphics") enabled (option 3 in your list). The monitors are connected via the DVI interface, one of them is rotated. In contrast to other solutions, all monitors are attached to the same window manager, so windows can be moved freely between the monitors. This achieves the goal of enhanced battery life if disconnected and using external monitors if connected.
The key idea here is:
The major benefit over other solutions is that all displays are (seemingly) part of the same X session, so you can freely move windows between the displays.
So far I have noticed no performance penalty.
Instructions
You need to do the following:
For most actions you will need a terminal, a text editor, and root access (
sudo
). Detailed instructions are given below.Install Bumblebee
Follow the "basic setup" section of the instructions. Execute as root, the last command actually initiates the reboot:
Don't try to Run bumblebee with nouveau driver only?. From my experience it doesn't work, at least not in this setup.
Validation
You should be able to run
optirun glxgears
.Install a patched version of
xserver-xorg-video-intel
Option 1: Install from my PPA (currently only Ubuntu 13.04)
Execute the following as root:
Option 2: Build and install your own package
Choose the most recent patch for
xserver-xorg-video-intel
. Click the file, click the "Raw" button, copy the URL in the browser. At the time of writing, this was https://raw.github.com/liskin/patches/master/hacks/xserver-xorg-video-intel-2.20.14_virtual_crtc.patch.Validation (1), for both options
The command
should show the patched version (
+virtual
suffix) and the original Ubuntu version.Necessary for 13.04, for both options
Add the following to your
/etc/X11/xorg.conf
, create if necessary:Validation (2), for both options
After a reboot, run
xrandr
in a terminal. The output should list two additional virtual displays.Download and build screenclone
Get puetzk's fork of screenclone and its dependencies, and compile it.
Validation
The file
screenclone
exists and is executable. (It won't run yet, though.)Edit
xorg.conf.nvidia
/etc/bumblebee/xorg.conf.nvidia
in a text editor, as rootUseEDID
orUseDisplayDevice
Section "ServerLayout"
, add an entryScreen "Screen0"
At the bottom of the file, add the following:
Reboot
Testing
My setup assumes a landscape monitor connected to the first DVI port of the docking station, and a portrait one connected to the second DVI port. Run the following commands in a terminal from the directory where screenclone is located, adapt as necessary.
Note how the display rotation has to be defined twice. You can omit the second invocation of
xrandr
if no rotation is desired (and, of course, the--rotate left
in the first invocation).By terminating
screenclone
with Ctrl+C (which has been put into the foreground again usingfg
), the discrete graphics adapter is shut off. You can verify this withcat /proc/acpi/bbswitch
. Still, screen space is reserved for the two now disconnected monitors. To switch back to laptop display only, useCleanup
Copy
screenclone
to a directory that is in thePATH
(e.g.,/usr/local/bin
)Create a
bash
script to automate startup and shutdown of the external displays. This script will setup external displays on start and switch to laptop display only on exit (e.g., by hitting Ctrl+C).Alternative option: My collection of scriptlets contains two scripts,
extmon-start
andextmon-stop
, that enable and disable the second and third monitor. Edit theextmon-start
script to suit your configuration.References
My answer largely draws from the following resources:
I have a Thinkpad W520 and have messed around with this extensively. I am not sure how much the W520 and T420S have in common, but I have written a blog post here outlining the big picture situation and giving some suggestions.
You should be able to get 2 hours of battery life using the nvidia card with proprietary drivers full time. That will also probably be the option that involves the least hassle when adding an external display (The program "disper" is very helpful for this). If the nvidia proprietary drivers for the card in the T420s function the same as for the W520, they will automatically underclock the card when it is not in full use (they call this "Power Mizer"), so your battery life will not be too horrible. Honestly, I only get a 25 or 30% increase in battery life by turning off the nvidia card. Also, I believe that with Bumblebee installed, you may not be able to use your external monitor because the nvidia card is already running an X server "under the hood". In summary, I would recommend pursuing option (2) further. Hopefully, once you get the proprietary drivers installed and working, X will autodetect everything and you will not have to mess with your xorg.conf.
When I installed and uninstalled Bumblebee, I had a little bit of trouble getting the nvidia proprietary drivers to work again. Here a few things to look into: (a) The W520 has BIOS options related to which graphics scheme is in use. I'm not sure what the T420 options are, but if you want to use the nvidia graphics on your Thinkpad display, you probably have to be in "discrete" mode. (b) You may have to mess around with the "jockey" program in ubuntu to get it to use the proprietary drivers.
Good luck! I hope this was of some help.
Don't know about T420S but my T420 can make up to 9 hours with
And yes, this is the default battery. So you should easily get 2 hours, so:
(2) In /etc/X11/xorg.conf Try with Option "ConnectedMonitor" "DFP-0" for the nvidia driver.
(3) To use your second display you need a modified bumblebee xorg.conf See https://github.com/Bumblebee-Project/Bumblebee/issues/77 for details.
I use a T420 at work with a type 4438 docking station. I'm able to use two widescreen monitors(without the main monitor) or 1 widescreen monitor with the main monitor using the DVI ports on the docking station.
I just disabled optimus and set it to always use the NVIDIA card. Then I ran nvidia-xconfig and used the nvidia-settings to setup the dual monitors, saved the settings to the xorg.conf file and rebooted the machine.
I'm able to get a little over 2 hours of batter life this way (without any other modification to allow for more battery life). The main problem I have is that it doesn't switch automatically to one monitor when rebooted away from the docking station or removed from the docking station. I haven't had any time to look into this though.
I will be trying Bumble Bee later this week to see if I can get it to work. I'll try to remember to post here if I can get it functioning.
I have the same problem. I have done some research and partially solved it. I'm still working on a complete solution.
The hardware: Thinkpad T420s with Nvidia 4200M + Intel HD 3000 graphics Thinkpad dock.
The symptom: T420s can't recognize the external display connecting to any DVI port on the dock. It can recognized the external display through VGA port on the dock. However, the quality is poor.
The root cause: 1. T420s has Nvidia card connecting to DVI port while Intel card to VGA port on the dock. 2. Unlike Win 7, Ubuntu can't switch between Nvidia card and Intel card. By default, only Intel card is being used.
The solution: 0. Put T420s to dock and connect the external display to DVI port. 1. Goto BIOS, find "Display", change the configuration to "Discrete Card" and "Disable Nvidia Optimus". Now T420s is forced to use Nvidia card. 2. Download and install Nvidia driver for Linux. Google the detailed instructions. 3. After the installation, Do "sudo nvidia-settings". 4. In the pop-up window, "X Server Display Configuration", Click "Detect Displays". You will be able to see the external display now. 5. In the same page, change Configuration to "TwinView", Resolution "Auto" or the native resolution of T420s, say, 1600x900. 6. Click "Apply", you will be able to see the external display desktop. 7. Click "Save to X Configuration File". A new /etc/X11/xorg.conf will be created.
[Update]
Using disper, I am able to toggle T420s display and the external display manually. Still not the best solution, but I think it's good enough to me.
So please try Nvidia discrete graphics + disper combination.
VGA out on my T520 works great (not blurry) using Integrated Graphics (Intel BIOS setting) but I have to set the 1920x1200 monitor to only display 1600 pixels wide so I get black stripes on both sides. Without that setting, the monitor stretches the 1600 px across the entire 1920 screen and yes, things then look blurry.
I asked a similar question a few days ago and remain confused by these answers. It looks like @Anonymous Coward is running only an external monitor but I (and I believe the OP) want to be able to run the laptop display (on intel) and an external monitor via DisplayPort/DVI (on nvidia). So I think Optimus/Bumblebee may be required.
If I figure this display issue out I'll certainly post my findings; please do the same if you reach the finish line first.