122

After upgrading to Ubuntu 18.04, my laptop has been unable to detect/use an external monitor attached via HDMI. Even when plugged in, the "detect displays" button within the default settings app doesn't do anything.

Here is the output from xrandr:

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080     60.01*+  60.01    59.97    59.96    59.93  
   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-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)

My main concern is the final line: HDMI-1-1 disconnected. There is a monitor plugged in and ready for use, and nothing I do seems to cause it to be detected.

I have an nvidia graphics card, and before the update I was using proprietary drivers. When the external display problem first arose, my initial attempt was to switch back to the open source Xorg drivers. However, upon reboot, Ubuntu displayed my driver settings as using a "manually installed driver", and won't let me change it:

enter image description here

Any recommendations?

PullJosh
  • 1,331

31 Answers31

82

I solved it by purging, then reinstalling the nvidia drivers

sudo apt-get purge 'nvidia*'
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update

Then using the Software & Updates tool's Additional Drivers tab and installing the latest nvidia drivers

45

Solved for me by updating to recommended Nvidia card drivers how-to.

To install all recommended drivers:

sudo ubuntu-drivers autoinstall
vvvvv
  • 878
31

I solved the problem installing lightdm and set it as the default display manager.

In the process, something changes because is starting to detect external displays again even if you go back to GDM3.

You can follow the instructions here on how to make these changes:

  • sudo dpkg-reconfigure gdm
  • select the display manager (LightDM, MDM, KDM, Slim, GDM) you want to use by default and hit enter
  • restart your computer
abu_bua
  • 11,313
30

There is a solution without installing lightdm!

Update:

It's apparently a better solution to run X11 as root. The one-line fix is to add this to this to /etc/X11/Xwrapper.config:

needs_root_rights = yes


It's a one line fix in /lib/systemd/system/gdm3.service

Replace

[Service]

ExecStartPre=/usr/share/gdm/generate-config

with

[Service]

ExecStartPre=/usr/bin/xinit /usr/share/gdm/generate-config

Found Here:

https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1716857

All my external displays are now detected and working on gdm3 My System:

Ubuntu 18.04.3 LTS

Lenovo T480

Intel® Core™ i7-8650U CPU @ 1.90GHz × 8

GeForce GTX 1070 Ti/PCIe/SSE2 via Razer Core X over Thunderbolt 3

GNOME 3.28.2

Johann8
  • 103
nhorning
  • 473
8

I attempted the solution that says to reconfigure to lightdm but that did not seem to work.

I did some reading from the following website: https://devtalk.nvidia.com/default/topic/1035768/linux/ubuntu-18-04-can-t-see-second-monitor/ and I found that at least on the Lenovo Legion Y530 the solution is to change the NVIDIA prime profile from intel to nvidia and then restart the computer.

You can switch the profiles by going to 'NVIDIA X Server' settings, going to the 'PRIME profiles' tab and then selecting 'NVIDIA (performance mode)'. After, restart the computer.

You can also reconfigure the PRIME profiles tab by running the following command in the terminal.

 sudo prime-select nvidia

and then restarting your computer.

joshual
  • 81
6

My external monitor plugged into my Lenovo L380 HDMI stopped working on Ubuntu 18.04. I succeeded to fix this issue by opening the BIOS setup and changing the display priority option from the USB Type-C to the HDMI.

5

Try this (change resolution, if 1920x1080 is not your resolution):

    xrandr --addmode HDMI-1-1 1920x1080
    xrandr --output HDMI-1-1 --mode 1920x1080
Mihai R
  • 139
5

I could connect to external monitor before i execute

sudo apt install gnome

I tried suggestions above, but none of them works. at last I recover the connection by this

sudo service gdm3 restart
sudo reboot

wired.

askepott
  • 103
vincewl
  • 51
5

I had the same issue on an my Asus ROG laptop (running Ubuntu 19.04 / Windows 10 dual boot) after a BIOS update.

First I had to disable secure boot in BIOS.

Then I had to set options nvidia-drm modeset=0 in /lib/modprobe.d/nvidia-kms.conf and run sudo update-initramfs -u.

Eliah Kagan
  • 119,640
Arctodus
  • 151
5

People who are still struggling to setup your external monitor with Ubuntu 18.04. Just disable Secure Boot at the BIOS settings and give it a try. It worked for me. (ASUS ROG G531GV)

Danuja
  • 51
5

I had similar problem, played with UEFI & Legacy boot mode, searched for hours but finally got it done by following ways: 1. goto Software & Updates 2. Additional Drivers 3. Changed the display driver from there. 4. restart

enter image description here

5

Besides following this answer above, I followed instructions here. More specifically, step 1 of that told me the recommended drivers for Ubuntu 18.04.1

15:~$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Csv00001028sd00000798bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Ti Mobile]
driver   : nvidia-driver-415 - third-party free
driver   : nvidia-driver-390 - third-party free
driver   : nvidia-driver-410 - third-party free
driver   : nvidia-driver-440 - third-party free recommended
driver   : nvidia-driver-435 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin`

Then a apt install nvidia-driver-440 & I was finally home.

asr9
  • 151
  • 1
  • 4
4

The top solution did not work for me on my Acer laptop, which suddenly stopped showing HDMI-1 as an output in xrandr this morning. I tried changing to the noveau drivers in case that helped, but it didn't.
I read on a different site that sometimes the OEM laptop Nvidia cards can "get confused whether cable is connected or not", which I had assumed was just tech-support appeasing someone. But, for giggles, I tried unplugging the HDMI cable, plugging in the VGA cable, rebooting, and plugging the HDMI cable back in. For some reason, that worked.

This is probably an extension of "Just Learning"'s solution, the important part of which is probably the "through VGA" part.

Eric Jones
  • 61
  • 4
2

I did not have this problem on Ubuntu 18.04 with NVIDIA GeForce GTX 1050 Mobile and GeForce GTX 1050. But after upgrading my kernel to 4.19 my external monitor was not detected anymore. Reverting back to the standard 4.15 kernel made the problem disappear.

2

Tried everything related from gdm3, lightdm, i3, nvidia drivers purge & reinstallation. What worked for me was to go to /etc/X11/ folder and create a xorg.conf file with file contents:

Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0@0:2:0"
Option "AccelMethod" "None"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1@0:0:0"
Option "ConstrainCursor" "off"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "on"
Option "IgnoreDisplayDevices" "CRT"
EndSection

And then reboot. I did not have success in Wayland but it worked in the Unity version.(I am running 18.04 in Alienware R313 with dualboot Windows)

2

For me, the solution found here was the only thing that worked.

$ sudo apt install intel-gpu-tools
$ intel-virtual-output
$ reboot

My setup is:

  • MSI GS65 Stealth 8SF
  • Ubuntu 18.04 LTS (Budgie Desktop 18.04)

Update

I noticed that the second display correctly shows after reboot, but no longer does it after suspension. Above was not what seemed to do the trick, but it seems that it's just the reboot that has helped.

diadochos
  • 141
2

I just spent several hours trying may different solutions I found on this thread and elsewhere online.

I'm running Ubuntu 18.04 on HP Elitebook with Nvidia GTX1050 graphics card. After a fresh install everything worked except external monitor. I switched the nvidia driver in the Additional Drivers section of Software & Updates several times and everytime before the switch got completed I had to choose some password that I'd supposedly use during the next reboot, but I never got asked for it during the actual reboot.

The reason the external display didn't work, was that the selected drivers didn't get loaded. I found that out by running nvidia-settings in the terminal and getting a "ERROR: NVIDIA driver is not loaded" response.

The solution: Pay attention at reboot for Enrol MOK key/MOK management screen. There select the option to Enroll key and type the password you created during driver update in Ubuntu.

All works perfect after this.

ak93
  • 71
2

I personally needed to a combination of many of the other answers for it to work for me on Ubuntu 20.04.4 LTS on a Lenovo Legion with AMD with radeon graphics card and Nvidia gpu. It also fails with linux kernel 5.13.0-30 but works with kernel 5.13.0-28 for some weird reason:

(1)

sudo apt-get purge 'nvidia*'
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo ubuntu-drivers autoinstall

Then reboot. The above ended up installing nvidia-driver-510 for me.

Very important: for the above to work to work, you need to either first disable secure-boot or make sure that on the next boot you do not simply boot normally but rather you accept the mok/lok key first.

(2)

Make sure /etc/X11/Xwrapper.config contains the line: needs_root_rights = yes

(3)

set options nvidia-drm modeset=0 in /lib/modprobe.d/nvidia-kms.conf and run sudo update-initramfs -u then reboot

(4) [finally]

Change grub to load without nomodeset: Edit line GRUB_CMDLINE_LINUX_DEFAULT in file /etc/default/grub to remove nomodeset in for example: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Reboot.

Hopefully a combination of these should solve your problem. This problem reappears regularly (often after rebooting after updates) for me, so I am keeping the solutions that worked for me here.

0

For me I had to turn on Legacy mode support in BIOS.

0

For me this problem occurred on a Lenovo Ideapad 510 running Ubuntu 16.04 after connecting to a different than usual external monitor via HDMI. It got fixed after I had connected this laptop to yet another external monitor, although it hadn't worked there. Earlier I also changed my graphics drivers from open-source to proprietary and then to open-source again--maybe this helped. I also restarted my computer several times. It seems pretty random.

geras
  • 476
0

One quick extra check is that you don't have nomodeset or vga= as kernel parameters, as noted here (the link is for Radeon but I guess similar would apply to other graphics hardware). Removing nomodeset just fixed a similar problem for me.

Instructions for how to check and if necessary edit your kernel parameters as applied at boot time can be found on this page.

Alan H
  • 1
0

I tried many things to solve this problem and someone finally helped me out. My issue was with the NVIDIA drivers and this line solved it.

sudo apt install nvidia-driver-435

Link to my issue here (Ubuntu 18.04.3 cant find second monitor - Dell G3 - NVIDIA 1060 TI)

David B
  • 33
  • 9
0

I just purchased a brand new Dell 5493 with i7 and Intel Graphics card. Had the same issue, no HDMI or monitor detected after installing Ubuntu 18.04 dual boot with Windows 10. Upgrading to the newest kernel solved the issue.

zhijaz
  • 1
0

I removed my laptop's battery for a while, and then it worked again. This is a 'known' fix at my company; employed commonly.

So for me specifically the problem was that secondary monitors were always detected, up until I rebooted and it suddenly didn't anymore.

JBSnorro
  • 221
  • 2
  • 7
0

I have an MSI Prestige 15.6" Laptop with a GeForce GTX 1650 Mobile / Max-Q graphics card and a built-in Intel vga controller. I'm running Ubuntu 18.04. I use two 1080p external monitors one connected to the HDMI port and one connected through a USB-C hub. All 3 monitors worked before installing the Nvidia driver.

I installed the 440 driver and after that the laptop would not recognize the monitor connected via the HDMI port. It was like the HDMI port didn't work any more. (I enabled the MOK per the driver installation instructions.)

If I switched back to the X.org Nouveau driver (through Software & Updates, Additional drivers) then all 3 monitors work properly. If I switch back to either the 440 or 435 driver the monitor connected to HDMI doesn't work.

I've tried several of the recommendations in this thread and none of them work. The Nvidia drivers simply don't work on this hardware with the 5.3 kernel.

I have an old desktop with a 960 in it that I'll go back to using for the little bit of CUDA development that I have to do.

I post this FYI for anyone else running into this.

0

Something that worked for me for a similar problem was lower the refresh rate of the monitor through the display settings on Ubuntu.

0

No solutions from here worked for me. I solved the problem by disabling UEFI mode in BIOS.

  1. restart
  2. press [Esc] to enter GRUB menu
  3. select [System configuration], computer enters BIOS setup
  4. go to [Boot] menu
  5. Disable UEFI there everywhere (two places in my case were replaced with 'Legacy' option)
  6. Save changes & exit, system restarts.

Now plugged monitors are detected.

Apogentus
  • 273
0

I am on ubuntu 22.04 LTS. For me this worked for me. First followed answer from - https://askubuntu.com/a/1099736

ie:

sudo apt-get purge 'nvidia*'
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update

Then reinstall the Nvidia card driver Answer from - https://askubuntu.com/a/1074337

sudo ubuntu-drivers autoinstall 

Then restart the System and connect the monitor

0

This simple solution worked for me:

sudo apt dist-upgrade 

then

sudo reboot
vikrant
  • 865
-1

What seems to have worked for me was a bios update, then setting "IGPU Multi-Monitor" to enabled.

pybynumbers
  • 301
  • 1
  • 2
  • 8
-3

I connected my external monitor through VGA and went to Settings > Devices > Displays choose Mirror and then Apply. was asked if I wanted to keep this Setting choose Yes and everything connected. Simple and Beautiful.