SUMA display not working on Mac via xquartz

Hi, I've been using suma for years, mainly just for displaying inflated brain maps, but it's not working anymore. I connect via
XQuartz 2.8.5 (xorg-server 21.1.6)
using the terminal command ssh -Y

Afni itself still works OK.
versions:
afni -ver
Precompiled binary linux_ubuntu_16_64: Sep 1 2020 (Version AFNI_20.2.16 'Aulus Vitellius')

suma -version

Compile Date:
Sep 1 2020

MacOS: 13.6.1 (22G313)
It's an Intel Mac.

I tried the solution found on this page but it didn't work:

When I try to start suma, a window appears for a split second and then it crashes and disappears.

I've got more troubleshooting to do, but I figured I'd post here to see if anyone has encountered this and already has a solution. I'll paste in the error message that I get below.

Thanks all!
Jed

Here's the error message I get:
suma:
No input specified, loading some toy surfaces...
Use '.' and ',' to cycle between them.
See suma -help for assistance.

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
oo Warning SUMA_XErrHandler (SUMA_display.c:4149):
Intercepted X11 error: BadMatch (invalid parameter attributes)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4150 @14:54:43):
Trace At Xerr
SUMA_XErrHandler
SUMA_glXMakeCurrent
SUMA_graphicsInit
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
-- Error SUMA_glXMakeCurrent (SUMA_display.c:343):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
-- Error SUMA_glXMakeCurrent (SUMA_display.c:345):
Called from SUMA_glXMakeCurrent
SUMA_glXMakeCurrent
SUMA_graphicsInit
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
Error SUMA_graphicsInit: Failed in SUMA_glXMakeCurrent.
Continuing ...
oo Warning SUMA_XErrHandler (SUMA_display.c:4149):
Intercepted X11 error: BadValue (integer parameter out of range for operation)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4150 @14:54:43):
Trace At Xerr
SUMA_XErrHandler
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
SUMA_Engine: Starting to listen ...
oo Warning SUMA_XErrHandler (SUMA_display.c:4149):
Intercepted X11 error: BadMatch (invalid parameter attributes)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4150 @14:54:43):
Trace At Xerr
SUMA_XErrHandler
SUMA_glXMakeCurrent
SUMA_handleRedisplay
suma
Bottom of Debug Stack
-- Error SUMA_glXMakeCurrent (SUMA_display.c:343):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
-- Error SUMA_glXMakeCurrent (SUMA_display.c:345):
Called from SUMA_glXMakeCurrent
SUMA_glXMakeCurrent
SUMA_handleRedisplay
suma
Bottom of Debug Stack
-- Error SUMA_handleRedisplay (SUMA_display.c:430):
Failed in SUMA_glXMakeCurrent.

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
suma: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Fatal Signal 6 (SIGABRT) received
suma
Bottom of Debug Stack
** AFNI version = AFNI_20.2.16 Compile date = Sep 1 2020
** [[Precompiled binary linux_ubuntu_16_64: Sep 1 2020]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /home/jed/.afni.crashlog

AFNI version info (afni -ver):

code text  # or delete if not needed

Can you update your AFNI installation on the server? That might help some things.

Thanks, I just tried that. Still the same problem though.

suma:
No input specified, loading some toy surfaces...
Use '.' and ',' to cycle between them.
See suma -help for assistance.

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
oo Warning SUMA_XErrHandler (SUMA_display.c:4191):
Intercepted X11 error: BadMatch (invalid parameter attributes)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4192 @15:45:08):
Trace At Xerr
SUMA_XErrHandler
SUMA_glXMakeCurrent
SUMA_graphicsInit
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
-- Error SUMA_glXMakeCurrent (SUMA_display.c:345):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
-- Error SUMA_glXMakeCurrent (SUMA_display.c:347):
Called from SUMA_glXMakeCurrent
SUMA_glXMakeCurrent
SUMA_graphicsInit
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
Error SUMA_graphicsInit: Failed in SUMA_glXMakeCurrent.
Continuing ...
oo Warning SUMA_XErrHandler (SUMA_display.c:4191):
Intercepted X11 error: BadValue (integer parameter out of range for operation)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4192 @15:45:08):
Trace At Xerr
SUMA_XErrHandler
SUMA_X_SurfaceViewer_Create
suma
Bottom of Debug Stack
SUMA_Engine: Starting to listen ...
oo Warning SUMA_XErrHandler (SUMA_display.c:4191):
Intercepted X11 error: BadMatch (invalid parameter attributes)
Will attempt to proceed but trouble might ensue.
++ Notice SUMA_XErrHandler (SUMA_display.c:4192 @15:45:08):
Trace At Xerr
SUMA_XErrHandler
SUMA_glXMakeCurrent
SUMA_handleRedisplay
suma
Bottom of Debug Stack
-- Error SUMA_glXMakeCurrent (SUMA_display.c:345):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
-- Error SUMA_glXMakeCurrent (SUMA_display.c:347):
Called from SUMA_glXMakeCurrent
SUMA_glXMakeCurrent
SUMA_handleRedisplay
suma
Bottom of Debug Stack
-- Error SUMA_handleRedisplay (SUMA_display.c:432):
Failed in SUMA_glXMakeCurrent.

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
suma: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Fatal Signal 6 (SIGABRT) received
suma
Bottom of Debug Stack
** AFNI version = AFNI_24.0.02 Compile date = Jan 25 2024
** [[Precompiled binary linux_ubuntu_16_64: Jan 25 2024]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /home/jed/.afni.crashlog
(64)jed@magneto-vm4 :

I should add - the problem does seem to be specific to connecting through X11 via my Mac.
I tried it from a Windows PC in the lab (through MobaXterm) and it worked OK.

Was worth the try!

I stopped trying to forward the X-session a few years ago because the speed was slow and instead opted to do things on a VNC session. Testing now on our systems, I also run into errors getting OpenGL to forward via XQuartz.

The other solution that I quite like is mounting the network file system using either SMB or FUSE and running AFNI/SUMA locally on the Mac.

I'll see if @rickr or @dglen have any other ideas.

Thanks for your help. I'm not as used to VNC but I have used it in the past and I did try it here. Same situation - AFNI works but not SUMA. The error message I get on VNC is

well, turns out I also need to troubleshoot copy and paste from VNC - that's not working for me either.
The error message is much briefer but some of the key points are, error-prone retyping:

trying lame single buffer visual
Notice SUMA_XtWarn_handler (SUMA_display.c.4158 @16:53:06:
X11 Warning 1: trying lame single buffer visual
Have 1 X11 warnings so far, see Help-->Message Log if curious.
This notice is shown once for each additional 10 warnings.
Error: no good visual

I would like to check out the Message Log but I wasn't sure how to do that.

it is possible that the server you are logging into does not have any 3D rendering library installed. What is the output from:

glxinfo | head
  • rick

Sounds like you may be on to something.
I've tried two servers, they both give error messages for that command

)jed@magneto-vm4 : glxinfo | head
libGL error: No matching fbConfigs or visuals found
name of display: localhost:13.0
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 26
Current serial number in output stream: 27

jmeltzer@vm-MELGS1 ~]$ glxinfo | head
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
name of display: localhost:14.0
X Error of failed request: GLXBadContext
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 31
Current serial number in output stream: 30

I would note that SUMA is still working OK when the server is accessed through a Windows PC, and in fact even through the Byzantine method that IT makes my students use:
User Mac -> Remote Desktop to PC in lab -> Server

So it seems that the direct
User Mac -> Linux server
method is where we're having the problems.

Hmmm, that is messier. Try setting the environment variable LIBGL_ALWAYS_INDIRECT to 1 (before running suma). That only works in some scenarios though.

  • rick

Hi Jed,

In the past, we would say "don't do that." Remote OpenGL is messy and is prone to problems. The remote desktop solution or the remote data drive solution with local desktop work better. I prefer the local desktop for OpenGL, but you can get okay performance sometimes with something like NoMachine, which is what is enabled on NIH's Biowulf cluster.

You could try another OpenGL environment variable, at least for testing. LIBGL_ALWAYS_SOFTWARE set to "true" will be tediously slow but often works if mesa drivers are installed.

It may be related to this issue
OpenGL requiring software doesn't work on Ventura · Issue #365 · XQuartz/XQuartz · GitHub

I'm not a MAC person, so can't comment on their solution. I will say that we use TurboVNC combined with VirtualGL | Main / VirtualGL with good success.