Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wayland with Nvidia binary not working [solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 1:03 pm    Post subject: Wayland with Nvidia binary not working [solved] Reply with quote

I'm running unstable with the latest KDE Plasma 6.1 and nvidia-drivers-560.35.03 but every time I try wayland it fails. It used to log me into a non accelerated session, last try got me a black screen but firefox restore on a twitch stream got me audio so it did work. Somewhat... I can switch to a text console (to read logs) and reboot from there so nothing serious. Switching back to X and everything works fine. I just want to give Wayland a try.

I took a look at everything obvious in /var/log/ but couldn't find an error message. Where should I look to get a hint as to what's actually going wrong?

UPDATE: I stumbled upon the solution. So obvious it hurts... I did add nvidia.modeset=1 and nvidia.fbdev=1 to the kernel as boot parameters. At least the modeset is a hard requirement for wayland.


Last edited by Torangan on Fri Oct 11, 2024 12:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1699
Location: South America

PostPosted: Wed Sep 11, 2024 3:48 pm    Post subject: Reply with quote

Not a Plasma, Wayland or NVIDIA user, but I believe I read in several places that Wayland and NVIDIA don't play well together... And NVIDIA stuff being proprietary doesn't make things easy to debug or fix.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2852

PostPosted: Wed Sep 11, 2024 4:39 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Not a Plasma, Wayland or NVIDIA user, but I believe I read in several places that Wayland and NVIDIA don't play well together... And NVIDIA stuff being proprietary doesn't make things easy to debug or fix.
Afaik it works pretty well nowadays, we have several nvidia+plasma6+wayland users from what I've seen (including a few devs, or at least 2). That combination works for me as well out-of-the-box (aka didn't really configure anything, just a plasma profile with defaults which includes global USE=wayland) and things are accelerated, albeit it's just a single card (no offloading, and it's a old 1070) + single monitor simple setup that I use for testing (I don't actually use wayland outside testing myself "yet").

Not to say it always goes well for everyone depending on their setup/hardware/settings, wayland support is being rather actively developed lately though so situation should improve over time. If in doubt can always just keep waiting for things to settle down rather than spend time on this (no urgency for anyone to switch from X, or at least not on Gentoo as long as upstream support exists).

That aside, don't think I can help with debugging given I hardly look at wayland beside checking if it still works now and then before stabilizing new nvidia-drivers. Haven't kept track of cause/solutions to common issues either not counting things I had to fix in nvidia-drivers packaging itself.
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 6:05 pm    Post subject: Reply with quote

I'm not in a hurry. If I don't get good hints I'll simply try again after new versions of Plasma oder Nvidia Drivers come out. I don't need Wayland for anything yet.

I should mention: it's a dual monitor setup with different resolutions. Works just fine with X.org.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Wed Sep 11, 2024 7:48 pm    Post subject: Reply with quote

Plasma should be easy. It should just need you to click "wayland" in sddm to launch with it.

Gnome is much trickier.

If you dont see a wayland option in sddm, you either dont have wayland enabled in USE flags and/or plasma still requires egl to be enabled.

Anyway, once you get it running it works fine.

Older nvidia drivers will cause problems.
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 8:06 pm    Post subject: Reply with quote

I do experience problem once I select Wayland in sddm. X.org works fine. It used to restore my session just very slow, last try was a black screen but session restore did occur correctly (could hear stream running). Going back to X.org I had a restore back to the last working state.

I only use KDE.

As mentioned above, I'm using the most recent nvidia drivers offered in unstable gentoo.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Wed Sep 11, 2024 9:00 pm    Post subject: Reply with quote

Torangan wrote:
I do experience problem once I select Wayland in sddm. X.org works fine. It used to restore my session just very slow, last try was a black screen but session restore did occur correctly (could hear stream running). Going back to X.org I had a restore back to the last working state.

I only use KDE.

As mentioned above, I'm using the most recent nvidia drivers offered in unstable gentoo.


systemctl or openrc?

If systemctl:

journalctl -xeu sddm

You may want to try manually launching a KDE session with wayland in terminal/tty from your monitor and see what errors pop up.
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 9:29 pm    Post subject: Reply with quote

I'm on openrc.

Manually launching sounds like an idea. Just stop the currently running one and start it from console I guess?
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Wed Sep 11, 2024 9:37 pm    Post subject: Reply with quote

Torangan wrote:
I'm on openrc.

Manually launching sounds like an idea. Just stop the currently running one and start it from console I guess?


Restart and when it gets to sddm switch your tty (it's like control+command and then 2 through 8 keys or something. Might be control+super). Once you are at the terminal login screen login and run the command to start a kde session.

I use gnome. For gnome, this is what I use:

Code:
MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland dbus-run-session gnome-session


I can't get gnome to launch with wayland from gdm no matter what I do, so it has to be through command.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2852

PostPosted: Wed Sep 11, 2024 9:51 pm    Post subject: Reply with quote

simplycorbett wrote:
I can't get gnome to launch with wayland from gdm no matter what I do, so it has to be through command.
In theory that PR due to be merged soon'ish *could* make gdm show wayland again, but I haven't verified. GDM looks at several conditions before it shows a wayland session to nvidia users, and that setting (off by default) is one of them, casually flipping it on can break suspend/hibernate on Xorg and that PR tries to fix that (broken either way without it on wayland, gnome was likely tired of people reporting suspend issues and blocked wayland because of it). I think it will still be hidden on openrc+split-usr systems given gdm looks at the wrong path for a file it uses as another condition, but "may" be fine on 23.0 merged-usr profiles. Not sure if there's more factors though, I haven't looked at gdm in a year.
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 10:03 pm    Post subject: Reply with quote

Gave it a try. No error messages from manual running either.

The fix from the PR also does nothing. Guess I'll be trying it again after a few version updates on relevant packages.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Wed Sep 11, 2024 10:03 pm    Post subject: Reply with quote

Doesn’t matter at the end of the day. As long as gdm is running in one tty and gnome is launched from another everything works.

If gdm is off things break.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Wed Sep 11, 2024 10:06 pm    Post subject: Reply with quote

Torangan wrote:
Gave it a try. No error messages from manual running either.

The fix from the PR also does nothing. Guess I'll be trying it again after a few version updates on relevant packages.


Um you have the Wayland use flag enabled yes?

There are two Wayland modes on kde. One is regular Wayland and the other is egl wayland.

When one fails use the other.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2852

PostPosted: Wed Sep 11, 2024 10:19 pm    Post subject: Reply with quote

Torangan wrote:
The fix from the PR also does nothing. Guess I'll be trying it again after a few version updates on relevant packages.
Yes, PR is irrelevant to your issues, was only replying to the gdm bit there. That PR is primarily about suspend/hibernate issues (not simply running wayland), and gdm is just a side-effect because of a custom check it does for suspend support on wayland.
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Wed Sep 11, 2024 10:25 pm    Post subject: Reply with quote

simplycorbett wrote:

Um you have the Wayland use flag enabled yes?

There are two Wayland modes on kde. One is regular Wayland and the other is egl wayland.

When one fails use the other.


USE=wayland is of course set. But I don't see egl wayland offered.
Packages egl-wayland and egl-gbm are installed.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Thu Sep 12, 2024 1:06 am    Post subject: Reply with quote

...are you on the open source nvidia module/driver or on the closed source one?
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Thu Sep 12, 2024 1:12 am    Post subject: Reply with quote

nvidia-drivers is the closed source one.
Back to top
View user's profile Send private message
simplycorbett
n00b
n00b


Joined: 14 Mar 2024
Posts: 27

PostPosted: Thu Sep 12, 2024 3:49 am    Post subject: Reply with quote

Torangan wrote:
nvidia-drivers is the closed source one.


Mmm, only if its not using +kernel-open.

Anyway... we really need some kind of error to help you..

your problem isnt going to fix itself in "a couple months" :o
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2422

PostPosted: Thu Sep 12, 2024 4:11 am    Post subject: Reply with quote

simplycorbett wrote:

I can't get gnome to launch with wayland from gdm no matter what I do, so it has to be through command.


A bit off topic, but yet:

Code:
# ln -s /dev/null /etc/udev/rules.d/61-gdm.rules


This disables udev rules that make gdm disable wayland session when it detects hybrid graphics and/or nvidia drivers.

On topic, I'm running GNOME in wayland mode with hybrid graphics AMDGPU+NVIDIA with the above fix with two monitors of different resolution. Around the summer of 2022 they introduced the above rules, so I disabled them.

It worked with nvidia in discrete mode fairly well before an after that, but I don't see value in running the 3070 on a laptop. It just drains battery and rises temperatures, just by idling. I even disabled the nvidia chip completely, but since I started using the external monitor, I need nvidia because the outputs are wired to it.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2852

PostPosted: Thu Sep 12, 2024 4:49 am    Post subject: Reply with quote

simplycorbett wrote:
Torangan wrote:
nvidia-drivers is the closed source one.

Mmm, only if its not using +kernel-open.
fwiw kernel-open is just for the kernel module, "almost" the whole user space is still closed source (GL vendor libraries, vulkan, cuda, etc... this doesn't use mesa except for libgbm, nouveau would use mesa), not to mention the massive gsp firmware, and a lot of issues to debug are going to be in either of these things. To not help things, their "public" git usage is terrible and there's no real history, it's just a dump for tags making it hard to find regressions, the meaning of each changes, or contribute meaningful things (exception for egl-wayland and related which are more proper which allowed people to find+fix a lot of wayland issues).

So I think it's safe to call it closed source either way, or at least when talking about the whole nvidia-drivers package.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2422

PostPosted: Thu Sep 12, 2024 5:51 am    Post subject: Reply with quote

I did a little search which returned the following tips:

The following are present on my system:

1) kernel mode setting: https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
2) the directory /usr/share/wayland-sessions : https://bbs.archlinux.org/viewtopic.php?pid=2127334#p2127334

Those are some suggestions:

1) try to run start-plasma
2) Arch Wayland wiki page: https://wiki.archlinux.org/title/Wayland
3) simpledrm: I've had problems with that in the past, currently it's unset for me: https://forum.manjaro.org/t/cannot-use-wayland-with-kde-on-nvidia/163318

I hope some of that helps.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2852

PostPosted: Thu Sep 12, 2024 10:30 am    Post subject: Reply with quote

logrusx wrote:
simplycorbett wrote:

I can't get gnome to launch with wayland from gdm no matter what I do, so it has to be through command.

A bit off topic, but yet:
Code:
# ln -s /dev/null /etc/udev/rules.d/61-gdm.rules

This disables udev rules that make gdm disable wayland session when it detects hybrid graphics and/or nvidia drivers.
Yeah, was just re-looking at the rules and it does disable it for hybrid, so the PR I mentioned will only allow it without removing the rules for basic single nvidia card setups _and_ if using systemd. I think they're overkilling it in trying to disable all setups where suspend/hibernate may "possibly" not work but ah well.

btw this is https://bugs.gentoo.org/939201
Back to top
View user's profile Send private message
Torangan
Apprentice
Apprentice


Joined: 21 Mar 2003
Posts: 186

PostPosted: Thu Sep 12, 2024 11:27 am    Post subject: Reply with quote

simplycorbett wrote:

Anyway... we really need some kind of error to help you..

your problem isnt going to fix itself in "a couple months" :o


That's the actual initial question. I'm searching for the place with the error message.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2422

PostPosted: Thu Sep 12, 2024 12:12 pm    Post subject: Reply with quote

Torangan wrote:
simplycorbett wrote:

Anyway... we really need some kind of error to help you..

your problem isnt going to fix itself in "a couple months" :o


That's the actual initial question. I'm searching for the place with the error message.


Well, Wayland is not a server and you won't find logs the way you've used to with Xorg. However I can't give you good suggestions. Maybe try running start-plasma from FB console and then try to return to the console. I see you're seasoned user, but many people are not aware of magic sysrq button or it does not come to their mind, that's why I remind you you can use it to gain control over the keyboard and return back to the framebuffer console. I hope there will be useful messages there.

Or you can see if one of the hints I've linked above will work.

Best Regards,
Georgi
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2422

PostPosted: Fri Sep 13, 2024 2:53 pm    Post subject: Reply with quote

Torangan wrote:
I should mention: it's a dual monitor setup with different resolutions. Works just fine with X.org.


Searching for another user's problem, I stumbled upon this thread, which may or may not be related: https://forum.manjaro.org/t/plasma-x11-general-system-lag-during-certain-animations/162796

Quote:
your Desktop problems could be related to Multimonitor under X11. You could try out to unplug other Monitor’s to see if this changes.


Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum