nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

Instant crash on Wayland, when using DMABUF renderer

Open mattephi opened this issue 6 months ago • 9 comments

Describe the bug Unable to run Nyxt browser, it immediately crashes.

The main error I am trying to fight is:

** (WebKitWebProcess:2): WARNING **: 20:17:52.073: Can't connect to a11y bus: Could not connect: No such file or directory
<INFO> [20:17:52] Loading #P"/home/mattephi/.local/share/nyxt/auto-rules.lisp".
Gdk-Message: 20:17:52.334: Error 71 (Protocol error) dispatching to Wayland display.

Also I was able to reach once:

(WebKitWebProcess:2): GLib-GIO-CRITICAL **: 20:17:52.359: Error while sending AddMatch() message: The connection is closed

(WebKitWebProcess:2): GVFS-WARNING **: 20:17:52.359: Error creating proxy: Error calling StartServiceByName for org.gtk.vfs.Daemon: The connection is closed (g-io-error-quark, 18)

I have tried both kernel modules order in initrd, GSK_RENDERER=gl with no luck.

As a workaround, WEBKIT_DISABLE_DMABUF_RENDERER=1 as mentioned here helps, but I am not sure why and what it does.

Steps to reproduce the issue Install and try to run. Information

  • NixOS 25.05, nixpkgs-unstable, nyxt-3.12.0 and latest master commit.
  • Nvidia 575.51.02
  • Installation method: nixpkgs
  • Output of Nyxt command show-system-information: unable to run

mattephi avatar May 18 '25 11:05 mattephi

Sorry, I don't use Wayland, I have no idea why it would be failing. Does the app image of the latest pre-release work for you?

jmercouris avatar May 19 '25 21:05 jmercouris

Does the app image of the latest pre-release work for you?

I am not sure, I do not use use flatpak, I can test it and come back with results later

mattephi avatar May 20 '25 02:05 mattephi

I said app image, it is in the releases section, not on flathub.

jmercouris avatar May 20 '25 03:05 jmercouris

I said app image, it is in the releases section, not on flathub.

I am unable to run unpatched binaries as nixos is non-fhs compliant OS. I can try workarounds to run it, but it is not recommended way.

mattephi avatar May 20 '25 04:05 mattephi

I am aware of this, I also know that you can make FHS sandboxes to run applications.

jmercouris avatar May 20 '25 04:05 jmercouris

FHS sandboxes

Sorry it took me so much time to try. I have tried appimage-run and also tried creating my FHS env with fuse2 (which is what appimage-run does under the hood, if I am not wrong). But both with no luck, FUSE setup seems to be incorrect.

So Nyxt from sources does not work without the aforementioned flag, AppImage is unable to run due to nixos issues.

Some research makes me think that it is not issue with this nyxt, but how nixos and webkitgtk interact, because some other programs built with this have the same issues.

mattephi avatar May 22 '25 08:05 mattephi

Does Nyxt start if you use NO_AT_BRIDGE=1 nyxt?

What shows ls -l $XDG_RUNTIME_DIR/at-spi?

apt-ghetto avatar May 30 '25 14:05 apt-ghetto

Does Nyxt start if you use NO_AT_BRIDGE=1 nyxt?

No, it does not.

What shows ls -l $XDG_RUNTIME_DIR/at-spi?

Nothing.

As a workaround, WEBKIT_DISABLE_DMABUF_RENDERER=1 as mentioned here helps, but I am not sure why and what it does.

This works, however. Moreover, I have tried creating FHS env using flake and regular shell using nix-shell.

shell.nix
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    pkgs.nyxt
    pkgs.glfw
    pkgs.egl-wayland
    pkgs.xorg.libX11
    pkgs.xorg.libXt
    pkgs.libGLU
    pkgs.libGL
    pkgs.xorg.libICE
    pkgs.xorg.libSM
    pkgs.libxcrypt-legacy
    pkgs.util-linux
    pkgs.glib
    pkgs.wget
  ];
}
flake.nix (fhs)
{
  description = "nyxt env";
  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
  };
  outputs =
    { flake-utils, nixpkgs, ... }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = import nixpkgs { inherit system; };
        fhs = pkgs.buildFHSEnv {
          name = "nyxt-env";

          targetPkgs = _: [
            pkgs.nyxt
            pkgs.glfw
            pkgs.egl-wayland
            pkgs.xorg.libX11
            pkgs.xorg.libXt
            pkgs.libGLU
            pkgs.libGL
            pkgs.xorg.libICE
            pkgs.xorg.libSM
            pkgs.libxcrypt-legacy
            pkgs.util-linux
            pkgs.glib
            pkgs.wget
          ];
        };
      in
      {
        devShell = fhs.env;
      }
    );
}

And in FHS nyxt starts, but the window is empty, Could not create GBM EGL display: EGL_NOT_INITIALIZED. Aborting....

In regular shell, however, it always crashes Error 71 (Protocol error) dispatching to Wayland display..

In both shells I get warning Can't connect to a11y bus: Could not connect: No such file or directory.

mattephi avatar May 31 '25 05:05 mattephi

I can use Nyxt on Wayland on several systems (physical and virtualised machines). I use Sway on Gentoo and Fedora (with Nyxt as flatpak).

I think the a11y problem is not the root cause of your problem, because it also fails with NO_AT_BRIDGE=1 nyxt. But your system also does not setup the accessibility stuff as I would expect it. And probably also other stuff as you cannot connect to the WAYLAND_DISPLAY. But I never used Nixos so I cannot help further.

Or it is related to Nvidia. You might try GSK_RENDERER=ngl from https://discussion.fedoraproject.org/t/gdk-message-error-71-protocol-error-dispatching-to-wayland-display/127927/15

Regarding the "empty window" problem: You can try to set

(setf (uiop/os:getenv "WEBKIT_DISABLE_COMPOSITING_MODE") "1") in ~/.config/nyxt/config.lisp and start Nyxt.

apt-ghetto avatar Jun 01 '25 17:06 apt-ghetto