linux – Display and NVIDIA driver not compatible

I have an HP ENVY Laptop 15-ep0142tx, it is currently running a dual boot (Ubuntu 20.04 and Windows 10). The laptop display is a 4K display. I currently use a kernel parameter nomodeset for correcting a problem I used to face earlier.
So now my /etc/default/grub file has GRUB_CMDLINE_LINUX_DEFAULT="nomodeset".

After doing that, the problem was addressed, but a new problem spawned. This is definitely a display manager issue because after boot I can access a CLI using Ctrl + Alt + F2 but the GUI doesn’t show up. The issue is

  • When I use the X.Org X server -- Nouveau display driver from xserver-xorg-video-nouveau (open source) driver, the laptop display works but an external monitor attached to the HDMI port doesn’t.
  • When I use the nvidia-driver-460 (proprietary, tested) driver, the laptop display doesn’t work (remains blank after boot) but an external monitor attached to the HDMI port works (external monitor isn’t 4K, but I guess that’s not very relevant).

I need to use both the displays and need NVIDIA CUDA to work. I use xfce with Ubuntu (xubuntu 20.04), the display manager is lightdm. The laptop has an NVIDIA RTX 2060 Max-Q graphics card.

I have removed quiet splash from GRUB_CMDLINE_LINUX_DEFAULT in grub to inspect if there are any issues during boot. I found no errors, the last line is Starting Light Display Manager...

I can share logs and outputs on request. I am a newbie, but can run basic commands.