slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.11k stars 578 forks source link

No UI shown on Linux + GNOME + Nvidia + Wayland + skia #4828

Open abique opened 6 months ago

abique commented 6 months ago

Here's the error on the console:

MESA: error: zink: could not create swapchain

No window is shown at all. The application keeps running headless.

If the graphic acceleration fails, I'd expect slint to gracefully fallback to software rendering.

Here's my system info:

Linux knot 6.7.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 Mar 2024 01:59:01 +0000 x86_64 GNU/Linux
01:00.0 VGA compatible controller: NVIDIA Corporation TU116 [GeForce GTX 1660 SUPER] (rev a1)
nvidia-550.54.14-5
abique commented 6 months ago

I've just tried using nvidia-open and I end up with the same issue.

tronical commented 6 months ago

And in general, that is the behaviour that we implement and it works for many scenarios where the GL driver reports an error during initialization.

From the one line that you pasted, this looks like an error in the zink backend, but from the provided data it's not clear what the Mesa frontend is that you're using.

It's also not clear what Slint renderer you're using, so that we could start looking where we might be missing error handling - if any.

Perhaps you could run this with MESA_DEBUG=1?

abique commented 6 months ago

I am using slint as follow:

slint = { version = "1.4.1", default-features = false, features = [
    "compat-1-2",
    "std",
    "serde",
    "backend-winit",
    "backend-winit-wayland",
    "backend-winit-x11",
    "renderer-skia",
] }
abique commented 6 months ago

MESA_DEBUG=1 didn't lead to any additional logs

abique commented 6 months ago

I have mesa-24.0.2

abique commented 6 months ago

eglinfo-wayland.txt

abique commented 6 months ago

If I install mesa-amber-21.3.9-6 then it works but I get very low FPS. It seems that the recent mesa is emulating OpenGL on top of Vulkan.

abique commented 6 months ago

This solved my problem.

/etc/modprobe.d/nvidia.conf:

options nvidia_drm modeset=1
options nvidia_drm fbdev=1

But it be great to have the graceful fallback regardless.