You are not logged in.

#1 2016-12-04 11:12:19

Staubsauger
Member
Registered: 2015-01-30
Posts: 7

Arch with Wayland and proprietary Nvidia driver

Hi guys,
as I was a bit confused reading about wayland and nvidia, I wanted to share my knowledge about that.

I read, that gnome now uses wayland as default. I was very happy, as I am looking forward for that for years. But when you are running the nvidia propriatary driver, you have no luck for the time being.
Nvidia has support for wayland, but the gnome package in the arch repo not. This is going to change as soon as gnome 3.24 is released. Fedora 25 already has support for wayland and nvidia because they have a different version of gnome 3.22. They patched gnome 3.22 with newer commits (would be great if someone could copy that and put it to aur, I am too noobish for that smile), so they have a mix of gnome 3.22 and gnome 3.23.

Also you have to have kms enabled as described here https://wiki.archlinux.org/index.php/NV … de_setting.
As I tried this, I noticed, that you have to add

 nvidia-drm modeset=1 

instead of

 nvidia-drm.modeset=1 

as descibed in the wiki.

So in short, if you want to run wayland:

- enable kms (leave out the dot between nvidia-drm and modeset=1)
- add the kernel modules for that (as descibed in the wiki)
- install gnome
- wait till end of march 2017 for gnome 3.24 or switch to nouveau

Hope I could help someone, so he or her does not have to read for days, just to get to the point, that it is not working at the time smile

Greetz

Last edited by Staubsauger (2016-12-05 14:00:37)

Offline

#2 2016-12-04 13:22:40

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

Staubsauger wrote:

- wait till end of march 2017 for gnome 3.24 or switch to nouveau

If you do this there is no point in doing any of the other steps though.

Also, if you do indeed supply the modeset as a kernel parameter with "nvidia-drm modeset=1", I'm surprised it works at all tbh. This would normally disassociate modeset from nvidia-drm and make it its own parameter.
The dot in "nvidia-drm.modeset=1" is there to indicate the property 'modeset' should be set on the nvidia-drm module.
Alternatively, you can also `echo "options nvidia-drm modeset=1" > /etc/modprobe.d/nvidia.conf` and add that file to the mkinitcpio.conf FILES="..." property (and then rebuild ofc).

Last edited by Omar007 (2016-12-04 13:25:24)

Offline

#3 2016-12-04 20:19:18

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,070

Re: Arch with Wayland and proprietary Nvidia driver

Staubsauger,

you may want to change the title to something like "gnome with wayland and nvidia proprietary driver"

Nvidia wanted to use EGLstreams under wayland, while everyone else used mesa GBM .
Wayland rejected EGLstreams , Nvidia rejected using GBM in their driver.
After long talks it was decided to design a new standard so in the not to distant future everyone would switch to the new standard (gbm 2 ? )

Some (fedora employees ?) contributors to Gnome seem to have had success to use EGLStream with Gnome on wayland on Fedora .

My personal feeling is that this step is worse for linux and opensource then anything else fedora / gnome have done sofar .


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2016-12-05 13:57:25

Staubsauger
Member
Registered: 2015-01-30
Posts: 7

Re: Arch with Wayland and proprietary Nvidia driver

If you do this there is no point in doing any of the other steps though.

I think you have to do these steps anyway... or not?

Also, if you do indeed supply the modeset as a kernel parameter with "nvidia-drm modeset=1", I'm surprised it works at all tbh. This would normally disassociate modeset from nvidia-drm and make it its own parameter.

When I set

 nvidia-drm.modeset=1 

I get

 (...) [drm:nvidia_drm_gem_import_nvkms_memory [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to import NVKMS memory to GEM object (...) 

in

 journalctl -b 

When I do this as I described above, so without the dot, there are no errors. I refer to this thread https://bbs.archlinux.org/viewtopic.php?id=212466

you may want to change the title to something like "gnome with wayland and nvidia proprietary driver"

You are right. The title is a bit misleading. Will change it.

So thanks for your informations. Greetz

Offline

#5 2016-12-06 14:34:43

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

Staubsauger wrote:

I think you have to do these steps anyway... or not?

For nouveau you don't need any of the other steps. Nouveau just works (assuming it supports the GPU generation in your system..) and with nouveau you aren't limited to Gnome either.

Staubsauger wrote:

When I set

 nvidia-drm.modeset=1 

I get

 (...) [drm:nvidia_drm_gem_import_nvkms_memory [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to import NVKMS memory to GEM object (...) 

in

 journalctl -b 

When I do this as I described above, so without the dot, there are no errors. I refer to this thread https://bbs.archlinux.org/viewtopic.php?id=212466

Error are actually expected if KMS is enabled with the nVidia drivers. Right now the nVidia driver does not work with a kernel compiled with CONFIG_HARDENED_USERCOPY=y, which the Arch kernel has set by default.
That means that if you're not seeing any errors and are running the standard kernel, you are most likely not even running nVidia KMS at all now.


From what I understand you've basically concluded that things don't work as early as your original post, but from what I read you have not (yet?) taken all the required steps to get it to even potentially work.
To summarize:
Nouveau + [any DM that supports wayland]
1) Ensure nouveau is the used driver (in other words, clean out all nVidia related stuff; drivers, configs, properties, etc)
2) Enjoy Wayland

nVidia + Gnome
1) Create a custom kernel package that compiles without CONFIG_HARDENED_USERCOPY
2) Create a custom mutter package that includes the required EGLStreams commits
3) Install both of the custom packages
4) Enable nVidia KMS as per the WIKI (add modules, set kernel argument, etc)
5) Enjoy Wayland? (I can not guarantee it actually works at this point since I have never tried this)

EDIT: Actually there is also another Wayland option available:
nVidia + Weston
1) Create a custom kernel package that compiles without CONFIG_HARDENED_USERCOPY
2) Install the custom kernel package
3) Install weston-eglstreams from the AUR https://aur.archlinux.org/packages/weston-eglstream
4) Enable nVidia KMS as per the WIKI (add modules, set kernel argument, etc)
5) Enjoy Wayland? (I can not guarantee it actually works at this point since I have never tried this)

Last edited by Omar007 (2016-12-06 14:58:22)

Offline

#6 2016-12-16 20:20:16

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

So the latest nVidia driver actually solves the kernel problem so I decided to give this a go.

nVidia + Weston -> WORKS
1) Install weston-eglstreams from the AUR https://aur.archlinux.org/packages/weston-eglstream
2) Enable nVidia KMS as per the WIKI (add modules, set kernel argument, etc)
3) Enjoy Wayland!

This means that any DM that uses weston as the compositor (Hawaii?) may work as well.


nVidia + Gnome -> NOT WORKING
1) Create a custom mutter package that includes the required EGLStreams commits (I compiled from git)
2) Install the custom mutter package
3) Enable nVidia KMS as per the WIKI (add modules, set kernel argument, etc)
4) Enjoy errors along the lines of "g_once_init_leave: assertion 'result != 0' failed" and "Can't initialize KMS backed: could not find drm kms device" and potentially some gnome-shell core dumps.


In addition to that, I also seem to be unable to start a Gnome Xorg session now so I'll experiment a bit more and update this post if anything changes.

EDIT:
Apparently someone had already made a topic on the nVidia forums about Xorg+nvidia-drm.modeset=1; https://devtalk.nvidia.com/default/topi … idia_drm-/
No luck getting Gnome on Wayland to run either.

Last edited by Omar007 (2016-12-16 22:27:14)

Offline

#7 2016-12-17 22:39:20

DeadMetaler
Member
Registered: 2016-03-16
Posts: 41

Re: Arch with Wayland and proprietary Nvidia driver

I builded Gnome 3.24, enabled KMS and deleted nvidia-settings. With nvidia-settings it doesn't login.

Wayland working with Gnome...
But animations laggy and worth than with Xorg.
You can't launch many apps with xWayland. Chrome is working, but Blender, glxinfo, games are not. Nothing to see at this moment.

Tested with GTX 650 Nvidia 370.26.

Also you may upgrade to Gnome beta 3.24 with:

[gnome-devel]
Server = http://softwareperonista.com.ar/repo/archlinux/gnome-devel/$arch

Last edited by DeadMetaler (2016-12-18 01:20:50)

Offline

#8 2016-12-18 03:53:40

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

370.28 or 375.26? (there has been no 370.26)

Last edited by Omar007 (2016-12-18 03:54:23)

Offline

#9 2016-12-18 08:08:20

DeadMetaler
Member
Registered: 2016-03-16
Posts: 41

Re: Arch with Wayland and proprietary Nvidia driver

Yes, sir! 375.26.

Offline

#10 2017-01-05 19:19:42

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

I had some time and gave this another shot. I'm still seeing the same behaviour as earlier.

@DeadMetaler:
I've also tried the PKGBUILDs from the repo you linked; there was no change to the output. So no success on my end with those either.
FYI, in weston I see no slowdowns at all so I'm surprised it would lag so much. Are you sure it didn't just fall back to a software renderer or something?

Last edited by Omar007 (2017-01-05 19:19:59)

Offline

#11 2017-01-06 03:25:21

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 353

Re: Arch with Wayland and proprietary Nvidia driver

Lone_Wolf wrote:

Some (fedora employees ?) contributors to Gnome seem to have had success to use EGLStream with Gnome on wayland on Fedora .

My personal feeling is that this step is worse for linux and opensource then anything else fedora / gnome have done sofar .

Could you elaborate on this? What would make this situation worse in general for linux and open source?


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#12 2017-02-18 10:39:00

Vagrant_Animus
Member
Registered: 2016-12-22
Posts: 6

Re: Arch with Wayland and proprietary Nvidia driver

I've bled my eyes trying to get GNOME 3.23.9 to work with the NVIDIA drivers but it just keeps crashing when launching the wayland session. It works fine under X11. I tried the driver from the Arch repositories and had no luck. Then I tried the drivers from AUR (beta, full-beta, full-beta-all) and also had no luck. I installed the driver from the upstream installer myself and also had no luck.

Heck, I can't even launch weston-eglstream with NVIDIA.

Offline

#13 2017-02-19 01:53:47

Omar007
Member
Registered: 2015-04-09
Posts: 298

Re: Arch with Wayland and proprietary Nvidia driver

You did enable nVidia KMS right?

As I stated before, I've personally not been able to get Gnome Wayland running with nVidia yet but I had no problems getting weston-eglstream to run.
That said, I've not tried any of this with the latest Gnome beta, nor the 378.13 nVidia drivers.

Last edited by Omar007 (2017-02-19 01:54:35)

Offline

#14 2017-02-21 15:38:57

Vagrant_Animus
Member
Registered: 2016-12-22
Posts: 6

Re: Arch with Wayland and proprietary Nvidia driver

I added nvidia-drm.modeset=1 to grub kernel parameter and nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm to /etc/mkinitcpio.conf under MODULES. Dmesg says that the kernel mode setting has been loaded and switching between TVTs is seamless which is an indication that KMS is running but  can utilise the drm backend. I wonder if I missed a step related to egl or something.

Offline

#15 2017-02-25 00:35:02

andrej.podzimek
Member
From: Zlín, Czech Republic
Registered: 2005-04-10
Posts: 85
Website

Re: Arch with Wayland and proprietary Nvidia driver

NVidia + Wayland doesn't work at all, so there's no hope at this point. If you're lucky, a black screen and a return to the login manager is what you get. If you push a bit further and try out some of the "beta" nvidia + wayland + egl stuff, a completely frozen machine in an undefined state is what you get. So, in a nutshell, trying Wayland again in ~1 year is the best thing one can do in this case. I've tested this with the latest NVidia drivers on my Quadro P5000 (the Pascal-type Quadro) as well as with the 340xx driver on 2 older machines. No, it just doesn't work.

(And by the way, Wayland doesn't work on nouveau either, by default, and it takes a lot of hassle and tweaking to make it start at least. Plus the overall performance (in both Wayland and X11) gets you back to the proprietary blob very quickly.)

There are numerous examples of the same phenomenon in recent history: For instance, Pulseaudio and NetworkManager have already become an important part of Linux distros and they just work out-of-the-box for a vast majority of people. Yet in the first ~5 years of their existence, they were both just unusable pieces of nuisance, i.e., things nearly everyone would uninstall in their very first steps after installing a distro, blocking them in the package manager setttings and never ever touching them again. They either didn't work at all or did work to an extent, but made things worse. But times have changed a lot since then. (Well, let's face it, 2/3 of common NetworkManager applets' menu items still don't work, but it's the working 1/3 that counts. I'm pleased to see how many features are starting to work now, after having sat in the menus in a buggy state for >5 years.)

Wayland is probably a similar case. It just needs time and the overall approach of NVidia doesn't make things easier. So, if you want to enjoy Wayland, you can either use an Intel GPU (which is more or less the only one where it *might* work flawlessly) or just wait. I'm sticking with the latter option, although it gets frustrating at times, mostly because virtually everyone with a recent NVidia GPU will see ugly video and compositor tearing, which will only go away if you replace X11 with something that can *really* do VSync. X11 can't do that, no matter what various nvidia-settings, compositors or video players might be trying to set. And it's quite a big disappointment to observe a total absence of VSync with a $2000+ GPU. Well, let's hope Wayland will be ready by this time in 2018.

Offline

Board footer

Powered by FluxBB