Friday, October 23, 2015

Lenovo T440P + Ubuntu = driver hell .. And how I fixed it.

Standard

New laptop and the nasty suprises

I have purchased the Lenovo T440P in order to run Ubuntu for my development environment. I had a lot of initial issues using this laptop with external displays. The laptop display is too small to use on its own for development, so this was kind of a show stopper.

My target environment was:

  1. Lenovo T440P patched to a sensible BIOS level. I think mine is 2.31 or 2.32.
  2. Ubuntu 14.04.3 LTS
  3. 3.19.0-30-generic #34~14.04.1-Ubuntu SMP Fri Oct 2 22:09:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  4. Gnome-Shell / not Unity
  5. Nvidia proprietary drivers
  6. Some sort of util to manage the use of the new daisy chaining of monitors on a single channel.
A lot of people spent many many hours getting this to work. This was what worked for me.

Installation of base system

  1. I started out with a system with no nonsense. That is the server release of Ubuntu. Install it, and you will get a system without any GUI at all.
  2. Install the package gnome-shell. This will give you the most basic gnome-shell install shaved down to the bones. No empathy, no Evolution. The downside is you have to add many of the usual tools by hand.
  3. Install nvidia-331 + Anything above this worked for me.
  4. Replace GDM with LightDM. This is the crucial point. GDM did not work for me on this laptop. I think LightDM is more advanced in managing the session with multiple monitors as of now. done by firstly installing the package lightdm and then dpkg-reconfigure lightdm. Select lightdm over GDM.
  5. See to it that the GRUB boot loader has no hokus pokus in it. You need a plain "quiet splash" no modeset changes unless you are fiddeling around and know what you are doing.
  6. The above should also have installed the package prime. So prime-select query should show you what GPU you are using.

Result

I am able to use both monitors with the Intel or the NVIDIA driver. Of cause the Intel card does not perform as well as the nvidia one. Some people have reported memory leaks / kernel crashes. I have not experienced this with the above setup. I am writing this from the lappie with an external monitor attached using the monitor on the laptop itself. 

It is really nice that the external monitors no longer tie hard to the discrete graphics card.

switching is done with prime-select <query|nvidia|intel>

For now I think I will use the intel card as it seems to be easily fast enough to power a developer workstation. In fact I struggle to see, why Lenovo does not produce a variant of the T440P with ONLY the Intel card. Seems to be more than what an old codegrunt like me need anyway.

Performance wise glxgears give me around 60 fps with the Intel driver and 2000+ fps when using the NVIDIA card. This goes for both screens.

Outstanding issues

I also have the advanced dock. The above setup does not work for me at all using this yet. I am able to get a text console (mirror) on both displays, but cannot get a GUI up and running on either screen using the advanced dock. I have read that the same is the issue with some versions of MS Windows. So in fact Lenovo has made a patch, that I have yet to flash onto the advanced dock.

https://support.lenovo.com/us/en/documents/ht081248)

I think the next step is to flash the firmware of the dock and see, what the outcome of that is. Right now I do not have a windows boot device compatible with the dock, so I probably have to create a boot partition for Windows on the lappie itself (which sucks) or replace the disk with another one and install on that.

What not to do ..

I have read some have had success downgrading to the 1.14 version of the BIOS. If you have a later version of the T440P I cannot emphasize enough how bad an idea that is.

The older BIOS is made for the older versions of the hardware, and even a minor version incompability in a device in your laptop could transform your laptop into the most expensive paperweight you ever owned.

Only do this if the laptop originally shipped with the early version of the BIOS.

Update:

It seems the above is not a problem on Ubuntu 15.10. On that release displays and dock work just as they are supposed to. I think this is mainly due to the major release upgrade of the kernel / 4.*.

For now the above fixes are still needed for the LTS product.



Update 2:

Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

All works on this LTS out of the box. And it occurred to me that Cannonical actually ship a Gnome-Shell only dist now! Hell just froze over apparently. So forget about the steps to get a clean gnome env above. Just fetch the "gubuntu" distro. 

0 kommentarer: