MRVIEW: Blank window on WSL

Hey everyone,

After successfully building MRtrix3 in a WSL (Ubuntu 18.04 on Windows 10) mrview and shview now only loads a blank black window. Since it last worked I installed ANTs and Freesurfer, otherwise nothing changed. The debug log does not return an error (see below).

Other applications requiring OpenGL like fsleyes work fine. I have tried modifying ~/.bashrc and adding a /.mrtrix.config file as suggested in other threads.

Help!

Thanks already,
Gregor

$ mrview -debug
mrview: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrview: [DEBUG] No config file found at "/home/agbarbe/.mrtrix.conf"
mrview: [INFO] GL renderer:  llvmpipe (LLVM 10.0.0, 128 bits)
mrview: [INFO] GL version:   3.3 (Core Profile) Mesa 20.0.8
mrview: [INFO] GL vendor:    VMware, Inc.
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

Hi @GBRANDT,

It looks to me like you’re running mrview from within a virtual machine:

mrview: [INFO] GL vendor:    VMware, Inc.

and on this implementation, the OpenGL implementation falls back to software rendering via the llvmpipe Mesa driver:

mrview: [INFO] GL renderer:  llvmpipe (LLVM 10.0.0, 128 bits)
mrview: [INFO] GL version:   3.3 (Core Profile) Mesa 20.0.8

Running within virtual machines is always tricky for a number of reasons, the main being access to the GPU hardware. The Mesa project do their best to support what they can with their CPU driver, but it’s not guaranteed to support all the features required for OpenGL 3.3 (which is what mrview relies on). You’ll find a lot of information on this issue in this wiki article.

One way to potentially get this working (though I doubt you’ll get the volume renderer to work) is to upgrade your Mesa drivers to a more recent version (current version at the time of writing is 23.1.3). Alternative is to run mrview natively on your system, or use a VM implementation that provides direct access to the GPU (which I think can be done with some, though I don’t have hard facts to back this up).

I hope this helps…
All the best,

Donald.