Problem with mrview : segmentation fault

Hi!
I installed MRtrix3 yesterday but I have a problem with mrview.
If I open a file with mrview, it closed the gui window immediately and “segmentation fault (core dumped)” is standing in the terminal…
So, I try : run “mrview -debug” and it gives me:

mrview : [DEBUG] No config file found at "/ect/mrtrix.conf"
mrview : [DEBUG] No config file found at “.mrtrix.conf”

Thanks for your help.

chloe.

I’m not sure what the problem is, but we’ll definitely need a lot more information to understand what’s going on here…

First off, when you say ‘I open a file in mrview’, does this mean that you can launch mrview and get the window to display, and the problem occurs when you try to open the window via the file->open dialog? Or are you trying to open the image from the command-line directly?

Does mrview crash even if you don’t try to open an image?

Is the output of mrview -debug really as brief as what you show? On my system, this is what I get:

mrview: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrview: [INFO] reading config file "/home/jdt13/.mrtrix.conf"...
mrview: [DEBUG] reading key/value file "/home/jdt13/.mrtrix.conf"...
mrview: [INFO] GL renderer:  GeForce GTX 780/PCIe/SSE2
mrview: [INFO] GL version:   3.3.0 NVIDIA 375.26
mrview: [INFO] GL vendor:    NVIDIA Corporation
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: [DEBUG] compiling OpenGL fragment shader:
#version 330 core
in vec2 tex_coord;
uniform sampler2D sampler;
uniform float red, green, blue;
out vec4 color;
void main () {
  color.ra = texture (sampler, tex_coord).rg;
  color.rgb = color.r * vec3 (red, green, blue);
}

mrview: [DEBUG] font loaded

So if you don’t even get to the mrview: [INFO] GL renderer: line, this would strongly suggest a problem with your OpenGL setup. So work this out, the simplest is for you to post the contents of your release/config file - that typically contains all the information that we’d need to make a start…

Thank you for your response!

I have the problem with “mrview” both cases you said.
Does OpenGL setup mean NVIDIA driver setup?

my release/config file :

 #!/usr/bin/python

# autogenerated by MRtrix configure script**

# configure output:**

# MRtrix build type requested: release**

# Detecting OS: linux**
# Checking for C++11 compliant compiler [g++]: 4.8 - tested ok**
# Detecting pointer size: 64 bit**
# Detecting byte order: little-endian**
# Checking for variable-length array support: yes**
# Checking for non-POD variable-length array support: yes**
# Checking for zlib compression library: 1.2.10**
# Checking for Eigen 3 library: 3.2.8**
# Checking Eigen 3 memory alignment requirements: OK**
# Checking shared library generation: yes**
# Checking for Qt moc: moc (version 4.8.6)**
# Checking for Qt qmake: qmake (version 4.8.6)**
# Checking for Qt rcc: rcc (version 4.8.6)**
# Checking for Qt: 4.8.6**


PATH = r'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
obj_suffix = '.o'
exe_suffix = ''
lib_prefix = 'lib'
lib_suffix = '.so'
cpp = [ 'g++', '-c', 'CFLAGS', 'SRC', '-o', 'OBJECT' ]
cpp_flags = [ '-std=c++11', '-mno-avx', '-pthread', '-fPIC', '-march=native', '-DMRTRIX_WORD64', '-isystem', '/usr/local/include/eigen3', '-Wall', '-O2', '-DNDEBUG' ]
ld = [ 'g++', 'OBJECTS', 'LDFLAGS', '-o', 'EXECUTABLE' ]
ld_flags = [ '-pthread', '-lz' ]
runpath = '-Wl,-rpath,$ORIGIN/'
ld_enabled = True
ld_lib = [ 'g++', 'OBJECTS', 'LDLIB_FLAGS', '-o', 'LIB' ]
ld_lib_flags = [ '-pthread', '-shared', '-pthread', '-lz' ]
eigen_cflags = [ '-isystem', '/usr/local/include/eigen3' ]
moc = 'moc'
rcc = 'rcc'
qt_cflags = [ '-m64', '-pipe', '-O2', '-Wall', '-W', '-D_REENTRANT', '-DQT_NO_DEBUG', '-DQT_SVG_LIB', '-DQT_OPENGL_LIB', '-DQT_GUI_LIB', '-DQT_CORE_LIB', '-DQT_SHARED', '-isystem', '/usr/share/qt4/mkspecs/linux-g++-64', '-isystem', '/usr/include/qt4/QtCore', '-isystem', '/usr/include/qt4/QtGui', '-isystem', '/usr/include/qt4/QtOpenGL', '-isystem', '/usr/include/qt4/QtSvg', '-isystem', '/usr/include/qt4', '-isystem', '/usr/X11R6/include' ]
qt_ldflags = [ '-m64', '-Wl,-O1', '-L/usr/lib/x86_64-linux-gnu', '-L/usr/X11R6/lib64', '-lQtSvg', '-lQtOpenGL', '-lQtGui', '-lQtCore', '-lGL', '-lpthread' ]
nogui = False

I can’t see anything particularly wrong here, so yes, I’d suspect something isn’t quite right with your OpenGL setup. It’s difficult to really figure this out without looking into the internals of your system unfortunately. What troubles me is that I’d expect to at least see something like:

mrview: [WARNING] unable to determine OpenGL version - operation may be unstable if actual version is less than 3.3 

or

mrview: [ERROR] your OpenGL implementation is not sufficient to run MRView - need version 3.3 or higher
mrview: [ERROR] operation is likely to be unstable

as reported in many posts (search for ‘opengl’ on the forum), e.g. this post, this post, or this one. Unfortunately, each case can have different solutions…

So the first thing to rule out is that you’re not running within a virtual machine - that generally won’t work, although someone has recently reported success on VMWare.

Next is is to figure out exactly what your system is: what Linux distributions are you running (lsb_release -a or cat /etc/*-release), and what graphics card you’ve got (lspci | grep "VGA compatible controller"). Then figure out what drivers you’re running (I assume this is an NVIDIA card given your previous command), which depends on what Linux distribution you’re running.So I’ll wait to hear back from you first…

I used the VNC server. Does it cause the problem?

Yes, that would most likely be the problem. Running over VNC requires that all graphics rendering be performed on the remote server, and the resulting image is then sent over the network to the client. This means that the server needs to be equipped with a modern graphics card and have OpenGL 3.3 software drivers loaded. See 2. on this page for details. To get this working will require intervention from the remote server’s administrator, and potentially putting more hardware into the system (i.e. better graphics cards). This may be quite a lot to ask…

The solution I would advocate when you have limited ability to modify these things is to run MRView locally (this is what I do): install MRtrix3 on your local system, and access your data on the remote server using an appropriate networked filesystem, most likely one of:

  • Windows Shares (SMB/Samba)
  • NFS (if your client is running on MacOSX or Unix/Linux)
  • SSHFS (this should always be available, it only requires SSH access - but isn’t available on MacOSX or Windows by default, see here for details).

This does require that your data be made available for access on the remote system using one of these filesystems, but generally NFS & SSH will already be up and running. Hopefully one of these will allow you to get things running…

Sorry to bump an old topic, but seems better since I think is related.

I think I’m having a similar problem, I’m also trying to run over VNC and running into issues.

However, I am able to load up mrview without an image, its only when I load an image I get an error. So perhaps it is something different?

I can use mrinfo and mrstats.

Here’s my debug info

gdb --args /datasets/work/HB_ATLAS_WORK/src/mrtrix3/bin/mrview sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz -debug
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /datasets/work/HB_ATLAS_WORK/src/mrtrix3/bin/mrview...done.
(gdb) r
Starting program: /datasets/work/HB_ATLAS_WORK/src/mrtrix3/bin/mrview sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz -debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Xlib:  extension "XInputExtension" missing on display ":1.0".
mrview: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrview: [DEBUG] No config file found at "/home/gil2a4/.mrtrix.conf"
mrview: [INFO] opening image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz"...
mrview: [DEBUG] transforms_match: FOV difference in scanner coordinates: 0
mrview: [DEBUG] sanitising image information...
mrview: [INFO] Axes and transform of image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz" altered to approximate RAS coordinate system
mrview: [DEBUG] searching for suitable phase encoding data...
mrview: [INFO] image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz" opened with dimensions 289x289x203, voxel spacing 0.5x0.5x0.5, datatype Float64LE
mrview: [DEBUG] loading image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz"...
mrview: [INFO] mrview: uncompressing image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz"
mrview: [INFO] mrview: uncompressing image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz" [done]
mrview: [DEBUG] image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz" loaded
mrview: [DEBUG] image "sourcedata/sub-CC00069XX12/ses-26300/anat/sub-CC00069XX12_ses-26300_T1w.nii.gz" initialised with strides = [ -1 289 83521 ], start = 288, using indirect IO
/usr/include/c++/7/bits/unique_ptr.h:330: std::unique_ptr<_Tp, _Dp>::pointer std::unique_ptr<_Tp, _Dp>::operator->() const [with _Tp = MR::GUI::MRView::Mode::Base; _Dp = std::default_delete<MR::GUI::MRView::Mode::Base>; std::unique_ptr<_Tp, _Dp>::pointer = MR::GUI::MRView::Mode::Base*]: Assertion 'get() != pointer()' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.


/datasets/work/HB_ATLAS_WORK/src/mrtrix3/bin/mrview -version
Xlib:  extension "XInputExtension" missing on display ":1.0".
== mrview 3.0_RC3-159-gdfda38fd ==
64 bit debug version with asserts, nooptim, built Jun  7 2019, using Eigen 3.3.4
Author(s): J-Donald Tournier (jdtournier@gmail.com), Dave Raffelt (david.raffelt@florey.edu.au), Robert E. Smith (robert.smith@florey.edu.au), Rami Tabbara (rami.tabbara@florey.edu.au), Max Pietsch (maximilian.pietsch@kcl.ac.uk), Thijs Dhollander (thijs.dhollander@gmail.com)
Copyright (c) 2008-2018 the MRtrix3 contributors.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at http://mozilla.org/MPL/2.0/

MRtrix3 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

For more details, see http://www.mrtrix.org/

Hi Ashley,

While the failed assertion suggests that it may be feasible for us to look more closely at the issue, the inability to obtain a GDB backtrace really limits what we can do with this information. I think it might be related to the absence of the debugging version of libc?

Rob

Sorry, hadn’t spotted this. I’d normally expect to see some report in the debug output about the OpenGL rendering infrastructure, but I’m not seeing it in your case. I have a feeling the issue is that your VNC setup doesn’t support OpenGL 3.3 rendering. It seems to crash at a point that is probably consistent with that.

You mentioned you can start it without an image? What does the debug output look like when you do that? What does it report for the OpenGL backend? Also, if you can start it, can you then open an image from the UI, or does that also crash?

Thanks Rob, Donald,

I’ve ended up installing locally on Windows (didn’t work for me at first because I stubbornly refused to follow your great instructions and tried to use WSL instead of msys2).

I’m happy to help debug if you’d like, but I won’t be using mrview/VNC now. Actually, I suspect the error, on further looking through the user guide, may be that the remote VM may not have had OpenGL 3.3 capability.

Thanks!