Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot start Sway. I use Nvidia
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
elparitacaliente
n00b
n00b


Joined: 27 Dec 2023
Posts: 3

PostPosted: Wed Dec 27, 2023 10:28 pm    Post subject: Cannot start Sway. I use Nvidia Reply with quote

Hello everyone

I'm trying to start Sway but I keep getting errors like "EGL_NOT_INITIALIZED", "DRI2: failed to load driver", and "Failed to create renderer". I have an Nvidia graphics card and I have set nouveau in my video cards USE flags.

Let me know if I should provide more info and thanks for your time :D
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1441
Location: Earth

PostPosted: Thu Dec 28, 2023 12:23 am    Post subject: Reply with quote

Welcome to Gentoo,

please try by starting sway --unsupported-gpu - look here https://wiki.archlinux.org/title/sway#Installation

or edit as root /usr/share/wayland-sessions/sway.desktop

if you using Openrc / elogind dbus-run-session sway --unsupported-gpu

and maybe you also need some of the following variables which can be set in .profile file in your users Home - create as user, e.g. touch .profile (<<< there's a DOT at the beginning).
Code:
# NVIDIA

export WLR_NO_HARDWARE_CURSORS,1
export LIBVA_DRIVER_NAME,nvidia
export __GLX_VENDOR_LIBRARY_NAME,nvidia
export GBM_BACKEND,nvidia-drm

export __NV_PRIME_RENDER_OFFLOAD,1
export __VK_LAYER_NV_optimus,NVIDIA_only
export WLR_DRM_NO_ATOMIC,1
export NVD_BACKEND,direct

# FOR VM and POSSIBLY NVIDIA

export WLR_RENDERER_ALLOW_SOFTWARE,1

# nvidia firefox (for hardware acceleration on FF)?
# check this post https://github.com/elFarto/nvidia-vaapi-driver#configuration

export = MOZ_DISABLE_RDD_SANDBOX,1
export NVD_BACKEND,direct
export EGL_PLATFORM,wayland

you can also use it as a script file which you have to tell sway to initiate at start.

here is an example https://github.com/crispyricepc/sway-nvidia/blob/main/wlroots-env-nvidia.sh

and read the WiKi - you'll find most infos https://github.com/swaywm/sway/wiki

i'am not sure, because i use AMD.

8)

EDIT:

or try with Hyprland - it is a fork of Sway with nice eye candy

https://wiki.hyprland.org/hyprland-wiki/pages/Nvidia/

try with the dots from https://github.com/JaKooLit/Hyprland-Dots
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Thu Dec 28, 2023 2:18 am    Post subject: Reply with quote

do you have: nvidia-drm.modeset=1 on your kernel command line?
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
elparitacaliente
n00b
n00b


Joined: 27 Dec 2023
Posts: 3

PostPosted: Thu Dec 28, 2023 10:17 am    Post subject: Reply with quote

CooSee wrote:
Welcome to Gentoo,

please try by starting sway --unsupported-gpu - look here https://wiki.archlinux.org/title/sway#Installation

or edit as root /usr/share/wayland-sessions/sway.desktop

if you using Openrc / elogind dbus-run-session sway --unsupported-gpu

and maybe you also need some of the following variables which can be set in .profile file in your users Home - create as user, e.g. touch .profile (<<< there's a DOT at the beginning).
Code:
# NVIDIA

export WLR_NO_HARDWARE_CURSORS,1
export LIBVA_DRIVER_NAME,nvidia
export __GLX_VENDOR_LIBRARY_NAME,nvidia
export GBM_BACKEND,nvidia-drm

export __NV_PRIME_RENDER_OFFLOAD,1
export __VK_LAYER_NV_optimus,NVIDIA_only
export WLR_DRM_NO_ATOMIC,1
export NVD_BACKEND,direct

# FOR VM and POSSIBLY NVIDIA

export WLR_RENDERER_ALLOW_SOFTWARE,1

# nvidia firefox (for hardware acceleration on FF)?
# check this post https://github.com/elFarto/nvidia-vaapi-driver#configuration

export = MOZ_DISABLE_RDD_SANDBOX,1
export NVD_BACKEND,direct
export EGL_PLATFORM,wayland

you can also use it as a script file which you have to tell sway to initiate at start.

here is an example https://github.com/crispyricepc/sway-nvidia/blob/main/wlroots-env-nvidia.sh

and read the WiKi - you'll find most infos https://github.com/swaywm/sway/wiki

i'am not sure, because i use AMD.

8)

EDIT:

or try with Hyprland - it is a fork of Sway with nice eye candy

https://wiki.hyprland.org/hyprland-wiki/pages/Nvidia/

try with the dots from https://github.com/JaKooLit/Hyprland-Dots


First of all thanks for the detailed answer. I've tried all of that but it did not work. Even Hyprland crashes on start. :(
Back to top
View user's profile Send private message
elparitacaliente
n00b
n00b


Joined: 27 Dec 2023
Posts: 3

PostPosted: Thu Dec 28, 2023 10:20 am    Post subject: Reply with quote

Naib wrote:
do you have: nvidia-drm.modeset=1 on your kernel command line?


Yep, did that as well but to no avail
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2720

PostPosted: Thu Dec 28, 2023 2:22 pm    Post subject: Reply with quote

elparitacaliente wrote:
Naib wrote:
do you have: nvidia-drm.modeset=1 on your kernel command line?
Yep, did that as well but to no avail
fwiw you don't need to set that when USE=wayland is set on nvidia-drivers (it's set by default in nvidia.conf then). USE=wayland on nvidia-drivers is of course required for other reasons too, I do assume it's set globally if you're using wayland.

That aside, I hope this isn't some dual gpu / optimus setup, that tend to confuse everything esp. with wayland. The situation should be a little bit better with nvidia-545 though, so you could try 545 if not already (~testing-only due to being a non-production branch).

Haven't tried sway with nvidia-drivers in like a year, so haven't kept up with quirks to help more with that. Not sure but don't recall I needed to set/change anything to make it "at least" start (with my single gpu) except passing the (now renamed) my-next-gpu-wont-be-nvidia option :? Not that there wasn't other quirks after that (like needing to disable hw cursor).
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Thu Dec 28, 2023 10:55 pm    Post subject: Reply with quote

elparitacaliente wrote:
Even Hyprland crashes on start. :(

Out of interest, have you tested whether a non-wlroots-based compositor works?
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2720

PostPosted: Fri Dec 29, 2023 2:19 am    Post subject: Reply with quote

flexibeast wrote:
elparitacaliente wrote:
Even Hyprland crashes on start. :(

Out of interest, have you tested whether a non-wlroots-based compositor works?
plasma/kwin and gnome/mutter tend to always work fine given upstreams care to keep nvidia working to some degree (I give both a quick try whenever I stabilize new nvidia-drivers in a passthrough VM I use for this). They both work "out of the box" without anything special for me, except that gdm can be a bit picky about letting you start it with wayland when using nvidia (may try to force Xorg), so I use sddm for both to avoid the hassle.

Otherwise there's also weston for non-wlroots I guess, but I never really played with that one and not sure how it fares with nvidia.

End of the day, I still use Xorg myself though, will reconsider in a few years :)
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Fri Dec 29, 2023 6:46 pm    Post subject: Reply with quote

Everybody went into discussing nvidia-drivers, but did not original poster say that he is using nouveau ?
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
Page 1 of 1

 
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