Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

No Wayland on Bookworm Testing with Nvidia Optimus laptop

- - ALL UNSTABLE / TESTING THREADS SHOULD BE POSTED HERE - -
This sub-forum is the dedicated area for the ongoing Unstable/Testing releases of Debian. Advanced, or Experienced User support only. Use the software, give, and take advice with caution.
Post Reply
Message
Author
jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

No Wayland on Bookworm Testing with Nvidia Optimus laptop

#1 Post by jorgesgk »

I have an Optimus laptop (Xiaomi Mi Notebook Pro 2018 equipped with an i7 8th gen + Nvidia Gefore MX150). Everything works ok (well, not Cheese, but that's a whole different topic), but whenever I install the proprietary Nvidia drivers, the option to select the Gnome session is simply not there.

I managed to fix this by commenting out from

Code: Select all

/lib/udev/rules.d/61-gdm.rules
the following lines:

Code: Select all

# Check if suspend/resume services necessary for working wayland support is ava>
#TEST{0711}!="/usr/bin/nvidia-sleep.sh", GOTO="gdm_disable_wayland"
#TEST{0711}!="/usr/lib/systemd/system-sleep/nvidia", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c \"sed -e 's/: /=/g' -e 's/\([^[:upper:]]\)\([[:upp>
#ENV{NVIDIA_PRESERVE_VIDEO_MEMORY_ALLOCATIONS}!="1", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_HIBERNATE=`systemctl is-enabled nvidi>
#ENV{NVIDIA_HIBERNATE}!="enabled", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_RESUME=`systemctl is-enabled nvidia-r>
#ENV{NVIDIA_RESUME}!="enabled", GOTO="gdm_disable_wayland"
#IMPORT{program}="/bin/sh -c 'echo NVIDIA_SUSPEND=`systemctl is-enabled nvidia->
#ENV{NVIDIA_SUSPEND}!="enabled", GOTO="gdm_disable_wayland"
#LABEL="gdm_nvidia_end"
and this one:

Code: Select all

# If this is a hybrid graphics laptop with vendor nvidia driver, disable wayland
#LABEL="gdm_hybrid_nvidia_laptop_check"
#TEST!="/run/udev/gdm-machine-is-laptop", GOTO="gdm_hybrid_nvidia_laptop_check_>
#TEST!="/run/udev/gdm-machine-has-hybrid-graphics", GOTO="gdm_hybrid_nvidia_lap>
#TEST!="/run/udev/gdm-machine-has-vendor-nvidia-driver", GOTO="gdm_hybrid_nvidi>
#GOTO="gdm_disable_wayland"
#LABEL="gdm_hybrid_nvidia_laptop_check_end"
An then, in

Code: Select all

/etc/default/grub adding GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"
And running

Code: Select all

sudo update-grub
I can't help but wonder why is this not documented? It's a legit question, this is not a procedure I ever had to do on Fedora, OpenSuse or Ubuntu and it takes aware from the easiness of Debian (with which I wanted to replace Fedora, to be honest, as I liked very much Debian's approach to stability still providing testing images, a rolling release and backports.

It is also my understanding that only setting

Code: Select all

nvidia-drm.modeset=1
would be enough, which clearly isn't the case. It is surprising to me because in the other distros were much easier to get working, and I had the understanding that Debian was rather eas(ier) than the others (except for, maybe, Ubuntu).

User avatar
@ttila
Posts: 150
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 15 times

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#2 Post by @ttila »

I remember that you shoud edit the gdm3 config file to run a wayland session, make a search over the web.

Wayland Is a work in progress, i found after months of research the way to use Nvidia closed driver with wayland.

I think you will be able to run gnome wayland with your discrete Intel video card.

User avatar
sunrat
Administrator
Administrator
Posts: 6470
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 117 times
Been thanked: 474 times

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#3 Post by sunrat »

jorgesgk wrote: 2023-03-14 07:46Debian's approach to stability still providing testing images, a rolling release and backports.
Debian doesn't provide a rolling release, only Stable or development versions. Bookworm is Testing currently, a development version. If you have found a bug, you should check for bug reports and submit one if your issue is not reported already.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#4 Post by jorgesgk »

sunrat wrote: 2023-03-14 09:47
jorgesgk wrote: 2023-03-14 07:46Debian's approach to stability still providing testing images, a rolling release and backports.
Debian doesn't provide a rolling release, only Stable or development versions. Bookworm is Testing currently, a development version. If you have found a bug, you should check for bug reports and submit one if your issue is not reported already.
Sorry, I may have not been clear. By rolling I meant Sid, which is, of course, unstable (and rolling).

Regarding the bug thing, I agree, I must report the bugs I find (it's the price of using testing). However, the issue here is I'm not sure there's a bug. I read nowhere that I had to uncomment those lines, but neither did I read about the nomodeset flag in GRUB, and that seems pretty well known. I will happily report a bug if it's indeed a bug, but I'm not so sure of that. Hence my question. If a developers says "this shouldn't be like that", I'll gladly report the bug as I would love Debian to get better.
Last edited by jorgesgk on 2023-03-14 10:07, edited 1 time in total.

jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#5 Post by jorgesgk »

@ttila wrote: 2023-03-14 08:56 I remember that you shoud edit the gdm3 config file to run a wayland session, make a search over the web.

Wayland Is a work in progress, i found after months of research the way to use Nvidia closed driver with wayland.

I think you will be able to run gnome wayland with your discrete Intel video card.
This is all I found. Thanks for your help nonetheless.

I, however, don't want to disable the Nvidia card as I appreciate the flexibility of having the Intel one for the usual stuff and the Nvidia for whatever may require higher performance.

User avatar
@ttila
Posts: 150
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 15 times

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#6 Post by @ttila »

jorgesgk wrote: 2023-03-14 10:00
This is all I found. Thanks for your help nonetheless.

I, however, don't want to disable the Nvidia card as I appreciate the flexibility of having the Intel one for the usual stuff and the Nvidia for whatever may require higher performance.
enable

Code: Select all

WaylandEnable=true

in your /etc/gdm3/custom.conf, i cannot test it because i use SDDM instead of gdm3.

You needn't to disable anything, just run the DE waylandized with the intel card and, as you write, the nvidia card when you need power.

jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#7 Post by jorgesgk »

Thanks @ttila, but if I do that, there lock screen will not show anything and stay deep black, with no way of changing anything or logging in at all...

It seems I need GDM to be in Xorg first before I switch to the Wayland Gnome session.

User avatar
@ttila
Posts: 150
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 15 times

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#8 Post by @ttila »

You need to select the gnome session type (xorg/wayland) in the login screen, gdm can start amy session.

1- lnstall a Windows compositor, like Weston. Can you login in Weston??
2- Login in a xorg session and launch in a terminal Weston, It runs?

The drm option Is needed when you use a single Nvidia card or as a primary video card. Try to disable the option ".... drm=1" from grub, Just to test.

EDIT: do you install libnvidia-egl-gbm1 and libnvidia-allocator1 packages?

jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#9 Post by jorgesgk »

Hi @ttila. I followed your steps and, I'm sorry for what I posted before. I took out the nomodeset and now the GDM does indeed work with

Code: Select all

WaylandEnable=true
However, I have no option for using Gnome Wayland.
I do have indeed the libnvidia-egl-gbm1 and libnvidia-allocator1 packages installed.

User avatar
@ttila
Posts: 150
Joined: 2017-12-13 16:57
Has thanked: 2 times
Been thanked: 15 times

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#10 Post by @ttila »

So, haven't you an option to select xorg/wayland in the greeter?? It should be there: Image

https://wiki.debian.org/Wayland#GNOME_. ... .20.2B-.29

jorgesgk
Posts: 6
Joined: 2023-03-14 07:35
Has thanked: 1 time
Been thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#11 Post by jorgesgk »

Exactly! I only have Gnome and Gnome classic, and both are Xorg, but not Nvidia.

Vsrq
Posts: 1
Joined: 2023-04-11 20:22
Has thanked: 1 time

Re: No Wayland on Bookworm Testing with Nvidia Optimus laptop

#12 Post by Vsrq »

Created this account just to thank you. I run Debian Unstable and have been trying to get Wayland to work on my optimus laptop. I followed these exact steps, and it worked like a charm!

Post Reply