GraphiteEditor / GraphiteEditor/Graphite

Crash on startup when only llvmpipe (CPU Vulkan) is available instead of graceful error

Đang mở
#3,560 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Desktop
Ngôn ngữ chính
Rust
Star
27.2k
Fork
1.3k
Merge trung bình
20 giờ 5 phút
Pull request đã merge (30 ngày)
57

Mô tả

When launching Graphite on a system without a Vulkan-capable GPU, the application crashes during startup instead of failing gracefully.

Graphite selects the Vulkan CPU adapter (llvmpipe) and proceeds with initialization, which later fails with a wgpu validation error and eventually results in a panic and segmentation fault.

This makes it difficult for users to understand that their system does not meet the graphics requirements.

**Environment**

- OS: Fedora Linux 43 Workstation
- Architecture: x86_64
- Machine type: Physical machine
- Graphite build: Official AppImage (downloaded from Graphite Discord)
- Launch method: Running the AppImage directly in terminal (./Graphite.AppImage)

**Graphics setup**

_Integrated GPU: Intel 4 Series Chipset Integrated Graphics Controller_
- OpenGL 2.1 (Core / Compatibility)
- No Vulkan support

_Vulkan fallback:_
- Vulkan CPU (llvmpipe)
- Mesa version: 25.2.7 (LLVM 21.1.5)

No Vulkan-capable GPU is detected, so the CPU adapter is used by default.

**Steps to reproduce**

1. Run Graphite on a system where Vulkan only exposes a CPU adapter (llvmpipe)
2. Launch the official Graphite AppImage
3. Observe the crash during startup

**Actual behavior**

- Vulkan / EGL initialization fails
- wgpu reports a shader validation error
- The application panics and crashes with a segmentation fault

Relevant log excerpt:

wgpu error: Validation Error

Shader validation error:
Shader requires capability SHADER_FLOAT16_IN_FLOAT32

Adapter: Cpu (llvmpipe)

thread 'main' panicked at wgpu_core.rs:1058

**Expected behavior**

Graphite should detect early that the selected graphics adapter (llvmpipe / CPU Vulkan)
does not support required shader capabilities (e.g., float16),
and exit gracefully with a clear, user-facing error message.

_Example:_

"Your system does not support the required GPU features to run Graphite.
A compatible GPU with Vulkan support is required."

**Additional context**

- The system has an integrated Intel 4 Series GPU, which is too old to support Vulkan.
- As a result, Vulkan falls back to the llvmpipe CPU adapter.
- This report is not requesting support for this hardware, but highlights that Graphite currently crashes instead of clearly reporting unsupported GPU capabilities.

Planned future hardware: AMD Radeon RX 550, which should meet the required GPU capabilities.

**Full Log**

```
Available WGPU adapters:
[0] Vulkan Cpu (Name: llvmpipe (LLVM 21.1.5, 128 bits), Driver: llvmpipe, Device: 0)

Using WGPU adapter: AdapterInfo { name: "llvmpipe (LLVM 21.1.5, 128 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 25.2.7 (LLVM 21.1.5)", backend: Vulkan }
MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
[11709:11709:0101/121625.965188:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11709:11709:0101/121625.965390:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11709:11709:0101/121625.965460:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11709:11709:0101/121625.965542:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11709:11709:0101/121625.965603:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
[11709:11709:0101/121625.970990:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11709:11709:0101/121625.971172:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11709:11709:0101/121625.971242:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11709:11709:0101/121625.971317:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11709:11709:0101/121625.971452:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
[11709:11709:0101/121625.994385:ERROR:components/viz/service/main/viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
[11741:11741:0101/121626.397907:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11741:11741:0101/121626.398103:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11741:11741:0101/121626.398185:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11741:11741:0101/121626.398260:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11741:11741:0101/121626.398326:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
[11741:11741:0101/121626.408324:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11741:11741:0101/121626.408484:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11741:11741:0101/121626.408557:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11741:11741:0101/121626.408620:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11741:11741:0101/121626.408679:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
[11741:11741:0101/121626.410569:ERROR:components/viz/service/main/viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
2026-01-01T15:16:26.613085Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default

thread 'main' (11667) panicked at /nix/store/jyn2a0vyd3yy00mgdhkwgyq7skz2hd21-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/wgpu-27.0.1/src/backend/wgpu_core.rs:1058:30:
wgpu error: Validation Error

Caused by:
In Device::create_shader_module, label = 'vello.flatten'

Shader validation error: Function [33] 'draw_join' is invalid
┌─ vello.flatten:823:1

823 │ ╭ fn draw_join(
824 │ │ path_ix: u32, style_flags: u32, p0: vec2f,
825 │ │ tan_prev: vec2f, tan_next: vec2f,
826 │ │ n_prev: vec2f, n_next: vec2f,
· │
843 │ │ let miter_limit = unpack2x16float(style_flags & STYLE_MITER_LIMIT_MASK)[0];
│ │ ^^^^^^^^^^^^^^^ naga::ir::Expression [30]
· │
890 │ │ default: {}
891 │ │ }
│ ╰─────^ naga::ir::Function [33]

= Expression [30] is invalid
= Shader requires capability Capabilities(SHADER_FLOAT16_IN_FLOAT32)

Expression [30] is invalid
Shader requires capability Capabilities(SHADER_FLOAT16_IN_FLOAT32)

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
MESA-LOADER: failed to open dri: /run/opengl-driver/lib/gbm/dri_gbm.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/gbm, suffix _gbm)
[11764:11764:0101/121626.688974:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11764:11764:0101/121626.689505:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11764:11764:0101/121626.689683:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11764:11764:0101/121626.689921:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11764:11764:0101/121626.690012:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
[11764:11764:0100/000000.701494:ERROR:ui/gl/angle_platform_impl.cc:42] Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
ERR: Display.cpp:1093 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11764:11764:0100/000000.466466:ERROR:ui/gl/egl_util.cc:92] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, initialize:2276.
[11764:11764:0100/000000.466556:ERROR:ui/gl/gl_display.cc:639] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[11764:11764:0100/000000.466622:ERROR:ui/gl/gl_display.cc:674] Initialization of all EGL display types failed.
[11764:11764:0100/000000.466684:ERROR:ui/ozone/common/gl_ozone_egl.cc:26] GLDisplayEGL::Initialize failed.
Falha de segmentação (imagem do núcleo gravada) ./Graphite.AppImage
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Log xác định wgpu_core.rs:1058 và đường dẫn xác thực shader vello.flatten; trước tiên hãy theo dõi quá trình chọn adapter khi khởi động và khởi tạo device xung quanh các lỗi đó. Tái hiện với một CPU adapter chỉ dùng Vulkan, sau đó xác minh rằng các features bắt buộc không được hỗ trợ sẽ dẫn đến việc thoát với thông báo rõ ràng cho người dùng thay vì panic hoặc segmentation fault.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
computer-graphics, desktop-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.