Having problem while using external monitor on parrot os

Hi i’m using hp pavilion 15-ec2xxx

AMD Ryzen 5600H with radeon graphics + nvidia gtx 1650

I’m using parrot-lts with kde

i’m having problem while using external monitor i switched to nvidia & the external display works fine but my laptop display is blank. How to fix this? is there any way to use a hybrid system like radeon for laptop and nvidia to external monitor simultaneously like we do in windows ? or can we run both the displays on nvidia ?

Does ParrotOS provide any documentation around installing on or using a hybrid laptop system?

No i don’t think so

~ xrandr --listproviders 
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 1 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x1f7 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 0 name:Unknown AMD Radeon GPU @ pci:0000:05:00.0

nvidia-smi

Tue Jan  4 11:23:57 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   45C    P8     6W /  N/A |    505MiB /  3911MiB |      9%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1238      G   /usr/lib/xorg/Xorg                224MiB |
|    0   N/A  N/A      2317      G   /usr/bin/kwin_x11                  77MiB |
|    0   N/A  N/A      2401      G   /usr/bin/plasmashell               40MiB |
|    0   N/A  N/A      2442      G   /usr/bin/latte-dock                41MiB |
|    0   N/A  N/A      2731      G   ...akonadi_archivemail_agent        1MiB |
|    0   N/A  N/A      2739      G   .../akonadi_mailfilter_agent        1MiB |
|    0   N/A  N/A      2743      G   ...n/akonadi_sendlater_agent        1MiB |
|    0   N/A  N/A      2744      G   ...nadi_unifiedmailbox_agent        1MiB |
|    0   N/A  N/A      5142      G   ...AAAAAAAAA= --shared-files       63MiB |
|    0   N/A  N/A      8915      G   /usr/bin/kitty                      2MiB |
|    0   N/A  N/A     59428      G   ...AAAAAAAAA= --shared-files       38MiB |
+-----------------------------------------------------------------------------+
~ lspci -k | grep -A 2 -E "(VGA|3D)"                                                 
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M (rev a1)
	DeviceName: NVIDIA Graphics Device
	Subsystem: Hewlett-Packard Company TU117M
--
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c6)
	DeviceName:  Onboard IGD
	Subsystem: Hewlett-Packard Company Device 88dd

**Device info **

CPU: AMD Ryzen 5 5600H with Radeon Graphics (12) @ 3.3GHz
PRETTY_NAME="Parrot OS 5.0 (LTS)"
NAME="Parrot OS"
VERSION_ID="5.0"
VERSION="5.0 (LTS)"
VERSION_CODENAME=bullseye
ID=debian

In which case it might be nice to ask them about it so they can improve it for their entire userbase?

It’s even more a guessing game without a bug report, but I suspect as you run a LTS release, the kernel might be too old for the internal GPU. If upgrading the kernel does not help, please run nvidia-bug-report.sh as root and attach the resulting file here.

nvidia-bug-report.log (291.4 KB)

It was running fine on the dedicated GPU earlier but there was no outut on HDMI. Then I changed some settings and set the primary GPU to Nvidia after that the HDMI monitor is working but the original laptop monitor is not

Well, something is wrong with the bug-report. It does not contain all information and the order is scrambled.
However the amdgpu and nvidia drivers are both loading fine.
As parrot is debian based these pages should give you the information to correctly configure prime display offloading:

https://wiki.debian.org/NVIDIA%20Optimus
https://download.nvidia.com/XFree86/Linux-x86_64/470.74/README/randr14.html

Just replace the intel stuff with amdgpu.

Not really informative… like how and what did you do?

i added this file

cat xorg.conf.d/nvidia-primary.conf 
Section "OutputClass"
	Identifier "nvidia"
	MatchDriver "nvidia-drm"
	Driver "nvidia"
	Option "AllowEmptyInitialConfiguration"
	Option "SLI" "Auto"
	Option "BaseMosaic" "on"
	Option "PrimaryGPU" "yes"
EndSection

Section "ServerLayout"
	Identifier "layout"
	Option "AllowNVIDIAGPUScreens"
	Option "PrimaryGPU" "yes"
EndSection


I changed the display manager from lightdm to sddm

There was only 1 single file inside the xorg.conf.d folder that is 00-keyboard.conf
And I ran this Packages/nvidia-bug-report.sh at master · Pardus-Linux/Packages · GitHub to get the nvividia bug report


There are the 2 files I also added so I think i messed up some things so i changed the extensions so that the system ignores it

[ 7.681] (WW) NVIDIA(0): Failed to initialize Base Mosaic! Reason: Only one GPU
[ 7.681] (WW) NVIDIA(0): detected. Only one GPU will be used for this X screen.
[ 7.756] (–) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
[ 7.756] (–) NVIDIA(0): DFP-0 (boot)

You can’t use base mosaic for your optimus laptop.

I’m not sure what you are really up to.
Configuring 2 X-screens isn’t a good idea imho. You cannot drag windows from one to the other and I think you need 2 sets of keyboards and mice.
The like best way to go is using display offloading, explained in the links I gave you.

I just want to use both the screens like normally we do when i’m home I can connect to the external monitor & when i’m out i can use the laptop screen. But i’m not able to use the laptop screen but the external monitor is working fine. Suppose the external monitor is not available to me in that case I won’t be able to see anything on my laptop because as soon as parrot loads up the laptop display goes blank

Ok try the following:

sudo (text_editor) /usr/share/X11/xorg.conf.d/10-amdgpu.conf

Section “OutputClass”
  Identifier “AMDgpu”
  MatchDriver “amdgpu”
  Driver “modesetting”
EndSection

sudo (text_editor) /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section “OutputClass”
  Identifier “nvidia”
  MatchDriver “nvidia-drm”
  Driver “nvidia”
  Option “AllowEmptyInitialConfiguration”
  ModulePath “/usr/lib/nvidia/xorg”
  ModulePath “/usr/lib/xorg/modules”
  Option “PrimaryGPU” “Yes”
EndSection

Make sure no other config files interfere (in /etc/X11 or /usr/share/X11).

Display managers (choose yours):

LightDM

create /etc/lightdm/display_setup.sh

#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Make the script executable:

chmod +x /etc/lightdm/display_setup.sh

Now configure lightdm to run the script by editing the [Seat:*] section in /etc/lightdm/lightdm.conf :

/etc/lightdm/lightdm.conf

[Seat:*] display-setup-script=/etc/lightdm/display_setup.sh

Now reboot and your display manager should start.
If your display dpi is not correct add the following line (applies also to the other display managers):

xrandr --dpi 96

SDDM

/usr/share/sddm/scripts/Xsetup


xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto

GDM

/usr/share/gdm/greeter/autostart/optimus.desktop /etc/xdg/autostart/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

Make sure that GDM use X as default backend.

Enable prime synchronisation

edit or create: /etc/modprobe.d/nvidia.conf:
add:

options nvidia-drm modeset=1

Blacklist nouveau:

sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

Update initramfs:

sudo update-initramfs -u -k all

Reboot.

I got output from both of my displays but now the keyboard and mouse are not working even the internal ones.
as you said /usr/share/X11/xorg.conf.d/10-amdgpu.conf and /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf are the only files in the /usr/share/X11/xorg.conf.d/ dir