[vtkusers] Offscreen Rendering & Linux

endlosschleife1 endlosschleife1 at googlemail.com
Tue Oct 19 09:01:30 EDT 2010


I wasn't aware of hidden X servers and virtual framebuffers, but I just
tried this with Xvfb and it seems to work for my purposes. Thanks, David!



2010/10/19 David Gobbi <david.gobbi at gmail.com>

> Hi Mark,
>
> I'm jumping into this conversation a little late, so I might have
> missed a couple things.  But it seems that you are going to need to
> connect to an X server of some sort, so you should try using a hidden
> X server, rather than just a hidden window.
>
> Since I have only one monitor on my computer, but have a dual-head
> video card, I use my second head (with no monitor attached) for
> running VTK dashboard tests or other graphics-related things that I
> don't want to see on-screen.  It seems to me that you could do
> something similar, and when you log-in remotely you could set your
> DISPLAY variable to use a hidden, hardware-accelerated X server.
>
>  David
>
> On Tue, Oct 19, 2010 at 5:39 AM, endlosschleife1
>  <endlosschleife1 at googlemail.com> wrote:
> > Hi Lars,
> >
> > sorry for the late reply. Thanks a lot! I just tried this out. It does
> seem
> > to not open the X Window, but I still need a X connection, otherwise my
> code
> > terminates when it calls the GetDesiredVisualInfo() method. For my
> purposes
> > I would need a VTK based rendering service that I can interact with
> remotely
> > (starting it from a SSH terminal, sending rendered data to a
> client through
> > a socket etc.). I will look into this some more. I wonder if I can
> hardcode
> > all the information that the render window needs and tries to retrieve
> from
> > the display.
> >
> > Thanks again!
> >
> > Mark
> >
> >
> > 2010/10/3 Lars Friedrich Lars <lars-friedrich at gmx.net>
> >>
> >> Hello Mark,
> >>
> >>
> >> I'm having a comparable problem. I found a solution that works for me,
> >> maybe this is also a solution to your situation ...
> >>
> >> Basically, I want to hide the X-window when using GL hardware off-screen
> >> rendering. My first experiments involved XUnmapWindow - however, as the
> X
> >> window is initially mapped in the CreateAWindow()-method, the window
> will
> >> appear at least for a few milliseconds prior to calling XUnmapWindow().
> This
> >> is neither "nice", nor a solution to your problem.
> >>
> >> Therefore, I inherited from vtkXOpenGLRenderWindow and overrode the
> >> CreateAWindow()-method. I simply eliminated the code block that calls
> >> XMapWindow() initially -> the off-screen window never gets mapped ...
> >>
> >> The inherited class is however suboptimal, as I had to redefine the
> >> vtkXOpenGLRenderWindowInternal class (forward declaration ...).
> >>
> >> I attachted a simple example (hidex.cxx) that makes use of the simple
> >> inherited class. If you want, try it, and please let me know whether or
> not
> >> it works for you.
> >>
> >>
> >> regards,
> >>
> >> lars
> >>
> >>
> >>
> >>
> >> -------- Original-Nachricht --------
> >> > Datum: Thu, 23 Sep 2010 10:54:54 -0400
> >> > Von: Aashish Chaudhary <aashish.chaudhary at kitware.com>
> >> > An: endlosschleife1 <endlosschleife1 at googlemail.com>
> >> > CC: vtkusers at vtk.org
> >> > Betreff: Re: [vtkusers] Offscreen Rendering & Linux
> >>
> >> > Mark,
> >> >
> >> > I believe that as of now if you want to use OpenGL driver and not Mesa
> >> > it
> >> > requires opening an windows or else you have to use Mesa (like you
> did).
> >> > There is no workaround for the former case.
> >> >
> >> > On Thu, Sep 23, 2010 at 6:48 AM, endlosschleife1 <
> >> > endlosschleife1 at googlemail.com> wrote:
> >> >
> >> > > Hello,
> >> > >
> >> > > has anybody some experience with doing offscreen rendering under
> Linux
> >> > with
> >> > > graphics acceleration support and give me some hints on how to get
> >> > > this
> >> > to
> >> > > work?
> >> > >
> >> > > I'm using a vtkOpenGLRenderWindow and set OffScreenRendering to on.
> >> > > With
> >> > > that it does really not render into a window, but VTK still opens an
> X
> >> > > Window (apparently it needs its handle). So for instance when I try
> to
> >> > start
> >> > > a VTK based app remotely via SSH I get the following error message:
> >> > >
> >> > > # An unexpected error has been detected by Java Runtime Environment:
> >> > > #
> >> > > #  SIGSEGV (0xb) at pc=0xb2b5b4f5, pid=16472, tid=3044047776
> >> > > #
> >> > > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode,
> sharing)
> >> > > # Problematic frame:
> >> > > # C  [libvtkRenderingJava.so.5.6.0+0x66c4f5]
> >> > > _ZN22vtkXOpenGLRenderWindow13CreateAWindowEv+0x37b
> >> > > #
> >> > > # An error report file with more information is saved as
> >> > > hs_err_pid16472.log
> >> > > #
> >> > > # If you would like to submit a bug report, please visit:
> >> > > #   http://java.sun.com/webapps/bugreport/crash.jsp
> >> > > #
> >> > >
> >> > > Is there any way around the need for VTK to open an X window?
> >> > > Basically
> >> > I
> >> > > would like to know if that problem is even fixable or if I need to
> >> > > look
> >> > for
> >> > > other workarounds.
> >> > >
> >> > > When I build VTK with MESA enabled it works, but the performance
> >> > > without
> >> > > accelaration is unacceptable.
> >> > >
> >> > > Thanks,
> >> > > Mark
> >> > > _______________________________________________
> >> > > Powered by 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
> >> > >
> >> > > Follow this link to subscribe/unsubscribe:
> >> > > http://www.vtk.org/mailman/listinfo/vtkusers
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> > | Aashish Chaudhary
> >> > | R&D Engineer
> >> > | Kitware Inc.
> >> > | www.kitware.com
> >>
> >> --
> >> GRATIS: Spider-Man 1-3 sowie 300 weitere Videos!
> >> Jetzt freischalten! http://portal.gmx.net/de/go/maxdome
> >
> >
> > _______________________________________________
> > Powered by 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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101019/9848068d/attachment.htm>


More information about the vtkusers mailing list