tauri: [bug] Empty window, Failed to create GBM device for render device: /dev/dri/renderD128

Describe the bug

I was trying to compile and run mdSilo-app, but kept giving me this error. I though it might be mdSilo-specific so I created a new tauri project using create-tauri-app, but it still gives me this same error:

    Building [=======================> ] 358/359: tauri-app(bin)                                      
    Finished dev [unoptimized + debuginfo] target(s) in 1m 22s
Gtk-Message: 15:21:25.493: Failed to load module "appmenu-gtk-module"
Could not determine the accessibility bus address
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
Failed to create GBM device for render device: /dev/dri/renderD128: No such file or directory
Gtk-Message: 15:21:27.416: Failed to load module "appmenu-gtk-module"
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
DRI driver not from this Mesa build ('23.0.3' vs '23.1.9')
failed to bind extensions
Failed to create GBM device for render device: /dev/dri/renderD128: No such file or directory
Failed to get GBM device

It doens’t crash, just stays there and will continue to print “Failed to get GBM device” whenever I interact (resize) the window: Screenshot_20231118_153023

Reproduction

Repro repo: https://github.com/zyansheep/tauri-app-render-bug Instructions (on NixOS w/ nix flakes)

nix develop
yarn
yarn tauri dev

Expected behavior

Expected the app to show the default Hello World window.

Platform and versions

yarn run v1.22.19
$ tauri info

[⚠] Environment
    - OS: NixOS 23.5.0 X64
    ✔ webkit2gtk-4.0: 2.42.2
    ✔ rsvg2: 2.56.3
    ✔ rustc: 1.76.0-nightly (dd430bc8c 2023-11-14)
    ✔ cargo: 1.76.0-nightly (6790a5127 2023-11-10)
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be detected!
      Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 18.18.2
    - yarn: 1.22.19
    - npm: 9.8.1

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - tauri-cli [RUST]: 1.5.3
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
Done in 7.78s.

Stack trace

No response

Additional context

> doas inxi -GS
System:    Kernel: 6.1.62 x86_64 bits: 64 Desktop: KDE Plasma 5.27.9 Distro: NixOS 23.05 (Stoat) 
Graphics:  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel 
           Device-2: Sunplus Innovation USB Camera type: USB driver: uvcvideo 
           Display: wayland server: X.org 1.21.1.9 driver: loaded: modesetting resolution: <missing: xdpyinfo> 
           OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2) v: 4.6 Mesa 23.0.3

Edit: I figured I should probably test some tauri apps already in nixpkgs, so I installed pot and it seems to work perfectly, despite receiving nearly the same driver and render device messages as mdSilo and the blank tauri app.

Edit 2: I cloned the pot repository and build it from scratch and I’m getting the same error, so I’m wondering if it has something to do with the way it was packaged in nixpkgs 🤔

Edit: This was solved for me, but seems to still be an issue for other people. I have reopened the issue.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 33 (1 by maintainers)

Most upvoted comments

I have the same issue and WEBKIT_DISABLE_COMPOSITING_MODE=1 fixed it for me (without any other actions).

For everybody using flakes:

  1. Make sure that the version of nixpkgs being used in the flake.lock matches the one being used by the system.
  2. If you are using oxalica/rust-overlay, make sure that inputs.nixpkgs.follows is set correctly!
  3. Run nix flake lock --override-input nixpkgs github:nixos/nixpkgs/$(nixos-version --hash) in the project directory to sync the project’s nixpkgs with the system version!
inputs = {
    ...
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
};

The root cause of this is a mismatched version of one of the graphics libraries (likely mesa). Mesa versions are not backwards compatible!

I have the same problem. Using NixOS 24.05 and cargo-tauri nixpkgs.

Could not determine the accessibility bus address
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
Failed to create GBM device for render device: /dev/dri/renderD128: Illegal seek
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
DRI driver not from this Mesa build ('23.1.9' vs '23.3.5')
failed to bind extensions
Failed to create GBM device for render device: /dev/dri/renderD128: No such file or directory
Failed to get GBM device

using the flake mentioned here

I’m running into this same issue on Arch Linux (no nixos), and manually setting WEBKIT_DISABLE_COMPOSITING_MODE fixed it for me, although I still see the following errors when I run the AppImage build artifact that cargo tauri build emits:

 WARNING **: 20:47:45.121: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
DRI driver not from this Mesa build ('24.1.2' vs '24.1.2-arch1.1')
failed to bind extensions
DRI driver not from this Mesa build ('24.1.2' vs '24.1.2-arch1.1')
failed to bind extensions
DRI driver not from this Mesa build ('24.1.2' vs '24.1.2-arch1.1')
failed to bind extensions
Failed to create GBM device for render device: /dev/dri/renderD128: Illegal seek

My cargo tauri info output:

➤ cargo tauri info
WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Arch Linux Rolling Release X64
    ✔ webkit2gtk-4.0: 2.44.2
    ✔ rsvg2: 2.58.1
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.1 (2024-05-07)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 22.3.0
    - pnpm: 9.4.0
    - yarn: 1.22.22
    - npm: 10.8.1

[-] Packages
    - tauri [RUST]: 1.7.1
    - tauri-build [RUST]: 1.5.3
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - tauri-cli [RUST]: 1.6.0
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../src
    - devPath: ../src

Okay so after letting webkitgtk compile for what felt like foreverrrr that did seem to pay off 😅

My devshell for the tauri app now forces webkitgtk to use the same unstable.mesa version as my system and I no longer get the version mismatch or any other of the errors mentioned above.

(webkitgtk.overrideAttrs (old: {
  buildInputs = [ unstablePkgs.mesa ] ++ old.buildInputs;
}))

It’s funny to mention, though, that the underlying app stays responsive and works even though the screen is blank

This is now working for me on my laptop (after an upgrade to the most recent NixOS release 23.11, so likely too many variables have changed to pin-point) and is not working on my desktop anymore (though without the same error).

My desktop is using an nvidia video driver, while my laptop is a Ryzen with built-in graphics using amdgpu drivers I think.

Will try to repro using your repository.

I’m getting a similar issue for cinny-desktop (a Tauri-based matrix client) from the NixOS repos. pot does not seem to work for me.

Same basic errors in both, in both cases only seeing a blank or totally transparent window.

Note that this is only happening on my laptop, not on my desktop (which has a different graphics card and CPU, and thus different drivers)