[vtkusers] Llvmpipe threads collapses the system when capturing a screenshot
David Gobbi
david.gobbi at gmail.com
Thu Feb 22 19:02:40 EST 2018
Hi Patricio,
The primary thing that vtkWindowToImageFilter does is call glReadPixels()
via vtkOpenGLRenderWindow::GetPixelData(). So you can try
debugging/profiling the vtkOpenGLRenderWindow.cxx code at the point where
it calls glReadPixels() to see if that is where the llvmpipe threads are
being created.
- David
On Thu, Feb 22, 2018 at 4:07 PM, Patricio Palma C. <patriciop at gmail.com>
wrote:
> Hi All
>
> I’m using vtkWindowToImageFilter to export screenshots of a
> vtkXOpenGLRenderWindow. It works, but every time a screenshot is created,
> 15 new llvmpipe threads are spawned and they are not finalized by the app.
> I noticed this because after a while the number of threads reached the
> limit (about 5500) and no more threads can be spawned.
>
> This application is running linux RH 6.6 / VTK 7.1 / mesa 17.0.6
>
>
>
> Source code extract:
>
>
>
> vtkSmartPointer<vtkRenderer> osRenderer = vtkSmartPointer<vtkRenderer>::
> New();
>
> vtkSmartPointer<vtkXOpenGLRenderWindow> renWin = vtkSmartPointer<
> vtkXOpenGLRenderWindow>::New();
>
>
>
> renWin->SetOffScreenRendering(true);
>
> renWin->AddRenderer(osRenderer);
>
> renWin->SetSize(pictureSize.width(), pictureSize.height());
>
>
>
> // copyActors from QVTKWidget2
>
>
>
> vtkSmartPointer<vtkWindowToImageFilter> filter = vtkSmartPointer<
> vtkWindowToImageFilter>::New();
>
> filter->SetInput(renWin);
>
> filter->SetInputBufferTypeToRGB();
>
> filter->SetMagnification(1);
>
> filter->Update();
>
>
>
> vtkSmartPointer<vtkImageData> image = filter->GetOutput();
>
> …
>
> (continue using image)
>
> At this moment I’m using an empty RenderWindow, I thought actors could
> have a problem so I commented that out but the problem persists.
>
> After some testing I’ve noticed that the problem arise after calling
> filter->Update(). If this line is commented, no picture is generated but
> the threads are finalized.
>
> Any ideas on how can I track this issue or where should I continue looking
> for an issue in my code?
>
>
> Regards
>
> Patricio
> --
> Patricio Palma C.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180222/b3aff0ce/attachment.html>
More information about the vtkusers
mailing list