[vtkusers] Python/VTK offscreen / headless rendering

Robert.Atwood at diamond.ac.uk Robert.Atwood at diamond.ac.uk
Fri Apr 27 11:06:25 EDT 2018


Thanks Max, that seems to install if I use a conda enviromnet to avoid messing up other users ☺


conda create --prefix /path/to/my/local/env
source activate /path/to/my/local/env
conda config --add channels conda-forge
conda install mesalib vtk


It’s still installing – but it looks like then I have to update to Python 3 and vtk 8 ????




From: Max Smolens [mailto:max.smolens at kitware.com]
Sent: 27 April 2018 14:52
To: Atwood, Robert (DLSLtd,RAL,SCI)
Cc: Paul Korir; vtkusers at vtk.org
Subject: Re: [vtkusers] Python/VTK offscreen / headless rendering

Hi Robert,

The conda-forge channel includes a variant of the vtk package that supports offscreen rendering with OSMesa. This variant is chosen automatically if the mesalib package is installed when installing vtk:

conda config --add channels conda-forge
conda install mesalib vtk

HTH,
Max

On Fri, Apr 27, 2018 at 7:16 AM, Robert.Atwood at diamond.ac.uk<mailto:Robert.Atwood at diamond.ac.uk> <Robert.Atwood at diamond.ac.uk<mailto:Robert.Atwood at diamond.ac.uk>> wrote:
Hi, Paul
The difference is to get to the point where there is something rendered, without having to open a window on the terminal.
In the case where I already know (or can calculate from the image data) the colour function and the transparency function, I know what camera angle I want and so on, I just want to run a background job on a remote workstation/cluster node to render that same view for a number of similar images (of the same object in different time steps) Instead of sitting on my computer watching it.

But, the problem is that with the way I know how to do it, the creation of the render window trys to get a GL context, but it can't do that .

If I try in python on a X-window connection even, I get the following
ERROR: In /home/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 394
vtkXOpenGLRenderWindow (0x7f47c0fda000): Could not find a decent visual


But maye the capability isn't compiled into the python package  from Anaconda??
Is there a python package  I can grab that has software rendering?




I tried to buld the c++ from source of 7.1.1. But not successfully. ..

./CylinderRenderingProperties
ERROR: In /dls/science/users/kny48981/sources/vtk/VTK-7.1.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 320
vtkXOpenGLRenderWindow (0xfc18a0): Could not find a decent config






> -----Original Message-----
> From: Paul Korir [mailto:pkorir at ebi.ac.uk<mailto:pkorir at ebi.ac.uk>]
> Sent: 27 April 2018 11:09
> To: Atwood, Robert (DLSLtd,RAL,SCI); 'vtkusers at vtk.org<mailto:vtkusers at vtk.org>'
> Subject: Re: [vtkusers] Python/VTK offscreen / headless rendering
>
> How different is what you need from writing the rendered output directly
> to a file using one of the vtk*Writer classes?
>
> Correct me if I'm missing something.
>
> Paul K. Korir, PhD
> Scientific Programmer
> EMBL-EBI
> 01223494422
>
> On 23/04/2018 11:52, Robert.Atwood at diamond.ac.uk<mailto:Robert.Atwood at diamond.ac.uk> wrote:
> > Hi,
> > I would like to have a Python script to render several volume images
> (tomography data)  on a headless machine. I could not find any advice more
> recent than 2011 , is this something that just isn't configured in the Python as
> installed from existing packages? How do I tell?
> > If it's not in the python , what needs to be done, at the time of prior
> questions it seemed to be a compile-time option of the VTK library, is that
> still the case, Any exaples on line that are for the current release ?
> > Thanks
> > Robert
> >
> >
> >


--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180427/7dc048e3/attachment.html>


More information about the vtkusers mailing list