Built-in laptop screen not detected when using Nvidia driver

I have a HP Omen 15 with AMD Ryzen7 and Nividia Geforce RTX 2060, Ubuntu 20.04.2 LTS

Have been operating with dual boot (Ubuntu + Windows) and dual screen (in-built + external) really well for some time. Suddenly, today, the inbuilt screen doesn’t seem to be recognized anymore, while the external monitor works well. The inbuilt screen shows boot options (and works on Windows) but “freezes” with a black screen + Omen symbol at login. The login screen shows up on the external monitor.

It is clearly some system configuration problem. So I tried all solutions I could find for a day, of which most of the proposed solutions seems to be around deleting / changing the contents of /etc/X11/xorg.conf See here for example: Internal laptop screen not detected when using Nvidia driver. Nothing worked.

I’ve ran out of options for things to try, can’t seem to find a way around this… Can somebody help me out?

My NVIDIA Xserver setting doesn’t seem to find the inbuilt screen.

My nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.80       Driver Version: 460.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 2060    Off  | 00000000:01:00.0  On |                  N/A |
| N/A   41C    P8     2W /  N/A |    324MiB /  5934MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1004      G   /usr/lib/xorg/Xorg                 29MiB |
|    0   N/A  N/A      1740      G   /usr/lib/xorg/Xorg                 97MiB |
|    0   N/A  N/A      1878      G   /usr/bin/gnome-shell              107MiB |
|    0   N/A  N/A      4793      G   ...AAAAAAAAA= --shared-files       79MiB |
|    0   N/A  N/A      5417      G   /usr/bin/nvidia-settings            0MiB |
+-----------------------------------------------------------------------------+

Edit 1:

Changing to intel graphics, the built-in screen returns but the external monitor stops working.

sudo prime-select intel 
reboot

This indicates that the problem is my NVIDIA card not being able to detect the buit-in screen?


I have one laptop with external Monitor as well. Ususally it happens this, just when you selected (or it select by it self) the external Monitor as Primary and check it under X Server XVideo Settings voice . If you can see from my pic below, also me I have the external monitor as the unique selected but the build-in monitor still functional if I will switch or I will change the parameters.

Check also on the first voice Selection from X Server Display Configuration, I can see from your pic that the Down Arrow from the first voice selection it's colored , in that can show some other Monitors ; please try to open as I made in my pic. And double check on Ubuntu Settings under Monitor Section. Because Nvidia and Ubuntu system sometimes if set in different way from each other, could go in conflict with parameters....

enter image description here


As I suspected, it was a configuration problem. Here’s what I found to work for my case:

1 - Edited the content of my /lib/modprobe.d/nvidia-graphics-drivers.conf file:

blacklist nouveau
blacklist lbm-nouveau
alias nouveau off
alias lbm-nouveau off
options nvidia-drm modeset=1

and then run on terminal: sudo update-initramfs -u

Ref: https://askubuntu.com/a/1310431/1175096

2 - I emptied out the content of /etc/X11/xorg.conf.

Ref: Internal laptop screen not detected when using Nvidia driver

3 - I created a new conf file in /usr/share/X11/xorg.conf.d/, named 30-nvidia-prime-overwrite-fucker.conf. This is because gpu-manager usually overwrites 11-nvidia-prime.conf at boot. The name really doesn’t matter, as long as you use a larger number at the beginning. My new file contained:

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    # Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
    ModulePath "/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

which is exactly the content of 11-nvidia-prime.conf but with the Option "IgnoreDisplayDevices" "CRT" commented out.

Ref: https://askubuntu.com/a/689505/1175096

4 - In my /etc/default/grub file I wrote:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

And then on terminal, to update grub:

sudo update-grub

My built-in screen is back and my external monitor is working as an extension screen!