<div dir="auto">Thanks David.!</div><div dir="auto"><br></div><div dir="auto">I’ve continued debugging and I’ve noticed my VTK code works fine with Mesa 10.6.5 gallium 0.4 on llvmpipe (llvm 3.6)</div><div dir="auto"><br></div><div dir="auto">Could it be a bug in Mesa 17.0.6 gallium 0.4 on llvmpipe (llvm 4.0) the cause of this issue?<br></div><div dir="auto"><br></div><div dir="auto">At this moment downgrade is not an option as I also need AVX support which is available only from Mesa 11.1. </div><div dir="auto"><br></div><div dir="auto">Should I try the latest Mesa version or is there a favorited Mesa version to use with VTK ?</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Patricio</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div>El El jue, 22 de feb. de 2018 a las 21:03, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>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><div><div><br></div><div> - David</div></div><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><<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="m_3731779905511829005gmail-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>::New();<u></u><u></u></p>
<p class="MsoNormal">vtkSmartPointer<vtkXOpenGLRenderWindow> renWin = vtkSmartPointer<vtkXOpenGLRenderWindow>::New();<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">renWin->SetOffScreenRendering(true);<u></u><u></u></p>
<p class="MsoNormal">renWin->AddRenderer(osRenderer);<u></u><u></u></p>
<p class="MsoNormal">renWin->SetSize(pictureSize.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<vtkWindowToImageFilter> filter = vtkSmartPointer<vtkWindowToImageFilter>::New();<u></u><u></u></p>
<p class="MsoNormal">filter->SetInput(renWin);<u></u><u></u></p>
<p class="MsoNormal">filter->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="m_3731779905511829005gmail-HOEnZb"><font color="#888888"><p class="MsoNormal">Patricio</p></font></span></div></div></div></div><span class="m_3731779905511829005gmail-HOEnZb"><font color="#888888">-- <br><div class="m_3731779905511829005gmail-m_-1800001266990184630gmail_signature">Patricio Palma C.</div>
</font></span></blockquote></div><br></div></div></div></blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Patricio Palma C.</div>