<div dir="ltr">Very cool Elvis! Amazing what these tiny systems can do. </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 11:01 PM, Elvis Chen <span dir="ltr"><<a href="mailto:elvis.chen@gmail.com" target="_blank">elvis.chen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi all,<div><br></div><div>This is a status update on vtk on Raspberry pi, with hardware accelerated OpenGL.</div><div><br></div><div>After a few days of trial and error, I managed to get VTK working on Raspberry Pi 3. I hope my experience can save others some time, as information on the web can be misleading.</div><div><br></div><div>First of, I am using Raspberry Pi 3.  The DOs and DONTs</div><div><br></div><div>DO:</div><div>- make sure you use the official PSU (rated at 2.5A), as there are reports that an under-powered PI causes OpenGL driver to fail,</div><div><br></div><div>DONTs:</div><div>- don't use the official 7" touch screen. The OpenGL driver apparently is very picky on the output format. It won't work with the 7" touch screen</div><div>- don't follow the instruction on <a href="https://www.raspberrypi.org/blog/another-new-raspbian-release/" target="_blank">https://www.raspberrypi.org/blog/another-new-raspbian-release/</a>, in particular DO NOT UPGRADE Raspbian.</div><div><br></div><div>Here is what I had to do to get hardware accelerated OpenGL to work:</div><div><br></div><div>- create a new raspbian/Jessie bootdisk using 2016-03-18 image</div><div>- upon first boot, which boots into X by default, expand the file system using Menu->Preference->Raspberry Pi Configuration. Reboot</div><div>- upon 2nd boot, change keyboard/time-zone as desired. Using the same configuration utility as the previous step, change the boot option to "To CLI" instead of "To Desktop". Reboot.</div><div>- now raspbian will boot into commandline instead of X. Issue the following command:</div><div>     sudo raspi-config</div><div>     - under Advanced Options, Enable OpenGL driver, reboot</div><div>- once rebooted, issue "startx" </div><div>- open a terminal, issue the following command</div><div>     sudo apt-get update</div><div>     sudo apt-get install libvtk5-qt4-dev cmake cmake-curses-gui mesa-utils</div><div><br></div><div>I choose vtk5 but vtk6 is also available as a pre-compiled package.</div><div><br></div><div>- with mesa-utils installed, you can run glxgears to test opengl. I am getting 59FPS on RPi3</div><div><br></div><div><div>pi@raspberrypi:~/research/bin/vtkViewPolyDataMesh $ glxgears </div><div>Running synchronized to the vertical refresh.  The framerate should be</div><div>approximately the same as the monitor refresh rate.</div><div>293 frames in 5.0 seconds = 58.548 FPS</div><div>301 frames in 5.0 seconds = 59.994 FPS</div><div>299 frames in 5.0 seconds = 59.613 FPS</div><div>290 frames in 5.0 seconds = 57.999 FPS</div><div>300 frames in 5.0 seconds = 59.807 FPS</div><div>300 frames in 5.0 seconds = 59.995 FPS</div></div><div><br></div><div><br></div><div>- I have compiled my own VTK program that displays a vtkpolydata and it runs well. I'll be making a video and post it online in a few days.</div><div><br></div><div>Again, please not that while I "updated" the apt packages, I NEVER "upgraded" any. I needed to "update" in order to install additional programs, but an "upgrade" will brake the OpenGL driver.</div><div><br></div><div>Hope this helps</div><div><br></div><div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">--</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">Elvis C.S. Chen, PhD</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif"> </font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">Imaging, Robarts Research Institute</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">Department of Electrical & Computer Engineering</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">Biomedical Engineering</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">Medical Biophysics, Western University</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Arial,sans-serif">London, Ontario, Canada</font></span></font></div><div style="color:rgb(33,33,33);font-family:'Segoe UI','Segoe WP','Segoe UI WPC',Tahoma,Arial,sans-serif;font-size:15px;margin:0px"><br></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 16, 2016 at 8:36 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Elvis,<div><br></div><div>One way of checking the OpenGL driver is the "glxinfo" command.</div><div>The "OpenGL renderer" is usually Mesa if it is a software renderer,</div><div>but if it gives the name of a specific card or chip, then you probably</div><div>have hardware rendering, e.g. here's what my laptop reports:<br><div><br></div><div><div>OpenGL vendor string: NVIDIA Corporation</div><div>OpenGL renderer string: NVIDIA GeForce 9400M OpenGL Engine</div><div>OpenGL version string: 2.1 NVIDIA-8.24.17 310.90.9.05f01</div><div>OpenGL shading language version string: 1.20</div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't know much about the Raspberry Pi, but google found this</div><div class="gmail_extra">page that describes how to enable hardware OpenGL:</div><div class="gmail_extra"><a href="https://www.raspberrypi.org/blog/another-new-raspbian-release/" target="_blank">https://www.raspberrypi.org/blog/another-new-raspbian-release/</a><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra"> - David</div></font></span><div><div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 16, 2016 at 6:06 PM, Elvis Chen <span dir="ltr"><<a href="mailto:elvis.chen@gmail.com" target="_blank">elvis.chen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Greetings,<br><br></div>I've recently acquired a Raspberry Pi 3. To my surprise, the latest raspbian (Jessie) comes with a complete development environment, including gcc (4.9), cmake, and vtk (both vtk5 and vtk6).<br><br></div>I wrote a small program that reads a polydata and display it as a test bed. The pipeline is:<br><br></div>vtkpolydatareader->vtkpolydatamapper->vtkactor<br><br></div>nothing fancy.<br><br></div>However, the rendering is surprisingly SLOW. It looks if the graphics is not hardware accelerated.<br><br></div>My questions are:<br><br></div>1) How do I check if the video (which I assume to be OpenGL) is hardware accelerated?<br></div>2) any suggestion on how to optimize the performance?<br><br></div>My next step is to comple vtk myself to see if it makes any difference.<br><br></div>any help is very much appreciated,</div></blockquote></div></div></div></div></div></div></div>
</blockquote></div><br></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>