title: VTK works with real X, crashes with Xvfb
body: <p>I'm debugging a 3rd party Python script that implements headless image processing with the VTK library. When run with a regular X window session, it works as expected, flashing a window for a split second. When run against Xvfb (virtual framebuffer in memory), it crashes. The script goes like this (fluff omitted):</p>
  
  <pre><code>inname = args[0]
  outname = args[1]
  
  from vtk import *
  
  reader = vtkPLYReader()
  reader.SetFileName(inname)
  
  gf = vtkGraphicsFactory
  gf.SetOffScreenOnlyMode(1)
  gf.SetUseMesaClasses(1)
  if_ = vtkImagingFactory
  if_.SetUseMesaClasses(1)
  
  mapper = vtkPolyDataMapper()
  mapper.SetInputConnection(reader.GetOutputPort())
  actor = vtkActor()
  actor.SetMapper(mapper)
  
  renderer = vtkRenderer()
  renderWindow = vtkRenderWindow()
  renderWindow.SetSize(xsize, ysize)
  renderWindow.SetOffScreenRendering(1)
  renderWindow.AddRenderer(renderer)
  renderer.AddActor(actor)
  renderer.SetBackground(1, 1, 1)
  renderWindow.Render()          #&lt;------------ This line crashes
  
  wif = vtkWindowToImageFilter()
  wif.SetInput(renderWindow)
  wif.Update()
  
  writer = vtkPNGWriter()
  writer.SetFileName(outname)
  writer.SetInput(wif.GetOutput())
  writer.Write()
  </code></pre>
  
  <p>The crash message goes:</p>
  
  <pre><code>ERROR: In /builddir/build/BUILD/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 404
  vtkXOpenGLRenderWindow (0x26942e0): Could not find a decent visual
  
  Segmentation fault (core dumped)
  </code></pre>
  
  <p>Xvfb runs as a service; its command line is:</p>
  
  <pre><code> /usr/bin/Xvfb :99 -ac -extension GLX
  </code></pre>
  
  <p><code>DISPLAY</code> is set for <code>:99</code> for the testing. The OS is RHEL 6.</p>
  
  <p>Any comments what's a "visual" and how do I enable one in Xvfb are welcome.</p>
  
  <p>EDIT: Running <code>glxinfo</code> gives a similar message: </p>
  
  <pre><code>Error: couldn't find RGB GLX visual or fbconfig
  </code></pre>
  
  <p>But the GLX extension is right there in the command line. The Xvfb log doesn't have any error messages.</p>
  
  <p>EDIT2: but when I do <code>xdpyinfo -queryExtensions</code>, GLX is not listed.</p>