14.04 nvidia dual display (external+laptop) stretched display, offset desktop

When I try to attach an external monitor to my laptop, the windows are stretched oddly horizontally and the click offset is off. The nvidia settings also doesn't seem to show the built-in laptop display, but the ubuntu display settings does.

If I add a third monitor, the two external monitors work fine with no stretching or misclicking, but the laptop monitor is blank. I can't drag windows to it but I can move the mouse there.

If I use any monitor by itself, it works fine.

This is a fresh (with the exception of crashplan) install of 14.04.1 LTS x86_64, using the latest tested driver in additional drivers (nvidia-331.113 and nvidia-prime). It's on a Dell M6800 with a Quadro K4100M. Displays are connected via display port from dock.

Since I can't post images, here is an album of screenshots:

http://imgur.com/a/MpL5w#0

update: purging nvidia drivers and using Nouveau works fine, but runs slow.

update: It is related to Nvidia Optimus. Turning that off in the BIOS fixes the issue, though I'd like to be able to switch to my integrated graphics in the future.


Solution 1:

Had the same problem on 16.04 and was finally able to solve it today.

According to NVIDIA, its because the built in display is connected to intel iGPU. https://devtalk.nvidia.com/default/topic/807239/nvidia-server-setting-utility-doesn-t-see-laptop-screen/

Which basically result in Nvidia x server has no control over your built in monitor.

To solve this, switch graphic mode from MShybrid to discrete in BIOS setting, which can force the built in monitor to be driven by you discrete GPU, and x server will works correctly to recognize both build in and external display.

Solution 2:

I suffered from this problem. finally found this post: https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1382462/comments/35

On CompizConfig Settings Manager, go to General Options, then Display Settings and do the following:

  • Uncheck Detect Outputs.
  • In the Outputs array, set the resolutions of each of your screens.

The numbers after the resolution "1920x1080+0+0" are the offset. It's important to add this offset according to your needs. I have two full HD screens, so I added the following configuration:

1920x1080+0+0
1920x1080+1920+0

The second output has an offset of 1920, because it is on the right side of the first output, which has a width of 1920.