Wayland, hybrid intel/nvidia, external monitor

Hello everyone,
unfortunately, I find myself in a situation similar to many of those I have read on various forums and most of these have led to a solution that is not what I am looking for, to switch only in nvidia mode.

My laptop has the following GPU configuration in hybrid mode:

lspci -k | grep -A 2 -E "(VGA|3D)"                                                                                                                                                                                           ✔ 
0000:00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P Integrated Graphics Controller (rev 0c)
        Subsystem: Acer Incorporated [ALI] Alder Lake-P Integrated Graphics Controller
        Kernel driver in use: i915
--
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA107M [GeForce RTX 3050 Ti Mobile] (rev a1)
        Subsystem: Acer Incorporated [ALI] GA107M [GeForce RTX 3050 Ti Mobile]
        Kernel driver in use: nvidia
mhwd -l                                                                                                                                                                                                                      ✔ 
> 0000:01:00.0 (0300:10de:25a0) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2023.03.23               false            PCI
          video-nvidia            2023.03.23               false            PCI
    video-nvidia-470xx            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

> 0000:00:02.0 (0300:8086:4626) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2023.03.23               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


mhwd -li                                                                                                                                                                                                                     ✔ 
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
     video-modesetting            2020.01.13                true            PCI
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
echo $XDG_SESSION_TYPE && glxinfo | grep "OpenGL renderer" && prime-run glxinfo | grep "OpenGL renderer"                                                                                                                     ✔ 
wayland
OpenGL renderer string: Mesa Intel(R) Graphics (ADL GT2)
OpenGL renderer string: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2

What I’m trying to do?

Edit /etc/default/grub adding " for set the modeset=1 for the nvidia_drm module, but there isn’t a module nvidia_drm in kernel: after added nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm to the initramfs (/etc/mkinitcpio.conf) I launch mkinitcpio -P and I got

==> ERROR: module not found: 'nvidia'
==> ERROR: module not found: 'nvidia_drm'
==> ERROR: module not found: 'nvidia_uvm'
==> ERROR: module not found: 'nvidia_modeset'

I’m install Manjaro with property drivers.

uname -r                                                                                                                                                                                                                     ✔ 
6.6.26-1-MANJARO
inxi -CG                                                                                                                                                                                                                  22 ✘ 
CPU:
  Info: 14-core (6-mt/8-st) model: 12th Gen Intel Core i7-12700H bits: 64
    type: MST AMCP cache: L2: 11.5 MiB
  Speed (MHz): avg: 404 min/max: 400/4600:4700:3500 cores: 1: 400 2: 400
    3: 400 4: 400 5: 400 6: 400 7: 400 8: 400 9: 497 10: 400 11: 400 12: 400
    13: 400 14: 400 15: 400 16: 400 17: 400 18: 400 19: 400 20: 400
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics driver: i915 v: kernel
  Device-2: NVIDIA GA107M [GeForce RTX 3050 Ti Mobile] driver: nvidia
    v: 550.67
  Device-3: Quanta ACER HD User Facing driver: N/A type: USB
  Display: wayland server: X.org v: 1.21.1.12 with: Xwayland v: 23.2.6
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915,nvidia resolution: 1920x1080
  API: EGL v: 1.5 drivers: iris,kms_swrast,nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa v: 24.0.2-manjaro1.1
    renderer: Mesa Intel Graphics (ADL GT2)
  API: Vulkan v: 1.3.279 drivers: nvidia surfaces: xcb,xlib,wayland

I want to stay in hybrid mode and be able to use Wayland; in other distros it works fine, only in Manjaro I have this problem but…the other distros aren’t Manjaro.

I would be very grateful for your help. Have a nice weekend.

Are you actually using the 6.6 kernel … or 6.6-rt ?

Last time I saw

It was on a realtime kernel only.
(why the realtime kernels are built without those modules I dont know …)

ex:

Actually I’m using 6.6:
immagine

These errors appeared after that I insert nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm in /etc/mkinitcpio.conf:

head -n 7 /etc/mkinitcpio.conf                                                            ✔  11s  
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(usbhid xhci_hcd)
MODULES=(nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm)

Only installing envycontrol doesn’t fix and optimus-manager doesn’t support Wayland Session.

I didnt suggest anywhere that you should … as you prefaced this thread with

I only linked that thread to show an example of those ‘missing modules’ being produced by an rt kernel, but at the same time not produced from the regular 6.6 kernel.

You shouldnt be using optimus-manager at all for multiple reasons, including it requires hacky options be set to your Display Manager, etc. Its simply garbage and better tools exist.

But also ‘hybrid mode’ of any of those utilities is the same as simply using the PRIME profile provided by mhwd without any ‘switcher’ utility installed.

This has multiple problems.

There should be no , and certainly no and .

MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

Though I would expect a different output from mkinitcpio if that was really the line.

Such as
==> ERROR: module not found: 'and'

But what do I know.

I suppose besides fixing those errors we can go over the things;

sudo pacman-mirrors -f && sudo pacman -Syu
sudo mhwd -f -i pci video-hybrid-intel-nvidia-prime
sudo mkinitcpio -P
sudo grub-mkconfig -o /boot/grub/grub.cfg

Thank you very much for your attention.
I apologize for my bad impression, let me explain: when I did the various tests, I hadn’t put “and” but I had left the “,” that’s why I saw the errors; in the code I sent, “and” appears because I copied and pasted to show the line I had modified.

Now I have correctly entered the values and successfully executed mkinitcpio -P

I also launched

sudo pacman-mirrors -f && sudo pacman -Syu
sudo mhwd -f -i pci video-hybrid-intel-nvidia-prime
sudo mkinitcpio -P
sudo grub-mkconfig -o /boot/grub/grub.cfg

without fix the issue.

I also forgot to specify that when editing the line GRUB_CMDLINE_LINUX_DEFAULT= in the /etc/default/grub file by adding nvidia_drm.modeset=1 something appears on the external monitor at reboot: the startup image with the Manjaro logo, but then nothing else, neither on the external monitor (which, however, turns on) nor on the laptop monitor but I have been able to switch to another tty, after login I tried to launch startx without success, if it can be useful I attach the errors from the Xorg log:

cat .local/share/xorg/Xorg.0.log | grep EE                                                                                                                                                                           INT|INT ✘ 
[    42.379] Current Operating System: Linux nitro 6.6.26-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 x86_64
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    42.926] (EE) Failed to load module "nouveau" (module does not exist, 0)
[    42.926] (EE) Failed to load module "nv" (module does not exist, 0)
[    42.926] (EE) Failed to load module "fbdev" (module does not exist, 0)
[    42.926] (EE) Failed to load module "vesa" (module does not exist, 0)
[    43.286] (II) Initializing extension MIT-SCREEN-SAVER
[    43.317] (EE) modeset(G0): Failed to create pixmap
[    43.317] (EE) 
[    43.317] (EE) failed to create screen resources(EE) 
[    43.317] (EE) 
[    43.317] (EE) Please also check the log file at "/home/pippo/.local/share/xorg/Xorg.0.log" for additional information.
[    43.317] (EE) 
[    43.320] (EE) Server terminated with error (1). Closing log file.
    ~  cat .local/share/xorg/Xorg.0.log | grep WW                                                                                                                                                                                   ✔ 
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    42.379] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[    42.379] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[    42.379] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[    42.379] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[    42.384] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    42.926] (WW) Warning, couldn't open module nouveau
[    42.926] (WW) Warning, couldn't open module nv
[    42.926] (WW) Warning, couldn't open module fbdev
[    42.926] (WW) Warning, couldn't open module vesa
[    42.926] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    43.285] (WW) modeset(G0): Option "AllowEmptyInitialConfiguration" is not used
    ~     

No worries.

Great.

Please revert any extra changes you may have made that do not match the default configurations or the previous/following guides.

Well we just wanted to get you to a ‘good’ state.

We can also double check the operability of PRIME;

glxinfo | grep 'renderer string'
prime-run glxinfo | grep 'renderer string'

If/when/now we have things working normally we can tackle the issue at hand.

I must assume this is the same scenario as others - your hybrid system uses the iGPU by default while at the same time you are plugging in the extra monitor to the dGPU.

Yes, an easy ‘fix’ for this is to set the system to use the dGPU.

But this can also be avoided through some extra elbow grease.

Please refer to this recent post:

First of all, thank you again for your guidance. However, I’m not sure what you’re suggesting I do.
In the meantime, I’ve conducted further tests with a clean installation. My intention was to see what would happen if I installed the version with open-source drivers and then installed proprietary drivers. After the installation, I found that the situation with the open-source drivers was different from that with the proprietary drivers: with X11, the external monitor was not detected, while with Wayland it was. I installed the proprietary drivers and again, the session with Wayland did not work on the external monitor, while with X11 it did.

glxinfo | grep 'renderer string'                                                               ✔ 
OpenGL renderer string: Mesa Intel(R) Graphics (ADL GT2)
prime-run glxinfo | grep 'renderer string'                                                     ✔ 
OpenGL renderer string: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2

I have noticed that with the same proprietary drivers on distributions like EndevourOS (another Arch), Nobara (Fedora), and especially RegataOS (OpenSuse), the session with Wayland worked perfectly on an external monitor…this makes me think the problem is the operability of PRIME and Wayland. Where do you think the problem lies? I don’t mind putting in some elbow grease, as it could be a great learning experience. I guess I’ll have to settle for using the external monitor only with the X11 session until there are updates.

Another question: why are these two voices, as shown in the screen, not present in the Wayland session?

Any further suggestions would be greatly appreciated. Thanks again.

Looks normal.
It shows that you are running on the intel by default, and using the nvidia when you use prime-run.

Are they actually the same?
You installed ‘prime’ things and configured your system to work that way?
Or did you just install the nvidia drivers?

As explained above.
You have a hybrid system, with the iGPU used by default. But you are plugging the monitor into the dGPU. Or at least thats what I guess, as thats usually the case in these scenarios.

There are multiple approaches to this like here:

And envycontrol, etc. But you stated you did not want to set it to ‘nvidia-only’

So you either want reverse-prime or something similar

https://wiki.archlinux.org/title/PRIME#Reverse_PRIME

https://wiki.archlinux.org/title/PRIME#Discrete_card_as_primary_GPU