External monitor with NVIDIA Drivers on Laptop. Extended display working

Use external monitor and laptop screen together with discrete nvidia card.
System information where the below tutorial has worked:
CPU i7-9750H.
GPU GTX 1650 ( Mobile ).
HDMI Output hardwired to NVIDIA card.
Parrot OS 5.0.1 freshly installed

INSTRUCTIONS:
It is HIGHLY recommended to CLEAN install ParrotOS 5.0.1 Electro Ara

Install Nvidia Drivers:

  1. From the GRUB loader select Parrot Linux and press E
  2. Now navigate the cursor to the row starting with Linux, then at the end of the row replace quiet splash with nouveau.modeset=0 (without quote marks). Then press F10.
  3. sudo parrot-upgrade
  4. sudo apt install linux-headers-$(uname -r)
  5. echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf
  6. update-initramfs -u && reboot
  7. sudo apt install nvidia-driver -t parrot-backports
  8. sudo apt install nvidia-smi
  9. sudo apt install bumblebee-nvidia primus-nvidia primus-vk-nvidia nvidia-smi nvidia-cuda-dev nvidia-cuda-toolkit

Configure Bumblebee

  1. sudo nano /etc/bumblebee/bumblebee.conf
  2. Look for the string Driver= and add nvidia, then look for the string KernelDriver= and add nvidia-current.
  3. Save the file and reboot.

Upgrade again

  1. sudo parrot-upgrade

SETUP EXTERNAL MONITOR ON LAPTOP WITH DISCRETE GRAPHIC CARD

Output wired to the INTEL chip:

  1. sudo nano /etc/X11/xorg.conf

  2. copy this : Section "Screen" Identifier "Screen0" Device "intelgpu0" - Pastebin.com

  3. You need to probably change the BusID for both the Intel and the NVIDIA card.

  4. lspci | grep VGA

  5. 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

  6. The BusID is 0:2:0. Note that lspci outputs hexadecimal values, but Xorg expects decimal values.

  7. Reboot

  8. Connect HDMI cable

Output wired to the NVIDIA chip

  1. sudo nano /etc/X11/xorg.conf.d/20-intel.conf

  2. copy this : https://pastebin.com/Z1WzhX7A

  3. sudo nano /etc/bumblebee/xorg.conf.nvidia

  4. erase the content of /etc/bumblebee/xorg.conf.nvidia

  5. copy this: Section "ServerLayout" Identifier "Layout0" Option "AutoAddDevic - Pastebin.com

  6. Reboot

  7. Connect HDMI cable

  8. optirun intel-virtual-output

The external monitor will now be recognized and you can adjust it. Preferences->Hardware->Displays

3 Likes

I edited your post to show some commands in markdown syntax.
It be nice if you can add your system information: laptop model, gpu version
p/s: i’m having a laptop that’s having issue with external monitor as well. It’s having a problem so I can’t test your tutorial on my laptop right now. I’ll try again later. If it works, I’ll tell doc team to add your tutorial on our documentation, with a big big thank.

2 Likes

@danterolle Please track this topic. I think we can try it and add to the doc.

System information added.
Relevant links:
Bumblebee - ArchWiki.
We could improve the solution by letting optirun intel-virtual-output run automatically as soon as HDMI cable is connected.

Tested and confirmed it worked on my side. I can’t believe i didn’t follow ALL the step and it failed for me before. I’m so happy now.
Steps:

  1. Add custom nvidia config at /etc/X11/xorg.conf.d
  2. Add custom bash script to run
    NVIDIA Optimus - ArchWiki
    I need some more test to confirm there’s no other configs are required. Now my laptop is using nvidia as the default primary GPU.
    Known bug: XFCE’s panel disappeared. Re-add again (using my script) crashed the plugin items.

OK i did it without any extra configuration. But because I did some test on my laptop before so I need somebody to help me test on a fresh environment to make sure it’s correct.
Laptop information:
Model: Gigabyte G5 KC
Graphic: Intel UHD, Nvidia RTX 3060 Mobile
Monitors:

  1. Main monitor, 144hz, connects to Intel UHD by default (information from windows 11)
  2. External monitor, the one i bought for raspberry pi. This is 15inc monitor that i don’t remember the model. Connection: HDMI port (to NVIDIA directly).

Problem: By default, machine can’t detect external monitor
Solution: Run this command: xrandr --setprovideroutputsource NVIDIA-G0 modesetting


Require: nvidia-driver must be installed for Nvidia card.

1 Like

I am going to try this on a new environment within the next couple of days.
Hopefully there is a solution to this.

What nvidia-driver version do you have installed for your RTX 3060 Mobile?

With current kernel 6.0, I have to install version from Nvidia homepage, 515.xxx

For kernel 5.18, the nvidia 510.xxx on the repository is fine

1 Like

Update some news for this topic:
Nvidia driver acts differently on different laptop. The latest test with kernel 6.0.0-12 (amd64) and Nvidia driver 510.85.02. Graphic card Nvidia RTX 3060 mobile. I tested on Gigabyte G5 KC and Gigabyte G5 KE:

  • Driver installed fine. Everything works fine
  • G5 KC (fresh install using Home iso) supports offload sink by default
  • G5 KE (using Netinstall) doesn’t support offload sink

So possible reasons:

  • G5 KE has option to switch graphic card mode (hybird / dGPU) in BIOS. It could be a reason
  • G5 KE used netinstall so maybe missing some packages could make this problem. If it’s the case, the required packages are unknown.

For number 2., I can’t write that in the grub config because keyboard works differently in GRUB, I tried many different keys but I couldn’t find key ‘=’. The keyboard works perfectly in Parrot.
I have nvidia packages installed, I did installation according to official parrot instructions:


I configured bumblebee:


Nvidia x server settings app doesn’t open. Hardware information apps know that nvidia card is there, but I didn’t find nvidia among kernel modules.


Hello! Since the same method didn’t work for me on the same laptop from the same vendor (with almost the same hardware spec, the only differences was the Mux switch), i would recommend you not to following any tutorial to modify either Xorg configs or grub configs. I (and i assuming a lot members in Linux community) am not sure what’s the problem and how to fix it. The only thing i’m sure is: you just need to install Nvidia’s driver (nvidia-driver package on repository), no extra packages / configuration is needed. There’s no extra information I can find on Nvidia’s official documentation (for now). If there’s something new, I’ll update it here. I think it needs official help from Nvidia’s developers to check and fix this problem.

Update: I made it work and I have NO IDEA why it worked. The solution is simple: enable dGPU mode only (Only NVIDIA) in BIOS, and start Linux. The funny thing is, it gave me blank screen 2 months ago. And today when i tried, it just worked for no reason, and ofc external monitor just worked, no extra command was required.


Short recap: I’m having Gigabyte G5 KC and G5 KE. Both use the same Nvidia 3060. KE has MUX Switch. The model KC requires only a xrand command to use external monitor. KE doesn’t work. I used HDMI port on both laptops (I didn’t try mini display port). There’s a short explain about MUX switch


(Source: What is a MUX switch and how to activate it on the Legion 5 PRO - YouTube)

So I’m researching a method to make external monitor works with Hybird Graphic mode on a laptop that has MUX Switch.

A new update (good news): I’m testing Parrot with new Debian stable. The latest Nvidia driver + kernel version on this branch made the external monitor worked with Gigabyte G5 KE. User just need to run command xrandr --setprovideroutputsource NVIDIA-G0 modesetting

I bought the LG portable monitor today. The Gram View model 16MR70.ASDA5. It has a USB Type C cable that plugs to thunderbolt port. Everything worked out perfectly. No need extra setup nor extra command. So I think this is a good solution for anybody is using laptop, want extra monitor (plus it’s portable so you can bring it anywhere) and completely compatible with Linux.