Skip to content

Snap: launcher script overrides __EGL_VENDOR_LIBRARY_DIRS, excluding host NVIDIA EGL vendor ICD #10760

Closed

Description

@mitchellh

Discussed in #10600

Originally posted by Marrocco-Simone February 6, 2026

Issue Description

The snap's launcher script (bin/launcher, source: snap/local/launcher) sets __EGL_VENDOR_LIBRARY_DIRS to only the snap-internal path, which excludes the host system's NVIDIA EGL vendor JSON. This prevents EGL from discovering NVIDIA's proprietary EGL driver, causing initialization to fall through to Mesa's Zink (OpenGL-over-Vulkan), which also fails.

The problematic line in snap/local/launcher (line 37):

export __EGL_VENDOR_LIBRARY_DIRS=${__EGL_VENDOR_LIBRARY_DIRS:+$__EGL_VENDOR_LIBRARY_DIRS:}${SNAP}/usr/share/glvnd/egl_vendor.d

Per the libglvnd ICD enumeration documentation, when __EGL_VENDOR_LIBRARY_DIRS is not set (the default case), libglvnd searches the default system paths: /etc/glvnd/egl_vendor.d and /usr/share/glvnd/egl_vendor.d. When it is set, it completely overrides those defaults — only the specified directories are scanned.

The snap-internal EGL vendor directory (${SNAP}/usr/share/glvnd/egl_vendor.d) only contains 50_mesa.json. The host system's 10_nvidia.json (at /usr/share/glvnd/egl_vendor.d/10_nvidia.json) is never discovered:

# Snap-internal (only this is searched):
/snap/ghostty/current/usr/share/glvnd/egl_vendor.d/50_mesa.json → libEGL_mesa.so.0

# Host system (never searched due to override):
/usr/share/glvnd/egl_vendor.d/10_nvidia.json → libEGL_nvidia.so.0
/usr/share/glvnd/egl_vendor.d/50_mesa.json → libEGL_mesa.so.0

Mesa's EGL cannot talk to NVIDIA's proprietary DRI, so it falls back to Zink (OpenGL-over-Vulkan), which also fails with VK_ERROR_INCOMPATIBLE_DRIVER.

Workaround — explicitly point EGL to the host NVIDIA ICD:

__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json ghostty

Suggested fix — include the host system's EGL vendor directories in snap/local/launcher:

export __EGL_VENDOR_LIBRARY_DIRS=${__EGL_VENDOR_LIBRARY_DIRS:+$__EGL_VENDOR_LIBRARY_DIRS:}/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d:${SNAP}/usr/share/glvnd/egl_vendor.d

Since Ghostty uses classic confinement, the host filesystem is fully accessible and this is safe.

This issue appeared after a kernel update (6.14 → 6.17), likely because the kernel change broke Mesa's Zink/Vulkan fallback path that was previously masking the missing NVIDIA EGL ICD.

Related discussions (same symptoms, but the launcher root cause was not identified):

Expected Behavior

Ghostty launches normally with hardware-accelerated OpenGL rendering via NVIDIA's EGL driver, as it does when the host EGL vendor config is accessible:

info(opengl): loaded OpenGL 4.5

Actual Behavior

EGL initialization fails because only Mesa's EGL ICD is discovered. Mesa cannot use NVIDIA's proprietary DRI and its Zink fallback also fails:

libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)

Ghostty either hangs with a blank window or falls back to degraded software rendering.

Reproduction Steps

  1. Install Ghostty from snap on a system with NVIDIA proprietary drivers
  2. Verify the host system has /usr/share/glvnd/egl_vendor.d/10_nvidia.json (it should if NVIDIA drivers are installed)
  3. Launch Ghostty: ghostty
  4. Observe the EGL/Zink errors
  5. Confirm the fix by launching with: __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json ghostty

Ghostty Logs

**Without workaround** (fails):


info: ghostty version=1.2.3
info: ghostty build optimize=ReleaseFast
info: runtime=apprt.Runtime.gtk
info: font_backend=font.main.Backend.fontconfig_freetype
info: dependency harfbuzz=11.0.0
info: dependency fontconfig=21402
info: renderer=renderer.generic.Renderer(renderer.OpenGL)
info: libxev default backend=io_uring
info(os_locale): setlocale from env result=C.UTF-8
info(gtk): GTK version build=4.14.5 runtime=4.14.5
info(gtk): libadwaita version build=1.5.0 runtime=1.5.0
info: reading configuration file path=/home/marrocco/.config/ghostty/config
info(config): default shell src=passwd value=/bin/bash
info(config): default working directory src=passwd value=/home/marrocco
warning(gtk_ghostty_application): setting GDK_DEBUG=gl-disable-gles,gl-no-fractional,vulkan-disable
warning(gtk_ghostty_application): setting GDK_DISABLE=color-mgmt
libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)

With workaround (succeeds — note loaded OpenGL 4.5):

info: ghostty version=1.2.3
info: ghostty build optimize=ReleaseFast
info: runtime=apprt.Runtime.gtk
info: font_backend=font.main.Backend.fontconfig_freetype
info: dependency harfbuzz=11.0.0
info: dependency fontconfig=21402
info: renderer=renderer.generic.Renderer(renderer.OpenGL)
info: libxev default backend=io_uring
info(os_locale): setlocale from env result=C.UTF-8
info(gtk): GTK version build=4.14.5 runtime=4.14.5
info(gtk): libadwaita version build=1.5.0 runtime=1.5.0
info: reading configuration file path=/home/marrocco/.config/ghostty/config
info(config): default shell src=passwd value=/bin/bash
info(config): default working directory src=passwd value=/home/marrocco
warning(gtk_ghostty_application): setting GDK_DEBUG=gl-disable-gles,gl-no-fractional,vulkan-disable
warning(gtk_ghostty_application): setting GDK_DISABLE=color-mgmt
glx: failed to create dri3 screen
failed to load driver: nouveau
info(opengl): loaded OpenGL 4.5


### Ghostty Version

```text
Ghostty 1.2.3

Version
  - version: 1.2.3
  - channel: stable
Build Config
  - Zig version   : 0.14.0
  - build mode    : builtin.OptimizeMode.ReleaseFast
  - app runtime   : apprt.Runtime.gtk
  - font engine   : font.main.Backend.fontconfig_freetype
  - renderer      : renderer.generic.Renderer(renderer.OpenGL)
  - libxev        : io_uring
  - kernel version: 6.17.0-14-generic
  - desktop env   : other
  - GTK version   :
    build         : 4.14.5
    runtime       : 4.14.5
  - libadwaita    : enabled
    build         : 1.5.0
    runtime       : 1.5.0
  - libX11        : enabled
  - libwayland    : enabled

OS Version Information

Ubuntu 24.04.3 LTS (Noble Numbat)

(Linux only) Display Server

X11

(Linux only) Desktop Environment/Window Manager

GNOME Shell 46.0

Minimal Ghostty Configuration

font-size = 10

Additional Relevant Configuration

GPU: NVIDIA GeForce RTX 3070 (GA104, rev a1)
Driver: NVIDIA 580.126.09 (proprietary)
Kernel: 6.17.0-14-generic (previously 6.14.x where this worked)
Vulkan: Working — vulkaninfo reports Vulkan Instance Version 1.3.275
GLX: Working — glxinfo confirms direct rendering via NVIDIA

Snap launcher script (/snap/ghostty/current/bin/launcher), the relevant section:

export LD_LIBRARY_PATH=${SNAP}/usr/lib/${ARCH}:${SNAP}/usr/lib/${ARCH}/vdpau:${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}
export LIBGL_DRIVERS_PATH=${LIBGL_DRIVERS_PATH:+$LIBGL_DRIVERS_PATH:}${SNAP}/usr/lib/${ARCH}/dri/
export LIBVA_DRIVERS_PATH=${LIBVA_DRIVERS_PATH:+$LIBVA_DRIVERS_PATH:}${SNAP}/usr/lib/${ARCH}/dri/
export __EGL_VENDOR_LIBRARY_DIRS=${__EGL_VENDOR_LIBRARY_DIRS:+$__EGL_VENDOR_LIBRARY_DIRS:}${SNAP}/usr/share/glvnd/egl_vendor.d

Snap-internal EGL vendor directory contains only Mesa:

/snap/ghostty/current/usr/share/glvnd/egl_vendor.d/50_mesa.json → {"library_path": "libEGL_mesa.so.0"}

Host system EGL vendor directory contains both NVIDIA and Mesa:

/usr/share/glvnd/egl_vendor.d/10_nvidia.json → {"library_path": "libEGL_nvidia.so.0"}
/usr/share/glvnd/egl_vendor.d/50_mesa.json  → {"library_path": "libEGL_mesa.so.0"}

I acknowledge that:

  • I have reviewed the FAQ and confirm that my issue is NOT among them.
  • I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
  • I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (```) on separate lines.

Activity

  1. added theissue type on Feb 16, 2026
  2. taisph commented on Feb 20, 2026

    @taisph

    FWIW: I am seeing this too now on two different desktops. However, I didn't notice it until running ghostty directly today. My x-terminal-emulator points to /snap/ghostty/current/bin/ghostty which works fine (I did that a year ago for reasons I don't remember.) Running /snap/bin/ghostty hangs with the VK error mentioned above.

  3. code-disaster commented on Mar 6, 2026

    @code-disaster

    I can confirm on Kubuntu 24.04/KDE/X11 on a GTX 1070 with Ghostty v1.2.3 installed via snap. The posted workaround does the job for me.

  4. added this to the 1.3.0 milestone on Mar 7, 2026
  5. added a commit that references this issue on Mar 7, 2026
    472b926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions