<div dir="ltr">Hi Patricio,<div><br></div><div>The primary thing that vtkWindowToImageFilter does is call glReadPixels() via vtkOpenGLRenderWindow::GetPixelData().  So you can try debugging/profiling the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">vtkOpenGLRenderWindow.cxx </span>code at the point where it calls glReadPixels() to see if that is where the llvmpipe threads are being created.</div><div><br></div><div> - David</div><div> <br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 22, 2018 at 4:07 PM, Patricio Palma C. <span dir="ltr"><<a href="mailto:patriciop@gmail.com" target="_blank">patriciop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail_quote"><div>Hi All</div><div dir="auto"><br></div><div dir="auto">   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.</div><div lang="EN-US"><div class="gmail-m_-1800001266990184630m_5759918524422238894WordSection1">
<p class="MsoNormal">This application is running linux RH 6.6 / VTK 7.1 / mesa 17.0.6
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Source code extract:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">vtkSmartPointer<vtkRenderer> osRenderer = vtkSmartPointer<vtkRenderer>::<wbr>New();<u></u><u></u></p>
<p class="MsoNormal">vtkSmartPointer<<wbr>vtkXOpenGLRenderWindow> renWin = vtkSmartPointer<<wbr>vtkXOpenGLRenderWindow>::New()<wbr>;<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">renWin->SetOffScreenRendering(<wbr>true);<u></u><u></u></p>
<p class="MsoNormal">renWin->AddRenderer(<wbr>osRenderer);<u></u><u></u></p>
<p class="MsoNormal">renWin->SetSize(pictureSize.<wbr>width(), pictureSize.height());<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">// copyActors from QVTKWidget2<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">vtkSmartPointer<<wbr>vtkWindowToImageFilter> filter = vtkSmartPointer<<wbr>vtkWindowToImageFilter>::New()<wbr>;<u></u><u></u></p>
<p class="MsoNormal">filter->SetInput(renWin);<u></u><u></u></p>
<p class="MsoNormal">filter-><wbr>SetInputBufferTypeToRGB();<u></u><u></u></p>
<p class="MsoNormal">filter->SetMagnification(1);<u></u><u></u></p>
<p class="MsoNormal">filter->Update(); <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">vtkSmartPointer<vtkImageData> image = filter->GetOutput();<u></u><u></u></p>
<p class="MsoNormal">…<u></u><u></u></p>
<p class="MsoNormal">(continue using image)</p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal">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.</p>
<p class="MsoNormal">Any ideas on how can I track this issue or where should I continue looking for an issue in my code?</p><p class="MsoNormal"><br></p>
<p class="MsoNormal">Regards</p><span class="gmail-HOEnZb"><font color="#888888"><p class="MsoNormal">Patricio</p></font></span></div></div></div></div><span class="gmail-HOEnZb"><font color="#888888">-- <br><div dir="ltr" class="gmail-m_-1800001266990184630gmail_signature">Patricio Palma C.</div>
</font></span></blockquote></div><br></div></div></div>