I had the same problem as you and after read several post I fixed it, so I am going to explain step by step how I did it. I have to say that I am a noob in the world of Linux, so I going to explain the steps for noobs also.
- Go to your BIOS and disable secure boot. To do this restart the pc, press serveral times F1, F2 or F10 (it depends on the pc), look for Boot Options or something like that and disable secure boot. Secure Boot is a mode for UEFI that Windows brings from Windows 8, and that prevents the execution of any unsigned or certified software, thus preventing nvidia open source drivers to communicate with the GPU.
- After that, run
xrandr --listproviders
. If you have two GPUs, the processor integrated GPU and the NVIDIA GPU you should see something like that
Providers: number : 2
Provider 0: id: 0x23b cap: 0x1, Source Output crtcs: 4 outputs: 3 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x45 cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting
If you see that, perfect. Some fisical external outputs, like the HDMI port, are controled only by one GPU, so you can try to run xrandr --setprovideroutputsource 1 0
or xrandr --setprovideroutputsource 0 1
and hopefully it solve your problem.
If you you see something like that:
Providers: number : 1
Provider 0: id: 0x45 cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting
You have to install the drivers of you NVIDIA GPU, which lead us to the step 3.
- Run
ubuntu-drivers devices
and you should see something like that.
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Dsv0000103Csd0000838Fbc03sc00i00
vendor : NVIDIA Corporation
model : GP107M [GeForce GTX 1050 Mobile]
driver : nvidia-driver-435 - distro non-free recommended
driver : nvidia-driver-430 - distro non-free
driver : nvidia-driver-390 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
== /sys/devices/pci0000:00/0000:00:1c.5/0000:04:00.0 ==
modalias : pci:v00008086d0000095Asv00008086sd00005010bc02sc80i00
vendor : Intel Corporation
model : Wireless 7265 (Dual Band Wireless-AC 7265)
manual_install: True
driver : backport-iwlwifi-dkms - distro free
Install the recommended driver to your GPU, in my case sudo apt install nvidia-driver-435
, and reboot.
In my case, before install the recommended driver, I uninstalled all the nvidia drivers. To do this go to this post How can I uninstall a nvidia driver completely ? and follow the steps.
- If the problem persist, try to switch between your Intel GPU to you NVIDIA GPU running this
sudo prime-select nvidia
. If you see something like that:
Info: the nvidia profile is already set
Try to run sudo prime-select intel
and then sudo prime-select nvidia
. I read in a post (External Monitor not working. Ubuntu, nvidia) that prime-select write a configuration file that cause problems, so run 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
Reboot your pc.
That resume the 3 hours that I spent on internet to solve this and I really hope this helps to other noobs like me.
lspci | grep VGA
command did the trick for me.xrandr
showed screen 0 and dp-X and hdmi-1 disconnected. Then did the lspci command, magically awoke the external monitor. Great! – Erik Vesterlund Jun 18 '20 at 11:13