Skip to content

feat: Ubuntu 26.04 support — install script + Wayland/napari rendering + desktop launcher fixes#568

Open
hongquanli wants to merge 5 commits into
masterfrom
feat/setup-26.04
Open

feat: Ubuntu 26.04 support — install script + Wayland/napari rendering + desktop launcher fixes#568
hongquanli wants to merge 5 commits into
masterfrom
feat/setup-26.04

Conversation

@hongquanli

@hongquanli hongquanli commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes Squid run on Ubuntu 26.04 LTS (system Python 3.14, GNOME/Mutter Wayland). Three parts:

  1. software/setup_26.04.sh — install script adapted from setup_22.04.sh.
  2. Wayland/napari rendering fix (main_hcs.py, control/gui_hcs.py) — stops the GUI going black on acquisition.
  3. Desktop launcher fix (setup_26.04.sh) — the shortcut now uses ptyxis instead of the removed gnome-terminal.

1. Install script (setup_26.04.sh)

Ubuntu 26.04 ships Python 3.14, which breaks the 22.04 script two ways: PEP 668 (externally-managed system pip) and pinned deps with no 3.14 wheels.

  • pip3 install --break-system-packages — system Python 3.14 is externally-managed (PEP 668). Non-sudo install keeps packages in the user site, leaving apt-managed packages intact.
  • numpy<2numpy — NumPy 1.x has no Python 3.14 wheels (1.26 caps at 3.12).
  • napari==0.5.4napari — the old pin predates 3.14 (this now resolves to napari 0.7.1; see the rendering fix below).
  • Dropped aicsimageio + basicpy — only imported by control/stitcher.py, which nothing loads (active stitcher is the ImageJ-based tools/stitcher.py). These were the main 3.14 blocker.
  • Qt stays via apt (python3-pyqt5*, python3-pyqtgraph) — apt packages aren't subject to PEP 668.
  • Removed the 22.04-only pip-upgrade step.

Version-agnostic steps (Daheng/Toupcam drivers, udev rules, dialout group, kernel-hold, desktop shortcut) are unchanged.

2. Wayland/napari black-screen fix

On a Wayland session, napari 0.7.1's napari/_wayland_fix.py runs on import and forces QT_QPA_PLATFORM=xcb + PYOPENGL_PLATFORM=glx on Nvidia hardware, assuming XWayland+GLX is more stable. On recent hardware/drivers (tested: RTX 5070 Ti Blackwell + driver 595 + Mutter) it's backwards:

  • xcb → napari's vispy GL surface renders black the moment acquisition switches to a napari tab.
  • glx → PyOpenGL context tracking fails (Attempt to retrieve context when no valid context), so image layers never draw.

Live View is unaffected because it uses pyqtgraph (raster), which is why only acquisition went black.

Fix: napari applies those defaults with os.environ.setdefault, so presetting both QT_QPA_PLATFORM=wayland and PYOPENGL_PLATFORM=egl before napari is imported neutralizes the workaround and keeps the proven-good native Wayland + EGL path. Guarded to Linux Wayland sessions and respects explicit overrides → no-op on X11/macOS/Windows. Because it lives in main_hcs.py/gui_hcs.py, it applies on pull without re-running setup.

3. Desktop launcher fix

Ubuntu 26.04 dropped gnome-terminal (default terminal is now ptyxis) and removed the -e "cmd" syntax, so the generated .desktop did nothing when double-clicked. Now uses ptyxis --new-window --working-directory=… -- … with Terminal=false.

Testing

Runtime-tested on Ubuntu 26.04 (Python 3.14, Mutter Wayland, RTX 5070 Ti Blackwell + Intel, driver 595):

  • Acquisition renders in the napari mosaic/multichannel view with no black window and no OpenGL context errors (verified end-to-end reproducing the embedded-napari tab-switch + repaint path: 0 errors).
  • Desktop launcher opens a ptyxis window and starts the GUI.

⚠️ A clean end-to-end run of setup_26.04.sh on a fresh 26.04 box still recommended to confirm apt package availability and full pip resolution.

🤖 Generated with Claude Code

hongquanli and others added 3 commits June 30, 2026 10:37
Add setup_26.04.sh, adapted from setup_22.04.sh for Ubuntu 26.04 LTS,
which ships Python 3.14 as the system interpreter. That breaks the 22.04
script in two ways, addressed here:

- pip3 install --break-system-packages: system Python is externally
  managed (PEP 668), so plain pip3 install is rejected. Non-sudo install
  keeps packages in the user site, leaving apt-managed packages intact.
- numpy<2 -> numpy (2.x): NumPy 1.x has no Python 3.14 wheels.
- napari==0.5.4 -> napari: the old pin predates 3.14.
- Drop aicsimageio and basicpy: only imported by the orphaned
  control/stitcher.py (nothing loads it; the active stitcher is the
  ImageJ-based tools/stitcher.py). These were the main 3.14 blocker.

Qt stays installed via apt (not subject to PEP 668). All version-agnostic
steps (camera drivers, udev rules, dialout, kernel hold, desktop shortcut)
are unchanged from the 22.04 script. Not yet runtime-tested on 26.04.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t black (#568)

On a Linux Wayland session, napari 0.7.1's napari/_wayland_fix.py forces
QT_QPA_PLATFORM=xcb and PYOPENGL_PLATFORM=glx on Nvidia hardware, assuming
XWayland+GLX is more stable. On recent hardware/drivers (e.g. RTX 5070 Ti
Blackwell + Mutter, Ubuntu 26.04 / Python 3.14) this is backwards: XWayland
renders napari's vispy GL surface black, and GLX context tracking fails with
"Attempt to retrieve context when no valid context", so acquisition image
layers never draw. Live View is unaffected because it uses pyqtgraph (raster).

napari applies its defaults with os.environ.setdefault, so presetting both
QT_QPA_PLATFORM=wayland and PYOPENGL_PLATFORM=egl before napari is imported
neutralizes the workaround and keeps the proven-good native Wayland + EGL
combination. Guarded to Linux Wayland sessions and respects explicit overrides,
so it is a no-op on X11/macOS/Windows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…minal

Ubuntu 26.04 ships ptyxis as the default terminal; gnome-terminal is not
installed and its `-e` command syntax was removed, so the generated launcher
did nothing when double-clicked. Use `ptyxis --new-window --working-directory
... -- <cmd>` and set Terminal=false since we invoke the terminal explicitly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hongquanli hongquanli changed the title feat: Add Ubuntu 26.04 installation script feat: Ubuntu 26.04 support — install script + Wayland/napari rendering + desktop launcher fixes Jul 2, 2026
cephlainc and others added 2 commits July 2, 2026 16:02
…thout a drag

On a native Wayland session the whole UI stalls until the window is moved, but
only on the first acquisition: the top-level surface stops receiving frame
callbacks while the first napari (vispy/OpenGL) canvas is realized. When the
napari display is first activated, generate a one-time window configure event
(maximized: brief state toggle with geometry pinned; otherwise a 1px resize
nudge) to restart frame callbacks. Guarded to Wayland; no-op elsewhere.

Known limitation: on a maximized window a brief resize flicker is still visible;
the un-stall itself works. Fully hiding the flicker is unresolved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_do_wayland_surface_kick pinned the normal geometry to the maximized
size via setGeometry() to hide the restore flash, but that overwrites
the window's stored restore geometry. After the first-acquisition kick
the maximize/restore toggle no longer changed anything and the window
was stuck at full size. Toggle the window state without touching
geometry (Qt preserves the real restore geometry across showNormal/
showMaximized), and handle fullscreen separately so a fullscreen window
isn't downgraded to maximized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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