Ubuntu 16.04 & Nvidia - Adding external monitor stretches single display across both monitors

22,132

Solution 1

It a bizarre solution to the problem that I was facing but it appears that periodically nvidia-settings becomes uninstalled through no doing of my own.

When the resolution became stretched and the mouse rendered useless I shortcut opened a terminal and input nvidia-settings this informed me that it was not installed (still don't understand this).

I then reinstalled sudo apt install nvidia-settings and everything worked properly again.

If others are in the same situation I was I would definitely check this out as it is easy to fix. I fear this will be a reoccuring issue as this has happened twice before but only now do I understand what was causing it.

Solution 2

Press Ctrl+Alt+T to go to a terminal and type:

nvidia-settings

then you'll see something like this screen: nVidia xserver settings

From the left pane,

  • choose X Server Display Configuration
  • click the secondary screen in the dialog window
  • click Configure.
  • Enable TwinView.

If it doesn't work immediately, reboot the computer.

Solution 3

I had the same problem and I solved using compizconfig. In General Options → Display Settings disable Detect Outputs and set the outputs format.

compizconfig

Solution 4

I've answered a similar post :) (14.04 nvidia dual display (external+laptop) stretched display, offset desktop)

This is because the built in display is connected to intel iGPU. (Source: 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.

Does has a draw back that prime select wont work,thus theres no way to save some battery by swapping to iGPU other then reconfiguration of the BIOS... but well, prime select works poor enough (at least on my end) that i dont even bother anymore....

Solution 5

I tried different options that are mentioned over here and none of them worked for me.

The only thing worked is: On pressing Switch Display key on the laptop, that is available on F4 in HP laptop. It may be different on other vendors.

Prerequisites:

sudo apt-get purge nvidia-*

The above command uninstalls all previous versions, restart your pc.

sudo apt-add-repository ppa:graphics-drivers/ppa

Above commands adds the repos

sudo apt-get update
sudo apt-cache search '^nvidia-[:digit]' --names-only

Take the latest number and install with:

sudo apt-get install nvidia-381

For me 381 was latest.

Posting as it might help somebody.

Share:
22,132

Related videos on Youtube

macourtney7
Author by

macourtney7

Updated on September 18, 2022

Comments

  • macourtney7
    macourtney7 over 1 year

    I'm trying to run an external monitor from my HP laptop running 16.04 via HDMI. I have a GTX965M that I'm running the nvidia-375 driver for. This lets me run two monitors but only in mirror mode. If I change to use separate monitors the resolution seems to spread across the total of the two displays and I'm unable to cancel the setting changes as I can only click on the launcher; I have to wait the 30 seconds for revert.

    I followed this post from the forums to install a newer version of the drivers as it is faster than going through Software & Updates which seems to take too long.

    Here is an image of my desktop after trying to add a second separate monitor:

    desktop

    I'm not sure whether this comes down to the drivers or the system config.

    Any help is appreciated

    Update: It has randomly started to work and I'm not sure why because I haven't made any changes. I just booted up and plugged in the HDMI. Also, my nvidia-settings doesn't appear correct according to the one of the suggested solutions so I'm not confident that this isn't a temperamental bug.

    nvidia-settings

    This shows only one monitor, the external. It doesn't include the laptop's built in. Is this correct?

    ------------------------------------------------------------------------------------------------------------------------------------

    Further Update: Then the next time I boot up, this time with the HDMI already plugged in it's back to stretching a single 1920x1080 across two 1080p monitors. I think I have got to the route of the problem. I opened up a terminal to get to nvidia-settings and apparently it's not installed.

    This is bizarre as it 100% was installed; proven by the image I supplied in this question. I humored this problem and reinstalled and dual monitors is working again! Is this a bug?? I've added a solution myself because this did solve the problem but I don't understand how it can occur.

    • macourtney7
      macourtney7 over 7 years
      Is there any information available regarding this problem? Is this known to have occurred in 14.04?
    • George Udosen
      George Udosen over 7 years
      what was your screen resolution before now ?
    • George Udosen
      George Udosen over 7 years
      modify the resolution from the settings so the built display's resolution is ok when you do that please post the result for further help
    • Akronix
      Akronix over 7 years
      have you tried using Arandr ?
    • user.dz
      user.dz over 7 years
      Try making setup using gksu nvidia-settings
    • Koop4
      Koop4 about 7 years
      experiencing the same problem
    • macourtney7
      macourtney7 about 7 years
      @Koop4, I still have this issue from time to time. To get it working again I boot without an HDMI plugged in, after boot and login plug in the HDMI. I have a toggle display key, if it doesn't go back to dual display automatically I just toggle through and 9/10 times it works fine. I only have an HDMI plugged in when the system is running. I even unplug before shutting down so it doesn't boot with it in next time; this has messed it up before. Hope this helps!
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    Thank you for your answer. You can improve it by listing steps to install "legacy drivers".
  • Marco Schoolenberg
    Marco Schoolenberg over 7 years
    yeah didn't think about that. ;-)
  • macourtney7
    macourtney7 over 7 years
    Thanks for your suggestion. My nvidia-settings doesn't look like your image so I wasn't able to locate TwinView. Please see my update in the original post for further information and how the problem has changed slightly.
  • macourtney7
    macourtney7 over 7 years
    I've tried various versions of the Nvidia drivers. I'm currently using 367 which is tested and it's still presenting the same issues. Nouveau doesn't seem to be able to produce much more than a distorted output via HDMI on my system. I did mention that I followed a post very similar to this but thanks regardless.
  • Fabby
    Fabby over 7 years
    If it's random, try booting with both monitors attached instead of plugging in after boot. If you get two monitors, go to the settings in the and fix them right then and there. ;-)
  • macourtney7
    macourtney7 over 7 years
    I've tried that before and it didn't make a difference. Thanks.
  • fgblomqvist
    fgblomqvist about 7 years
    Just to clarify this makeshift solution: the extra 1920 that he is adding is the width of his second screen. So for me, with a 2560x1080 screen (left), and a 1920x1080 screen (right) I use the following: 1. 2560x1080+0+0 - 2. 1920x1080+2560+0. Nonetheless it is a very temporary solution so I wouldn't recommend it.