Skip to content

fix(flatpak): NVIDIA Wayland Zink override in entrypoint (#713) - #7

Closed
aceRage wants to merge 1 commit into
mainfrom
cursor/fix-flatpak-nvidia-wayland-zink-6534
Closed

fix(flatpak): NVIDIA Wayland Zink override in entrypoint (#713)#7
aceRage wants to merge 1 commit into
mainfrom
cursor/fix-flatpak-nvidia-wayland-zink-6534

Conversation

@aceRage

@aceRage aceRage commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Description

Easy upstream port of Snapmaker/OrcaSlicer#713 (OPEN): fix blank Flatpak Prepare/Preview canvases on NVIDIA Wayland by mirroring the AppImage Zink policy in the Flatpak entrypoint.

The AppImage launcher in src/dev-utils/platform/unix/build_linux_image.sh.in already routes OpenGL through Mesa Zink for NVIDIA drivers newer than 555 under Wayland. That workaround was never applied to Flatpak. glxinfo / nvidia-smi are not available in the Flatpak runtime, so the entrypoint now derives the driver major from the mounted org.freedesktop.Platform.GL.nvidia-* extension in /.flatpak-info.

Zink env flags (same controls as the AppImage launcher):

  • ZINK_DISABLE_OVERRIDE=1 — skip the Mesa/Zink override even on affected NVIDIA Wayland sessions.
  • ZINK_FORCE_OVERRIDE=1 — force Mesa GLX/EGL + Zink on Wayland even when the parsed driver major is missing or ≤555.

Activation (NVIDIA Flatpak + Wayland only): if not disabled, and (ZINK_FORCE_OVERRIDE=1 or driver major >555), set __GLX_VENDOR_LIBRARY_NAME=mesa, __EGL_VENDOR_LIBRARY_FILENAMES to the Mesa EGL vendor JSON, MESA_LOADER_DRIVER_OVERRIDE=zink, and GALLIUM_DRIVER=zink. The existing WebKit DMA-BUF disable (WEBKIT_DISABLE_DMABUF_RENDERER=1) is kept for all NVIDIA Flatpak sessions.

Non-NVIDIA and X11 sessions are unchanged. This PR does not touch GLEW/GLAD. Snapmaker/OrcaSlicer#351 is a later Hard port that migrates GLEW → GLAD; once that lands, native NVIDIA GL works and this Zink workaround should become opt-in (ZINK_FORCE_OVERRIDE=1 only).

+23/−2 in scripts/flatpak/entrypoint only. Ultra binary path remains /app/bin/snapmaker-orca.

Screenshots/Recordings/Graphs

N/A — Flatpak launcher env policy only; no UI code changes.

Tests

  • ShellCheck 0.11.0 (-s sh) on scripts/flatpak/entrypoint: clean.
  • Local POSIX activation-condition tests: driver-major extraction (610 / 555 / 470), Wayland vs X11, threshold >555, ZINK_DISABLE_OVERRIDE=1 wins over force, ZINK_FORCE_OVERRIDE=1 on old/empty major, WebKit DMA-BUF retain, Ultra exec path preserved.
  • Cloud cannot smoke Flatpak NVIDIA Wayland. There is no Flatpak runtime, NVIDIA driver, or Wayland session in this environment. Hardware verification remains: install the Flatpak on NVIDIA Wayland (driver >555), confirm Prepare/Preview render, and confirm ZINK_DISABLE_OVERRIDE=1 / ZINK_FORCE_OVERRIDE=1 behave as documented. Upstream Fix blank Flatpak canvas on NVIDIA Wayland Snapmaker/OrcaSlicer#713 was reported working on CachyOS KDE Wayland + RTX 3090 / 4070S, driver 610.57.04.
Open in Web Open in Cursor 

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
@aceRage

aceRage commented Sep 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #8: its Flatpak entrypoint carries this rule (NVIDIA Wayland, driver newer than 555) behind ZINK_AUTO_NVIDIA=1, with the same ZINK_FORCE_OVERRIDE / ZINK_DISABLE_OVERRIDE switches, and native GL through GLAD as the default.

@aceRage aceRage closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants