Mrview error

Dear Experts,
Apologies if it is repeated.I´m a novice with linux and I could only partially comprehend the ¨troubleshoot¨.
Mrview throws the following error:

libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
mrview: [WARNING] unable to determine OpenGL version - operation may be unstable if actual version is less than 3.3
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
Segmentation fault (core dumped)

I’m using a CentOS 6.8 system.
Graphics information (After running¨lspci¨ command)

04:00.0 VGA compatible controller: NVIDIA Corporation GF108GL [Quadro 600] (rev a1)

A google search mentioned that it supports API upto OpenGL4.4


¨glxinfo | grep OpenGL¨ command yielded the following output:

libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 256 bits)
OpenGL version string: 2.1 Mesa 11.0.7
OpenGL shading language version string: 1.30
OpenGL extensions:

Thanks in advance for the help

Yes, getting OpenGL to work properly on Linux can be a bit complicated… So first off, you need to know that for NVIDIA cards on Linux, there are two main drivers available: the open-source version (the nouveau driver, part of the mesa project), or the closed-source proprietary drivers provided by NVIDIA directly. Installing them can be a bit of a challenge, although things are a lot easier nowadays than they used to be.

In your case, I see you’re running the open-source nouveau drivers, provided as part of mesa version 11.0.7. That version of mesa should allow you to run OpenGL 3.3 applications - this wasn’t the case until quite recently, the earliest version that worked properly was probably 10.6 or so. However, the driver fails to load correctly, given your error message:

libGL error: unable to load driver: nouveau_dri.so

This refers explicitly to the nouveau kernel module, a piece of code that needs to be loaded into the kernel of the operating system to provide the correct interface to the hardware for the actual driver software to interact with. There are a variety of reasons why this might happen, but here’s couple of common ones:

  • you have recently upgraded your system, including updates to critical parts of the system (e.g. the kernel), but not yet rebooted. This may cause issues as the version of nouveau kernel module that the system is trying to load no longer matches the version of the running kernel exactly - and the system is very strict about ensuring an exact match. This would be easily fixed by a reboot.

  • you are missing some critical packages required for full 3D acceleration with the nouveau drivers. This would depend on exactly how CentOS manages these things, which packages it provides, and which are actually necessary for OpenGL support. I don’t use CentOS, but I would guess at a minimum, you’d need mesa-libGL and mesa-libGL-devel, and maybe also mesa-dri-drivers (although the later would probably be installed as a dependency of the others).

  • you might have tried to install the NVIDIA proprietary drivers without disabling the nouveau drivers, which causes a conflict. Properly disabling nouveau is not as trivial as it sounds unfortunately, since it is often included in the set of kernel modules preloaded at boot-time, via initramfs. On some distributions, the nouveau driver needs to be blacklisted and purged from the initramfs before being properly disabled. The exact procedure for this will however be very distribution specific, and probably vary from version to version - you’ll need to search for the right instructions for your system to get the proprietary drivers installed correctly. Note however that this only applies if you’ve actually tried to install the NVIDIA proprietary drivers - ignore this if you’ve never touched the NVIDIA proprietary drivers.

Hopefully one of these will provide enough of a clue for you to figure this out…

Hello again,

I figured out the problem I was having earlier involving the ./config command, but then bumped into another when I attempted ./build. It is remarkably similar to the one posted above, except on the Mac platform. Here is the error message given in the terminal:


Last login: Thu Sep 22 14:20:31 on ttys001
ip040117:~ mbmc$ source .bashrc
-------- freesurfer-Darwin-leopard-i686-stable-pub-v5.1.0 --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /Applications/freesurfer
FSFAST_HOME       /Applications/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /Applications/freesurfer/subjects
MNI_DIR           /Applications/freesurfer/mni
FSL_DIR           /usr/local/fsl
ip040117:~ mbmc$ mrview
mrview: [WARNING] unable to determine OpenGL version - operation may be unstable if actual version is less than 3.3
mrview: [ERROR] GLSL log [vertex shader]: ERROR: 0:1: '' :  version '330' is not supported
ERROR: 0:1: '' : syntax error: #version
ERROR: 0:2: 'layout' : syntax error: syntax error

mrview: [ERROR] error compiling OpenGL vertex shader ID 1
QWidget: Must construct a QApplication before a QPaintDevice
Abort trap: 6
ip040117:~ mbmc$

This computer is running 10.11.5. It is possible going to 10.11.6 would be the necessary fix. However, being so recent, I can’t imagine that would fix everything. If so, then it seems only the OpenGl issue would be solved, leaving the QWidget error.

Unfortunately I was unable to either paste or upload the build.log file.

What advice might you have for me?

Thanks!

It seems you had no trouble with ./build here, your error is a runtime error when attempting to run mrview. This should work fine on any version of MacOSX later than mavericks, so I really doubt updating will achieve anything (and is probably likely to introduce all kinds of other compatibility problems, so example apparently MATLAB won’t run on the latest version). The most likely explanation for this I can think of is that you built MRtrix against Qt4 rather than Qt5 - you need at least Qt 5.1 to get any OpenGL 3 support on MacOSX. Can you post the contents of your release/config file so we can check this?

This is definitely the issue/ I just went over the .configure file (pasted below) and it seems that the computer is calling an old version of Qt (4.8.7) which is odd because I can navigate into that directory and I have Qt 5.7 installed. I suppose trying to locate the old version and uninstall followed by reconfiguring will be the best next logical step.

REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: darwin
EXEC <<
CMD: sw_vers -productVersion
EXIT: 0
STDOUT:
10.11.5
>>


REPORT: OS X deployment target: 10.11

REPORT: Checking for C++11 compliant compiler [clang++]:
EXEC <<
CMD: clang++ -dumpversion
EXIT: 0
STDOUT:
4.2.1
>>


REPORT: 4.2.1

COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpiFKEBZ.cpp:
---

struct Base {
    Base (int);
};
struct Derived : Base {
    using Base::Base;
};

int main() {
  Derived D (int); // check for contructor inheritance
  return (0);
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpiFKEBZ.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpiFKEBZ.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpiFKEBZ.o -mmacosx-version-min=10.11 -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT:  - tested ok

REPORT: Detecting pointer size:

COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpowxO0g.cpp:
---

#include <iostream>
int main() {
  std::cout << sizeof(void*);
  return (0);
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpowxO0g.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpowxO0g.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpowxO0g.o -mmacosx-version-min=10.11 -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
8
>>


REPORT: 64 bit

REPORT: Detecting byte order:

REPORT: little-endian

REPORT: Checking for variable-length array support:

COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpwAL6Fx.cpp:
---


int main(int argc, char* argv[]) {
  int x[argc];
  return 0;
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpwAL6Fx.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpwAL6Fx.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpwAL6Fx.o -mmacosx-version-min=10.11 -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>


REPORT: yes

REPORT: Checking for non-POD variable-length array support:

COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpgdf5Pu.cpp:
---

#include <string>

class X {
  int x;
  double y;
  std::string s;
};

int main(int argc, char* argv[]) {
  X x[argc];
  return 0;
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpgdf5Pu.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpgdf5Pu.o
EXIT: 1
STDERR:
/var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpgdf5Pu.cpp:11:6: error: variable length array of non-POD element type 'X'
  X x[argc];
     ^
1 error generated.
>>

error deleting temporary file "/var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpgdf5Pu.o": No such file or directory
REPORT: no

REPORT: Checking for zlib compression library:

COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpZ8uuYk.cpp:
---

#include <iostream>
#include <zlib.h>

int main() {
  std::cout << zlibVersion();
  return (0);
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpZ8uuYk.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpZ8uuYk.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpZ8uuYk.o -mmacosx-version-min=10.11 -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
1.2.5
>>


REPORT: 1.2.5

REPORT: Checking for Eigen 3 library:
EXEC <<
CMD: pkg-config --cflags eigen3
EXIT: 0
STDOUT:
-I/usr/local/Cellar/eigen/3.2.9/include/eigen3
>>


COMPILE /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpY9Vefh.cpp:
---

#include <Eigen/Core>
#include <iostream>

int main (int argc, char* argv[]) {
  std::cout << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << "\n";
  return 0;
}

---
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpY9Vefh.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpY9Vefh.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpY9Vefh.o -mmacosx-version-min=10.11 -lz -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
3.2.9
>>


REPORT: 3.2.9

REPORT: Checking shared library generation:
EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpYxqJea.cpp -o /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpYxqJea.o
EXIT: 0
>>

EXEC <<
CMD: clang++ /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpYxqJea.o -dynamiclib -install_name @rpath/LIBNAME -mmacosx-version-min=10.11 -mmacosx-version-min=10.11 -lz -o libtest.dylib
EXIT: 0
>>


REPORT: yes

REPORT: Checking for Qt moc:
EXEC <<
CMD: moc -v
EXIT: 1
STDERR:
Qt Meta Object Compiler version 63 (Qt 4.8.7)
>>


REPORT: moc (version 4.8.7)

REPORT: Checking for Qt qmake:
EXEC <<
CMD: qmake -v
EXIT: 0
STDOUT:
QMake version 2.01a
Using Qt version 4.8.7 in /usr/local/Cellar/qt/4.8.7_2/lib
>>


REPORT: qmake (version 4.8.7)

REPORT: Checking for Qt rcc:
EXEC <<
CMD: rcc -v
EXIT: 1
STDERR:
Qt Resource Compiler version 4.8.7
>>


REPORT: rcc (version 4.8.7)

REPORT: Checking for Qt:

source file "qt.h":
---
#include <QObject>

class Foo: public QObject {
  Q_OBJECT;
  public:
    Foo();
    ~Foo();
  public slots:
    void setValue(int value);
  signals:
    void valueChanged (int newValue);
  private:
    int value_;
};
---

source file "qt.cpp":
---
#include <iostream>
#include "qt.h"

Foo::Foo() : value_ (42) { connect (this, SIGNAL(valueChanged(int)), this, SLOT(setValue(int))); }

Foo::~Foo() { std::cout << qVersion() << "\n"; }

void Foo::setValue (int value) { value_ = value; }

int main() { Foo f; }
---

project file "qt.pro":
---
CONFIG += c++11
QT += core gui opengl svg
HEADERS += qt.h
SOURCES += qt.cpp
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
---
EXEC <<
CMD: qmake
EXIT: 0
>>

EXEC <<
CMD: moc qt.h -o qt_moc.cpp
EXIT: 0
>>

EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/local/Cellar/qt/4.8.7_2/mkspecs/unsupported/macx-clang-libc++ -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/include -isystem /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -isystem /System/Library/Frameworks/AGL.framework/Headers -F/usr/local/Cellar/qt/4.8.7_2/lib qt.cpp -o qt.o
EXIT: 0
>>

EXEC <<
CMD: clang++ -c -std=c++11 -DMRTRIX_MACOSX -fPIC -mmacosx-version-min=10.11 -DMRTRIX_WORD64 -DMRTRIX_NO_NON_POD_VLA -isystem /usr/local/Cellar/eigen/3.2.9/include/eigen3 -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -isystem /usr/local/Cellar/qt/4.8.7_2/mkspecs/unsupported/macx-clang-libc++ -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtCore.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtGui.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtOpenGL.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/lib/QtSvg.framework/Versions/4/Headers -isystem /usr/local/Cellar/qt/4.8.7_2/include -isystem /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -isystem /System/Library/Frameworks/AGL.framework/Headers -F/usr/local/Cellar/qt/4.8.7_2/lib qt_moc.cpp -o qt_moc.o
EXIT: 0
>>

EXEC <<
CMD: clang++ -mmacosx-version-min=10.11 -lz qt_moc.o qt.o -o qt -headerpad_max_install_names -stdlib=libc++ -mmacosx-version-min=10.7 -arch x86_64 -F/usr/local/Cellar/qt/4.8.7_2/lib -L/usr/local/Cellar/qt/4.8.7_2/lib -framework QtSvg -L/usr/local/opt/openssl/lib -L/usr/local/Cellar/qt/4.8.7_2/lib -F/usr/local/Cellar/qt/4.8.7_2/lib -framework QtGui -framework QtCore -framework QtOpenGL -framework OpenGL -framework AGL
EXIT: 0
>>

EXEC <<
CMD: /var/folders/zz/g1nm1ylj7sd1hj7vxrck53kh0000gq/T/tmpzXnbfb/qt
EXIT: 0
STDOUT:
4.8.7
>>


REPORT: 4.8.7

Yep, it looks like it was using HomeBrew’s Qt 4.8.7. I’ve no idea how HomeBrew manages side-by-side installs of Qt4 and Qt5, but these things can get fiddly. Maybe if you can find a way of listing the files in each package, figure out where Qt5 stored its qmake, moc and rcc executables, check that they reside in a different place from the Qt4 versions, and if they do, modify your PATH to list that folder first. For example, you might be able to just run:

export PATH=/usr/local/opt/qt5/bin:$PATH
./configure
./build

But I’ve no idea whether that’s the right folder, or indeed whether this will work at all. Do report back either way…

Homebrew’s qt5 is keg only which means it is not symlinked to /usr/local by default. You can get its path via brew info qt5. The path should be `brew --prefix`/opt/qt5/bin.

Hello again,

Thank you for all the help! I was able to run the path command you gave with respect to the matrix 3 directory and it seemed to do the trick. (Max’s command confirmed the path that Dr. Tournier predicted.)

cd mrtrix3
export PATH=/usr/local/opt/qt5/bin:$PATH
./configure
./build

mrview worked as it was supposed to. Thanks again!

Hi experts,

Iḿ sorry that I couldnt still figure out the error.However,commands like mrconvert did work successfully.
PFA for a screenshot of the error

Thanks in advance,
Archith

OK, I think I know what the problem is. Sorry, I probably could have picked this up from your original post a couple of months ago, I just didn’t spot the clue:

OpenGL vendor string: VMware, Inc.

I didn’t realise you were running this within a virtual machine. As discussed in this post, I don’t expect this to work - MRView is designed to run on and have direct access to modern rendering hardware, but virtual machines will by necessity introduce an abstraction layer. But it seems it might be possible with a recent version of VMware, and a recent version of Linux (the mesa libraries in particular). So you’d need to update your VMware installation to the latest version, just to make sure, and update your Linux install also: I note you’re running mesa 11.0.7, and if you look through the post I mentioned earlier, I think you need at least version 11.1 for this to work. I’ve no idea how difficult it might be to update just the mesa part on your Linux distribution, but there’s bound to be lots of information about this online if you search for it…

Thank You.
I tried the third option you had suggested in the previous post and it worked :slight_smile:

I use Ubuntu22.04.02 and I meet this issue today. After checking, I found this solution salck libgl. By installing this package conda install -c conda-forge libstdcxx-ng, I get rid of the error magically.

1 Like