External Monitor not working. Ubuntu, nvidia

50,087

Solution 1

I recently installed the nvidia-418 driver on my laptop which uses Ubuntu 18.04. At first the external monitor worked perfectly, but after I switched from power saving mode (sudo prime-select intel) back to performance mode (sudo prime-select nvidia), the second monitor was not detected anymore.

I discovered that prime-select writes a configuration file which causes the problem. It enables the nvidia-drm modeset option. You can simply undo the change made by prime-select by commenting out this option. It will not be reset, because prime-select only writes this file when it does not yet exists.

Open the file in your favorite editor (vim, nano, gedit, etc.).

sudo nano /lib/modprobe.d/nvidia-kms.conf

And comment out the the nvidia-drm modeset option.

# This file was generated by nvidia-prime
# Set value to 0 to disable modesetting
# options nvidia-drm modeset=1

Hope this also helps you and many others!

ps: It is completely normal that the second monitor is not detected in power saving mode when the connection is part of the nvidia graphics card.

Solution 2

I do prefer the solution by thomasnabgelis, but other working solution would be to use lightdm display manager. To do this just run sudo apt-get install lightdm and sudo dpkg-reconfigure lightdm if not configured after install.

Why this happens? I spent a lot of time trying to understand... nvidia-drm provides anti-tearing solution, though I didn't find any difference with this turning that off. Citation from nvidia forum (topic):

nvidia-drm modeset=1 is needed for tear-free display but since this is enabling linux kms for the nvidia driver, gdm thinks it can use wayland. Having a parallel wayland session makes it somehow impossible for X to detect any outputs on the nvidia gpu

Solution 3

Thanks for all your hints. My second monitor was dead a couple of days ago. I got it working again with the following steps:

  1. sudo nvidia-settings -> if this shows an error, then the nvidia driver is not active
  2. settings > info > software > additional drivers -> switch to current (or not so current) version of nvidia driver. If there is no error, skip step 3.
  3. install missing nvidia-drivers: sudo apt install nvidia-driver-450 (or similar)
  4. reboot
  5. it works (at least for me)

Hope that helps anyone. Cheers, Werner

Solution 4

Without risking the configuration files editing (which I am not sure of what effects propagate), my solution was to select the NVIDIA (Performance Mode) option and reboot after issuing the nvidia-settings command.

Solution 5

I scoured the web when I got my MSI GS65 Stealth with GeForce GTX 1660 Ti/PCIe/SSE2 and installed Ubuntu 18.04. I tried pretty much everything but nothing helped.

What did it for me was installning Ubuntu 19.10. Everything worked right out of the box and seeing as Ubuntu 20.04 LTS is right around the corner, this feels like a viable solution.

Share:
50,087

Related videos on Youtube

Pomm0
Author by

Pomm0

Updated on September 18, 2022

Comments

  • Pomm0
    Pomm0 over 1 year

    I'm having a precision 7530 with i7-8850H and NVIDIA Quadro P2000 and using ubuntu 18.04. Now after some time the external monitor connected over displayport (displayport to hdmi cable, where the displayport goes into the laptop and the hdmi cable into the monitor) stopped working. I'm using this workstation at work with the TB18DC dock, where 2 external monitors are connected and work properly. But at home I do not have any dock and with the setup mentioned above the external monitor stopped working. It did work some months ago. During the time it worked and now I have done normal ubuntu software updates where also the bios-firmware has been updated to 1.5.2 (i'm not sure what version I've had before, was the first time I updated firmware after bought, so maybe 1.0.7?).

    I have also installed the nvidia 390 driver. But it doesn't work either with the xorg-driver.

    xrandr says with connected displayport monitor:

    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
    eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y     axis) 344mm x 193mm
       1920x1080     60.03*+  60.01    59.97    59.96    59.93    48.02  
       1680x1050     59.95    59.88  
       1600x1024     60.17  
       1400x1050     59.98  
       1600x900      59.99    59.94    59.95    59.82  
       1280x1024     60.02  
       1440x900      59.89  
       1400x900      59.96    59.88  
       1280x960      60.00  
       1440x810      60.00    59.97  
       1368x768      59.88    59.85  
       1360x768      59.80    59.96  
       1280x800      59.99    59.97    59.81    59.91  
       1152x864      60.00  
       1280x720      60.00    59.99    59.86    59.74  
       1024x768      60.04    60.00  
       960x720       60.00  
       928x696       60.05  
       896x672       60.01  
       1024x576      59.95    59.96    59.90    59.82  
       960x600       59.93    60.00  
       960x540       59.96    59.99    59.63    59.82  
       800x600       60.00    60.32    56.25  
       840x525       60.01    59.88  
       864x486       59.92    59.57  
       800x512       60.17  
       700x525       59.98  
       800x450       59.95    59.82  
       640x512       60.02  
       720x450       59.89  
       700x450       59.96    59.88  
       640x480       60.00    59.94  
       720x405       59.51    58.99  
       684x384       59.88    59.85  
       680x384       59.80    59.96  
       640x400       59.88    59.98  
       576x432       60.06  
       640x360       59.86    59.83    59.84    59.32  
       512x384       60.00  
       512x288       60.00    59.92  
       480x270       59.63    59.82  
       400x300       60.32    56.34  
       432x243       59.92    59.57  
       320x240       60.05  
       360x202       59.51    59.13  
       320x180       59.84    59.32  
    DP-1 disconnected (normal left inverted right x axis y axis)
    DP-2 disconnected (normal left inverted right x axis y axis)
    HDMI-1 disconnected (normal left inverted right x axis y axis)
    DP-3 disconnected (normal left inverted right x axis y axis) 
    

    I have also tried the following:

    • installing lightdm and use it (no effect)
    • disable switchable graphics in bios (no effect)
    • downgrade firmware version-by-version till 1.2.5 (as it won't let me downgrade back to 1.0.7. no effect)
    • reset bios settings to default (no effect)
    • reinstalling nvidia-driver (no effect)
    • trying without any nvidia-driver (no effect)
    • Disable secure boot (no effect). But I also getting nothing when running lsmod | grep nvidia

    I booted from a live ubuntu usb stick and without external monitor it worked normally but with external monitor I got the following error message:

    error message image

    Any ideas how to get the monitor working? Thank!

    • Fabio Silva
      Fabio Silva about 5 years
      I'm facing the same problem with Linux Mint. Since Mint comes with Lightdm as the default display manager I've installed gdm3. But this showed to be not enough and then I've uninstalled all the NVIDIA drivers. So, using the default xserver drivers and gdm3 solved the problem, but I might say in an unsatisfactory way because I use linux mainly for multimedia work and can't use the full potential of my hardware without the Nvidia drivers. Many people has this problem too and looks like there is no specific reason for this to happen and it's sad.
  • Ra'Jiska
    Ra'Jiska about 5 years
    Thank you. Unfortunately the preferable solution provided by @thomasbangels did not work for me as the module nvidia-drm seemed to be loaded regardless of the changes applied to the configuration file. Switching from gdm3 to lightdm did the trick.
  • user2707175
    user2707175 almost 5 years
    For me it works however it doesn't seem to be the full solution. When I don't have any nvidia driver installed, I can easily use only intel 930 card and switch between internal and external display. However after installing intel 930 is not capable to display on external monitor, while nvidia requires the trick described by you. I believe it would be much more convenient to have also the possibility to use external hdmi port when using intel card.
  • user2707175
    user2707175 almost 5 years
    What are advantages/disadvantages of using lightdm instead of gdm3? Btw, even when using lightdm I can display on external hdmi when using intel card. :(
  • Maxwell s.c
    Maxwell s.c over 4 years
    Doesn't work for me. Using an Dell G3 with an GTX1050 with 430 drivers
  • MattBoothDev
    MattBoothDev over 4 years
    I'm on 19.04 and that file doesn't exist. Though, I'm using the Graphics Driver PPA.
  • MattBoothDev
    MattBoothDev over 4 years
    Ok, scratch that, I simply needed to run prime-select at least once and it did, indeed, generate that file. This seems to be working for me. I've also forcefully disabled Wayland for Gnome to stop that from being attempted to be set.
  • jcmordan
    jcmordan over 4 years
    Thanks, that's works perfectly. In fact a rather lightdm :)
  • Julia
    Julia almost 4 years
    I needed to do sudo update-initramfs -u and reboot after setting modset to 1 to make it work.
  • Ziemo
    Ziemo almost 4 years
    It doesn't work for my GS65 on Ubuntu 20.04
  • Magnus Grönberg
    Magnus Grönberg almost 4 years
    Did you do a clean install or an upgrade from an earlier Ubuntu version? I did a completely clean and full install in order to get rid of any configurations I might have tried earlier.
  • Ziemo
    Ziemo almost 4 years
    I did a clean install.
  • jeremy_rutman
    jeremy_rutman over 3 years
    watch out for this . The ubuntu docs (ubuntu.pkgs.org/20.04/ubuntu-updates-restricted-amd64/…) states You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-390-generic* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. so maybe try sudo apt-get install linux-modules-nvidia-390-generic
  • baitmbarek
    baitmbarek about 3 years
    Thank you werneR, re-installing the nvidia-driver-460 then restarting solved the problem in my case.
  • Damian JK
    Damian JK over 2 years
    Helped for: nvidia-driver-390 / Dell e6530 / Card NVS 5200M / Ubuntu 20.04. Before described steps I did: sudo ubuntu-drivers autoinstall then modeset=0 and at the end sudo update-initramfs -u. Original NVIDIA link: forums.developer.nvidia.com/t/… also this one is useful: forums.developer.nvidia.com/t/… Also from my side seems that after sudo ubuntu-drivers autoinstall just switching to: nouveau display driver helped