Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

416
Vistas
VTK works with real X, crashes with Xvfb

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):

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()          #<------------ This line crashes

wif = vtkWindowToImageFilter()
wif.SetInput(renderWindow)
wif.Update()

writer = vtkPNGWriter()
writer.SetFileName(outname)
writer.SetInput(wif.GetOutput())
writer.Write()

The crash message goes:

ERROR: In /builddir/build/BUILD/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 404
vtkXOpenGLRenderWindow (0x26942e0): Could not find a decent visual

Segmentation fault (core dumped)

Xvfb runs as a service; its command line is:

 /usr/bin/Xvfb :99 -ac -extension GLX

DISPLAY is set for :99 for the testing. The OS is RHEL 6.

Any comments what's a "visual" and how do I enable one in Xvfb are welcome.

EDIT: Running glxinfo gives a similar message:

Error: couldn't find RGB GLX visual or fbconfig

But the GLX extension is right there in the command line. The Xvfb log doesn't have any error messages.

EDIT2: but when I do xdpyinfo -queryExtensions, GLX is not listed.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I use Xvfb to run selenium tests, but I use the module xvfbwrapper, it's a lightweight module for Xvfb

Below the code:

from xvfbwrapper import Xvfb
display = Xvfb()
display.start()
[ yourcode ]
display.stop()
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda