[vtkusers] offscreen mode with python wrapping gives seg fault

Mario Storti mario.storti at gmail.com
Tue Jun 23 21:44:51 EDT 2009


Hi vtk-users!!

I'm using VTK since some time ago and I'm very happy with it. I make
nice videos but I'm trying now to make them in offscreen mode,
otherwise it is very annoying, you can't almost work on the workstation
that is processing the video, otherwise the video gets all screwed
up.

The problem is that I can't get the OffscreenMode to work at all!! I
use VTK with the Python wrapper. Initially I had VTK installed from
the Fedora 11 RPM's. When I run my script and make

renWin.OffScreenRenderingOn();

then in the next renWin.Render() call I get a "Segmentation fault". I
detected that the RPM's seem not to have the OSMesa
compiled. (BTW, I'm not sure if OS-MEsa is absolutely needed, I
saw some posts that tell that now we can do OffScreen rendering
without the OSMESA feature. )

Anyway, I downloaded VTK 5.4.2 and compiled with

* OSMESA enabled
* Shared libs enabled
* Python wrapper enabled

I continue to get the segmentation fault.

I tried to call the Mesa rendering functions
vtk.vtkMesaRenderWindow(), vtk.vtkOSMesaRenderWindow(),
vtk.vtkMesaRenderer() but I get always the segmentation fault.

I saw a post that says that you don't have to call the Mesa rendering
functions directly, you have instead to call the Mesa factories and
thent the Mesa renderings will be called. I added then

factGraphics = vtk.vtkGraphicsFactory();
factGraphics.SetUseMesaClasses(1)
del factGraphics

factImage = vtk.vtkImagingFactory;
factImage.SetUseMesaClasses(1)
del factImage

to the beginning og my script, but it doesn' change (always the
segmentation fault).

Well, I wonder if there is a way to deactivate hardware
acceleration. Perhaps using software rendering is slow but I can do it
offscreen. I'm not concerned if the visualization takes more time, but
if I can do it offscreen it's OK.

If anyone can send me a working simple Python script that does
offscreen rendering that would help.

Thanks in advance!!

Mario

-- 
-------------------------
Mario Alberto Storti
Centro Internacional de Metodos Computacionales
  en Ingenieria - CIMEC (INTEC/CONICET-UNL)
INTEC, Guemes 3450 - 3000 Santa Fe, Argentina
Tel/Fax: +54-342-4511594, cel: +54-342-156144983
e-mail: mario.storti at gmail.com
http://www.cimec.org.ar/mstorti http://www.cimec.org.ar
-------------------------



More information about the vtkusers mailing list