<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-07-11 22:06 GMT+02:00 Ken Martin <span dir="ltr"><<a href="mailto:ken.martin@kitware.com" target="_blank">ken.martin@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">glew failing to initialize typically means that opengl has not been initialized, specifically by creating an opengl context. e.g. the this->ContextId is 0. Such as around calls to <div><br></div><div>glXCreateContextAttribsARB </div><div><br></div><div>in vtkXOpenGLRenderWindow.cxx. </div></div></blockquote><div><br></div><div>Ah, thanks for the pointers. I'll dig around.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div>FWIW I do not believe we support the Intel HD3000 on Linux for OpenGL2. You would need either mesa with software rendering, a more recent intel CPU, or a dedicated graphics card and driver.</div></div></blockquote><div><br></div><div>Hm, but the application runs fine if it's built on the machine itself. I only have this problem with the AppImage (so I think it has something to do with how I build/package it as such). It's a Thinkpad X220 (Sandybridge) with HD 3000 graphics, running 11.2.2 and the 2.99.917+668+gc28e62f version of the intel driver.<br><br></div><div>When I run it like this (built on the target laptop), the VTK 7.0.0 I use is configured with<br><br> for lib in EXPAT FREETYPE JPEG PNG TIFF ZLIB LIBXML2 OGGTHEORA TWISTED ZOPE SIX AUTOBAHN MPI4PY JSONCPP GLEW GL2PS; do<br> cmake_system_flags+="-DVTK_USE_SYSTEM_${lib}:BOOL=ON "<br> done<br><br>cmake \<br> -Wno-dev \<br> -DCMAKE_SKIP_RPATH=ON \<br> -DBUILD_SHARED_LIBS:BOOL=ON \<br> -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \<br> -DBUILD_DOCUMENTATION:BOOL=ON \<br> -DDOCUMENTATION_HTML_HELP:BOOL=ON \<br> -DDOCUMENTATION_HTML_TARZ:BOOL=ON \<br> -DBUILD_EXAMPLES:BOOL=ON \<br> -DVTK_USE_FFMPEG_ENCODER:BOOL=ON \<br> -DVTK_BUILD_ALL_MODULES:BOOL=ON \<br> -DVTK_USE_LARGE_DATA:BOOL=ON \<br> -DVTK_QT_VERSION:STRING="5" \<br> -DVTK_WRAP_JAVA:BOOL=ON \<br> -DVTK_WRAP_PYTHON:BOOL=ON \<br> -DVTK_WRAP_TCL:BOOL=ON \<br> -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" \<br> -DVTK_CUSTOM_LIBRARY_SUFFIX="" \<br> -DVTK_INSTALL_INCLUDE_DIR:PATH=include/vtk \<br> -DVTK_INSTALL_TCL_DIR=/usr/lib/tcl${_tkver}/vtk/ \<br> -DVTK_PYTHON_VERSION=3 \<br> -DPYTHON_EXECUTABLE=/usr/bin/python3 \<br> -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m \<br> -DPYTHON_LIBRARY=/usr/lib/<a href="http://libpython3.5m.so">libpython3.5m.so</a> \<br> -DVTK_USE_SYSTEM_HDF5=OFF \<br> ${cmake_system_flags} \<br> -DCMAKE_BUILD_TYPE=Release \<br> "${srcdir}/VTK-$pkgver" \<br> -GNinja<br></div><div><br></div><div>and so uses the OpenGL2 backend.<br><br></div><div>But you're saying this shouldn't really work?<br><br></div><div>Elvis<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Ken</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Jul 11, 2016 at 3:54 PM, Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div><div><div>I now have a minimal example I can share:<br><br> <a href="https://drive.google.com/open?id=0B1a2u6qVxaL7S2d3OF9uR3Q2amc" target="_blank">https://drive.google.com/open?id=0B1a2u6qVxaL7S2d3OF9uR3Q2amc</a><br><br></div>This is an AppImage (hello.appimage), built just the way I build my application. It shows a sphere in a QVTKWidget. The download is 62 MB since the VTK bundled in the image includes debugging symbols.<br><br></div>It would be great if other people could download and execute the image on their distros, to see if it runs. I've tested it only on Kubuntu 16.04 (where it works) and Arch Linux (where it crashes like described in previous mails).<br><br>Specifically it would be _very_ interesting if someone with<br><br></div>1. Arch Linux, or<br></div>2. a somewhat old Intel graphics chipset, or (even better)<br></div>3. both of the above,<br><br></div>could try running it, and see if they can reproduce my crash (failure to initialize GLEW).<br><div><div><div><div><div><div><div><div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm attaching the sources and scripts (hello.tar.gz) from which I built this example. If you want to build it yourself, just type "make" in the extracted directory. All you need is Docker and Make, everything else is taken care of inside a CentOS 6 Docker container.<br><br></div><div class="gmail_extra">Many thanks in advance.<br><br></div><div class="gmail_extra">Elvis<br><br></div><div class="gmail_extra"><div class="gmail_quote">2016-07-11 17:27 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi all,<br><br></div>In exploring different deployment options, I'm now trying to create an AppImage of a VTK+Qt application. For those who don't know, AppImage is a packaging format where the application, including (almost) all of its dependencies are put into a self-extracting ISO image called an AppImage.<br><br></div>Doing this takes quite a bit of manual work, but if you do things correctly and build the image on a good base system (I'm using CentOS 6), the image should run on a multitude of distros.<br><br></div>I've had some success: The resulting image runs on e.g. Ubuntu Xenial.<br><br></div>I'm now trying it on my Arch Linux laptop (not a common/easy target for AppImages, but I'd like to make it work since I run it personally), and get:<br><br>ERROR: In /tmp/VTK-7.0.0/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 533<br>vtkXOpenGLRenderWindow (0x1e48140): GLEW could not be initialized.<br><br></div>This is due to a glewInit() call failing during initialization of the render window, and I've debugged it to the underlying call to glGetString(GL_VERSION) in VTK's forked GLEW library returning NULL.<br><br></div><div>Does anyone have an idea why this might happen? The VTK I'm using here is configured as follows:<br><br>cmake3 \<br> -DCMAKE_INSTALL_PREFIX=/usr \<br> -DVTK_Group_Qt=ON \<br> -DVTK_QT_VERSION=5 \<br> -DVTK_Group_Imaging=ON \<br> -DVTK_Group_Views=ON \<br> -DVTK_Group_MPI=OFF \<br> -DVTK_Group_Tk=OFF \<br> -DVTK_Group_Web=OFF \<br> -DBUILD_TESTING=OFF \<br> -DVTK_USE_SYSTEM_LIBRARIES=ON \<br> -DVTK_USE_SYSTEM_LIBPROJ4=OFF \<br> -DCMAKE_BUILD_TYPE=Debug \<br> ..<br><br></div><div>And it uses the OpenGL2 backend.<br><br></div><div>It was built inside a CentOS 6 Docker container on a Kubuntu 16.04 host with HD 4400 Intel graphics adapter. The target system is an older laptop with up-to-date Arch Linux and a weaker HD 3000 Intel graphics adapter.<br></div><div><br></div>Now, packaging apps that use OpenGL is a bit tricky, because you can't bundle e.g. libX11, libGL and some other libraries that are dependant on the user's graphics adapter/environment.<br><br></div><div>The libraries that I've chosen to _not_ bundle are:<br><br> libz.so.1 <br> libm.so.6 <br> libSM.so.6 <br> libICE.so.6 <br> libX11.so.6 <br> libXext.so.6 <br> libXt.so.6 <br> libstdc++.so.6 <br> libgcc_s.so.1 <br> libc.so.6 <br> libpthread.so.0 <br> librt.so.1 <br> libGL.so.1 <br> libdl.so.2 <br> libuuid.so.1 <br> libxcb.so.1 <br> libxcb-dri3.so.0 <br> libxcb-present.so.0 <br> libxcb-randr.so.0 <br> libxcb-xfixes.so.0 <br> libxcb-render.so.0 <br> libxcb-shape.so.0 <br> libxcb-sync.so.1 <br> libxshmfence.so.1 <br> libglapi.so.0 <br> libXdamage.so.1 <br> libXfixes.so.3 <br> libX11-xcb.so.1 <br> libxcb-glx.so.0 <br> libxcb-dri2.so.0 <br> libXxf86vm.so.1 <br> libdrm.so.2 <br> libXau.so.6 <br> libXdmcp.so.6<br><br></div><div>This may be a little too liberal, and it could be that I should be bundling some of these. But it seems to work fine since the AppImage runs without problem on Kubuntu 16.04.<br><br></div><div>The application also runs fine if I build VTK and the application "normally" on the Arch host and run it (using OpenGL2 backend), so the graphics adapter should be capable enough. It's just when I try to run the CentOS 6-built AppImage on the Arch host that it fails.<br><br></div><div>The application essentially just creates a QVTKWidget and renders a volume into its rendering window.<br></div><div><br></div><div>I saw that one (perhaps likely?) reason for glGetString(GL_VERSION) returning NULL is that initialization of the GL context failed (or wasn't fully done yet). If this is the case, does anyone know where I can debug this further in VTK? Where is the OpenGL context in VTK set up when using QVTKWidget + OpenGL2 backend?<br><br></div><div>Finally: Has anyone else tried packaging VTK applications as AppImages?<br><br></div><div>I know ParaView is provided as a prebuilt Linux binary with VTK bundled, so I can imagine the ParaView folks has ran into some issues like this?<br><br></div><div>Thanks in advance for any advice.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>Elvis<br></div></font></span></div>
</blockquote></div><br></div></div></div></div></div></div></div></div></div></div>
<br></div></div>_______________________________________________<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><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br><a href="tel:518%20371%203971" value="+15183713971" target="_blank">518 371 3971</a><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>
</font></span></div>
</blockquote></div><br></div></div>