Hello,
I’ve been trying to create a portable build of Mrtrix3 for use on our HPC cluster, but I’m running into OpenGL issues. I built Mrtrix on a virtual machine (Centos 7.2, gcc 8.3, qt 5.9.2, mesa 18.0.5) and then used a package_mrtrix type approach to bundle mrtrix with the qt plugins and dependent libraries (with the exception of libGL and libfontconfig). After I deployed mrtirx to the cluster machines, I also used patchelf to modify rpath and interpreter settings within the libraries and binaries.
As far as I can tell, the non-gui functions work as expected on all the OS images we support. On our newest OS image (Centos 7.2, no GPU hardware or drivers, mesa 18.0.5, TurboVNC 1.2.2), however, attempting to run mrview in a VNC session gives:
[me@machine]$ mrview -debug
(mrview:101557): Gtk-WARNING **: 17:23:00.259: Theme parsing error: other-applications.css:310:8: Missing name of pseudo-class
(mrview:101557): Gtk-WARNING **: 17:23:00.260: Theme parsing error: other-applications.css:381:50: Missing name of pseudo-class
mrview: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrview: [DEBUG] No config file found at "/home/me01/.mrtrix.conf"
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
mrview: [INFO] GL renderer: llvmpipe (LLVM 6.0, 256 bits)
mrview: [INFO] GL version: 2.1 Mesa 18.0.5
mrview: [INFO] GL vendor: VMware, Inc.
mrview: [WARNING] unable to determine OpenGL version - operation may be unstable if actual version is less than 3.3
mrview: [DEBUG] loading font into OpenGL texture...
mrview: [DEBUG] compiling OpenGL vertex shader:
#version 330 core
layout(location = 0) in vec2 pos;
layout(location = 1) in vec2 font_pos;
uniform float scale_x;
uniform float scale_y;
out vec2 tex_coord;
void main () {
gl_Position = vec4 (pos[0]*scale_x-1.0, pos[1]*scale_y-1.0, 0.0, 1.0);
tex_coord = font_pos;
}
mrview: [ERROR] GLSL log [vertex shader]: 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
mrview: [ERROR] error compiling OpenGL vertex shader ID 1
mrview: [SYSTEM FATAL CODE: SIGSEGV (11)] Segmentation fault: Invalid memory access
The version related error messages disappear if I set the various MESA_*_VERSION_OVERRIDE environment variables to 3.3 or 330, but mrview comes to a pretty hard stop:
mrview: xcb_out.c:486: _xcb_out_flush_to: Assertion `((int64_t) ((c->out.request_written) - (request)) >= 0)' failed.
Abort (core dumped)
Within the same VNC session, glxgears does work, and glxinfo gives:
[me@machine]$ glxinfo | grep -i opengl
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 256 bits)
OpenGL version string: 2.1 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
The same build of mrview seems to work nicely with VirtualGL on one of our other images (Ubuntu 16.04, NVIDIA GPUs, Nvidia driver version 390.30, mesa version 17.2.8, TurboVNC v2.1), but not on a third image (Scientific Linux 6.5, NVIDIA GPUs, Nvidia driver version 340.65, mesa 10.1.2, TurboVNC v1.2.2).
I was wondering whether anyone could offer any advice on getting software rendering to work? As I understand it, Mesa 18.0.5 should support OpenGL 3.3, but could there be some specific limitation in the version of swrast_dri.so we’re using?
Thanks very much for reading, any advice would be much appreciated.