Mousetrap says screen not DRI3 capable

I’m starting a new project using Mousetrap, and I ran these commands to install it:

pkg> add https://github.com/clemapfel/mousetrap_jll
pkg> add https://github.com/clemapfel/mousetrap.jl

I got output ending like this:

Precompiling project...
  ✓ OrderedCollections
  ✓ DocStringExtensions
  78 dependencies successfully precompiled in 32 seconds. 101 already precompiled.
  2 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions. Otherwise, loading dependents of these packages may trigger further precompilation to work with the unexpected versions.
  1 dependency had output during precompilation:
┌ Mousetrap
│  libEGL warning: DRI3: Screen seems not DRI3 capable
│  libEGL warning: DRI2: failed to authenticate
│  libEGL warning: DRI3: Screen seems not DRI3 capable
│  
│  (process:1549663): Gtk-WARNING **: 04:28:19.247: Unknown key gtk-modules in /home/phma/.config/gtk-4.0/settings.ini
│  
│  (process:1549663): mousetrap-WARNING **: 04:28:19.288: In glewInit: Unable to initialize glew (4) Need GLX Display for GLX support
│  
│  (process:1549663): mousetrap-CRITICAL **: 04:28:19.288: In initialize_opengl: Unable to create global OpenGL context, disabling the `RenderArea` widget
└  

Will this be any problem? I’m running Julia over a local ssh connection.

You can try (both or either, please confirm if either works):

export LIBGL_ALWAYS_INDIRECT=1
export GDK_BACKEND=x11

I’m assuming you’re on Linux (not Windows WSL, I found info relating to it, I guess the solution there would be the same).

It’s supported for Julia itself, but note it’s unclear if supported by Mousetrap.jl because of its dependencies (see possible solution below from AI). It uses GTK, which should be ok, except when it depends on OpenGL.

If you must SSH (e.g. you’re helping someone remotely):

  1. Ensure X11 forwarding is enabled:
    On the client (your side):
ssh -Y user@host
  • Then on the remote machine:
export LIBGL_ALWAYS_INDIRECT=1
export GDK_BACKEND=x11
  • Now try:
using Mousetrap

You might get some GUI rendering via software rendering, but it will likely be slow and incomplete (many OpenGL features aren’t fully emulated).

:warning: GLEW or GTK4 may still fail — they often refuse to run without a proper GLX or EGL context.

ChatGPT is often rather good with just pasting in errors (I only posted limited at first, then more context later, which likely would have been even better to start with):

As I suspected DRI isn’t really about Mousetrap (nor Julia), as opposed to dependencies. It should always be possible to precompile in Julia, but it’s really out of Julia’s hands here, since such compilation can run arbitrary code, and Mousetrap shouldn’t really be running it. I mean I believe it can be fixed to make the precompilation work, but maybe this is for the best if ssh isn’t supported with it, either you would think you would have an ok precmpilation, and it would just fail later at runtime.

I’ve never used Mousetrap before. Is using Mousetrap or pkg> test Mousetrap (which passed) supposed to show a window? How can I get a window by typing in the REPL?

export GDK_BACKEND=x11 by itself did not seem to reduce the number of warnings. Both exports together did.