Dear MNE community,
I’m trying to generate a report with 3D coregistration plots using mne.Report
on a headless Linux server (no display).
Today, I freshly reinstalled MNE Python including the offscreen rendering setup with:
conda install -c conda-forge "vtk>=9.2=*osmesa*" "mesalib=21.2.5"
The output of mne.sys_info()
includes:
- Platform: Linux-5.14.0-503.22.1.el9_5.x86_64-x86_64-with-glibc2.34
- Python: 3.11.6
- mne: 1.9.0
- pyvista: 0.45.0 (OpenGL 3.3 (Core Profile) Mesa 21.2.5 via softpipe)
- pyvistaqt: 0.11.2
- vtk: 9.2.6
- qtpy: 2.4.3
I attempt to add a coregistration plot like this:
report.add_trans(
trans=estim_trans,
info=raw.info,
title=f"Coregistration ({Tx}): {subject}",
subject=subject,
subjects_dir=fs_subjects_dir,
replace=True
)
However, this fails with the error:
RuntimeError: Cannot connect to a valid display
My goal
I want to add 3D plots to the report without using any GUI or X11 (e.g., using MESA + OSMesa).
Question
Is there a known working setup for e.g. report.add_trans() with offscreen rendering using MESA?
Thanks in advance for any suggestions!
All the best,
Till