Using Slicer via VNC + VirtualGL

Our team started from this repository some months ago.

But we wanted not to execute a window manager on our environment.

The TurboVNC manual tells you how to do this here:

Procedure

  1. Follow the procedure described in Chapter 6 for starting a TurboVNC session and connecting to it.
  2. Open a new terminal inside the TurboVNC desktop.
  3. In the terminal, start a 3D application using VirtualGL:
    /opt/VirtualGL/bin/vglrun [vglrun options] 3D-application-executable-or-script [arguments]

So, supposing we have achieved 1.
We just need to do 2. and 3.

  1. can be translated by unix convention to prefixing the contents of the next line to the code on 3.
    DISPLAY=$VNCDISPLAY sh

So with 3. (leaving default options) our total command is:
DISPLAY=$VNCDISPLAY sh /opt/VirtualGL/bin/vglrun path/to/slicer/Slicer

But that doesn’t work, at least on our configuration.

Searching the error code on the VirtualGL issues solves this, according to dcommander:

eglinfo accesses the DRI devices in the same way that VirtualGL does, so if eglinfo egl works, that suggests that VGL_DEVICE=egl should work. As to why the specific DRI devices don’t work, I have no idea. Perhaps the user account does not have appropriate permissions for the matching /dev/dri/render * devices? Did you run vglserver_config in the container?

The key here is that VGL_DEVICE=egl should work.

That means setting the option -d egl on vglrun according to its help-text.

So our corrected command is:
DISPLAY=$VNCDISPLAY sh /opt/VirtualGL/bin/vglrun -d egl path/to/slicer/Slicer

And it correctly works.

2 Likes