Multiple Monitors + Wayland + NVIDIA

Hello,

I recently installed Manjaro on my laptop which has a GeForce RTX 2060 GPU with an external HDMI display. When I first booted from the live CD, both of my screens worked but I’m not sure if they were using my GPU.

My ultimate goal would be to have my laptop run with integrated graphics by default, and have the ability to select specific applications that I would like to run on my GPU. Right now, I think I have my NVIDIA GPU kinda working?

With the Wayland window manager, only my laptop screen receives a signal. My external display does not receive a signal. I also don’t see my external display with xrandr.

Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080    143.88*+
   1440x1080    143.80
   ...

With the X11 window manager I have the opposite problem. Only my HDMI monitor receives a signal and my laptop screen does not. I do see the laptop screen with xrandr, but I’m not sure how to connect it. It doesn’t show up in the Display Manager and using xrandr --output “Screen 0” isn’t working for me either (unless I have the wrong format).

# xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00
   1680x1050     59.95
   ...
DP-4 disconnected (normal left inverted right x axis y axis)
# xrandr --output "Screen 0" --mode 1920x1080 --right-of eDP-1
warning: output Screen 0 not found; ignoring

The lockscreen also shows up on my external monitor but not my laptop screen.

So far, I’ve installed the NVIDIA drivers:

# 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

and a few packages:

  • envycontrol
  • nvidia-exec
  • linux66-nvidia
# uname -r
6.6.19-1-MANJARO

Thanks advanced for taking time to read this, and for providing any guidance to solve my issue. I’m still reletively new to Linux, especially with a GUI, so please let me know if there is anymore information that I can provide!

P.S. Not sure if it’s related, but I’m getting really low frame-rate in the games that I’ve tested so far.

post the output of

inxi -v8zy

Hello @Olli , thanks for your response! Here is a pastebin link with the output of the command you requested: inxi - Pastebin.com

please post the output of

echo $XDG_SESSION_TYPE && glxinfo | grep server

sgi ? and

systemctl status optimus-manager

Yes, it appears so:


# echo $XDG_SESSION_TYPE && glxinfo | grep server
x11
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

optimus-manager doesn’t appear to be installed.

# systemctl status optimus-manager
Unit optimus-manager.service could not be found.

okay, let’s make it short, your on intel internal gpu that doesn’t support driving all external screens. switch to nvidia

pamac install  envycontrol

run

sudo envycontrol -s nvidia

reboot and check again

echo $XDG_SESSION_TYPE && glxinfo | grep server

nvidia ?
then you’re good to go

and btw. you’re on x11 that’s the way it goes. hands off wayland and nvidia until there will be an acceptable solution (what we are waiting for years now)

Yes, I’m on X11 currently because I prefer to use my external monitor. Should I switch to Wayland before or after running the commands you provided?

you stay on x11 and don’t switch to wayland.
keep it as it is. install envycontrol, use the command to switch to nvidia and report the

echo $XDG_SESSION_TYPE && glxinfo | grep server

after rebooting.
this should be
x11
and
nvidia

Ah, gotcha. Thanks for clarifying.

I believe I had already installed envycontrol:

# sudo pacman -S envycontrol                                                              ✔  3s  
warning: envycontrol-3.3.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) envycontrol-3.3.1-1

Total Installed Size:  0.07 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] n

Switched to NVIDIA:

# sudo envycontrol -s nvidia
Switching to nvidia mode
Enable ForceCompositionPipeline: False
Enable Coolbits: False
Successfully enabled nvidia-persistenced.service
Operation completed successfully
Please reboot your computer for changes to take effect!

and rebooted:

# sudo reboot

Logged back in with X11, and checked for NVIDIA, but it doesn’t seem to have changed:

# echo $XDG_SESSION_TYPE && glxinfo | grep server
x11
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

Not sure what I could be doing wrong.

you did nothing wrong. it’s this type of terrible laptop-designs where the designers should rest in hell. install kate or any other editor (i prefer kate)
open

kate /etc/default/grub 

search for

GRUB_CMDLINE_LINUX_DEFAULT="

add the following to the existing line, do not delete anything

nvidia_drm.modeset=1

save the file, you’re asked for sudo password.
after saving run the following commands

sudo mkinitcpio -P
sudo update-grub

p.s.:
it should look like

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ...other entries...... nvidia_drm.modeset=1 udev.log_priority=3"

reboot
check

echo $XDG_SESSION_TYPE && glxinfo | grep server

Haha, thanks :laughing:

I believe I already tried this as well, but I added the parameter to GRUB_CMDLINE_LINUX (not _DEFAULT). I was worried that if I made the change and lost my display, I wouldn’t be able to boot into safe mode to revert. Happy to try adding it to the other field, or whatever you suggest. Not the end of the world if I end up needing to reinstall either.

# cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX"           ✔ 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash udev.log_priority=3"
GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

Edit: Just noticed the typo. Stand-by.

is the priority and most important level of kernel arguments that will overwrite any further settings, while

GRUB_CMDLINE_LINUX="

is not. use

GRUB_CMDLINE_LINUX_DEFAULT=
nvidia_drm.modeset=1 is not nvidia-drm.modeset=1

it must be underscore not minus

Yea, I noticed the typo myself shortly after posting. Thanks for the info about those kernel arguments. I tried correcting them but it still doesn’t appear to be working as expected.

Updated kernel args:

# cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia_drm.modeset=1 udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

mkinitcpio (can provide full output if needed):

# sudo mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux66.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.6-x86_64 -g /boot/initramfs-6.6-x86_64.img --microcode /boot/intel-ucode.img
==> Starting build: '6.6.19-1-MANJARO'
[snip]
==> Image generation successful

update-grub

# sudo update-grub
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-6.6-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-6.6-x86_64.img
Found initrd fallback image: /boot/initramfs-6.6-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p2@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
Root filesystem isn't btrfs
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
Found memtest86+ EFI image: /boot/memtest86+/memtest.efi
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done

Rebooted

# sudo reboot

Checked for NVIDIA:

# echo $XDG_SESSION_TYPE && glxinfo | grep server
x11
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

what a freaking system, let’s try optimus

pamac install optimus-manager
sudo systemctl enable optimus-manager

edit

kate  /etc/sddm.conf 

and simply put a # before the line starting with DisplayCommandand the one starting with DisplayStopCommand


sudo optimus-manager --switch nvidia

reboot

please report

sorry that i log out for today, but it’s already late and monday is on the rise. i’ll be back tomorrow

2 Likes

Indeed. Thanks for the help today! Will continue to do some research and troubleshooting. Catch you later.

for the search engines

this is a Razer Blade 15 Base Model (Early 2020)

Uninstalled envycontrol and installed optimus-manager:

# sudo pacman -S optimus-manager
resolving dependencies...
looking for conflicting packages...
:: optimus-manager and envycontrol are in conflict. Remove envycontrol? [y/N] y

Packages (2) envycontrol-3.3.1-1 [removal]  optimus-manager-1.5-3

Total Download Size:   0.09 MiB
Total Installed Size:  0.39 MiB
Net Upgrade Size:      0.31 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 optimus-manager-1.5-3-any                 94.2 KiB   180 KiB/s 00:01 [#######################################] 100%
(1/1) checking keys in keyring                                        [#######################################] 100%
(1/1) checking package integrity                                      [#######################################] 100%
(1/1) loading package files                                           [#######################################] 100%
(1/1) checking for file conflicts                                     [#######################################] 100%
(2/2) checking available disk space                                   [#######################################] 100%
:: Processing package changes...
(1/1) removing envycontrol                                            [#######################################] 100%
(1/1) installing optimus-manager                                      [#######################################] 100%
optimus-manager : enabling optimus-manager.service
Please reboot your computer before using optimus-manager
Optional dependencies for optimus-manager
    bbswitch: alternative power switching method
    acpi_call: alternative power switching method
    xf86-video-intel: provides the Xorg intel driver [installed]
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Arming ConditionNeedsUpdate...
(3/3) Refreshing PackageKit...

Rebooted:

# sudo reboot

Enabled optimus-manager:

sudo systemctl enable optimus-manager

Commented DisplayCommand and DisplayStopCommand:

# cat /etc/sddm.conf | grep -E "DisplayCommand|DisplayStopCommand"
#DisplayCommand=/usr/share/sddm/scripts/Xsetup
#DisplayStopCommand=/usr/share/sddm/scripts/Xstop

Switched optimus manager to nvidia. Seems to have errored. Is this expected?

# sudo optimus-manager --switch nvidia
ERROR: a GPU setup was initiated but Xorg post-start hook did not run.
Log at /var/log/optimus-manager/switch/switch-20240310T185346.log
If your login manager is GDM, make sure to follow those instructions:
https://github.com/Askannz/optimus-manager#important--gnome-and-gdm-users
If your display manager is neither GDM, SDDM nor LightDM, or if you don't use one, read the wiki:
https://github.com/Askannz/optimus-manager/wiki/FAQ,-common-issues,-troubleshooting
Cannot execute command because of previous errors.

switch-20240310T185346.log not showing any errors:

# cat /var/log/optimus-manager/switch/switch-20240310T185346.log
[7] INFO: # Xorg pre-start hook
[7] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
[7] INFO: Requested mode is: integrated
[25] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[25] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
[28] INFO: switching=none, nothing to do
[65] INFO: Found MHWD-generated Xorg config file at /etc/X11/xorg.conf.d/90-mhwd.conf. Removing.
[65] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
[65] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20240310T185346', 'requested_mode': 'integrated'}
[65] INFO: Xorg pre-start hook completed successfully.

Rebooted:

sudo reboot

Checked for nvidia:

# echo $XDG_SESSION_TYPE && glxinfo | grep server
x11
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:

Edit 1: Okay, I think I got it!

I switched to nvidia again and got a different output:

# sudo optimus-manager --switch nvidia
WARNING : no power management option is currently enabled (this is the default since v1.2). Switching between GPUs will work but you will likely experience poor battery life.
Follow instructions at https://github.com/Askannz/optimus-manager/wiki/A-guide--to-power-management-options to enable power management.

WARNING : Found a Xorg config file at /etc/X11/xorg.conf. If you did not create it yourself, it was likely generated by your distribution or by an Nvidia utility.
This file may contain hard-coded GPU configuration that could interfere with optimus-manager, so it is recommended that you delete it before proceeding.
Ignore this warning and proceed with GPU switching ? (y/N)
> y
You are about to switch GPUs. This will forcibly close all graphical sessions and all your applications WILL CLOSE.
(you can pass the --no-confirm option to disable this warning)
Continue ? (y/N)
> y
Switching to mode : nvidia
/bin/sh: line 1: i3-msg: command not found
/bin/sh: line 1: openbox: command not found
/bin/sh: line 1: awesome-client: command not found
/bin/sh: line 1: bspc: command not found
/bin/sh: line 1: qtile: command not found
/bin/sh: line 1: herbstclient: command not found

At this point, none of my applications closed like the message said it would, so I rebooted. After the reboot, both monitors immediately started working!

Checked for nvidia:

# echo $XDG_SESSION_TYPE && glxinfo | grep server
x11
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:

Success!! Not exactly sure what the issue was the first time around. I did change the /etc/sddm.conf file before rebooting and enabling optimus-manager but that’s the only thing that I can think of.

Thanks again @Olli for your patience and guidance!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.