Segmentation fault with a SIGSEGV signal

Hi all,

I built VTK from source on my docker Ubuntu container. If I run any Python script which involves renderer, I get following segmentation fault error. In CCMake, I did turn on RenderingOpenGL2 and the corresponded .so library is found in the library directory. Can anyone provide a solution? My VTK version is 9.0.0.

Loguru caught a signal: SIGSEGV
Stack trace:
22 0x55e2647ce28e /root/workspace/build/VTK/bin/vtkpython(+0x128e) [0x55e2647ce28e]
21 0x7f720b7d40b3 __libc_start_main + 243
20 0x55e2647ce4ef /root/workspace/build/VTK/bin/vtkpython(+0x14ef) [0x55e2647ce4ef]
19 0x7f720b72b424 vtkPythonInterpreter::PyMain(int, char**) + 944
18 0x7f720b3362f3 Py_Main + 67
17 0x7f720b335df8 Py_RunMain + 1960
16 0x7f720b354bcb PyRun_SimpleFileExFlags + 235
15 0x7f720b353482 PyRun_FileExFlags + 146
14 0x7f720b35333c /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x18733c) [0x7f720b35333c]
13 0x7f720b391fbb PyEval_EvalCode + 27
12 0x7f720b391c0e PyEval_EvalCodeEx + 62
11 0x7f720b39188b _PyEval_EvalCodeWithName + 2299
10 0x7f720b24306b _PyEval_EvalFrameDefault + 15467
9 0x7f720b23effd /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x72ffd) [0x7f720b23effd]
8 0x7f720b24a0db /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x7e0db) [0x7f720b24a0db]
7 0x7f720b247467 _PyEval_EvalFrameDefault + 32871
6 0x7f720b23f083 /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x73083) [0x7f720b23f083]
5 0x7f720b46d697 _PyObject_MakeTpCall + 167
4 0x7f720b46d227 /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a1227) [0x7f720b46d227]
3 0x7f7209f96886 /root/workspace/build/VTK/lib/python3.8/site-packages/vtkmodules/vtkRenderingUI.cpython-38-x86_64-linux-gnu.so(+0x5886) [0x7f7209f96886]
2 0x7f72062d4fba vtkXRenderWindowInteractor::Initialize() + 1366
1 0x7f72060fe60f XSync + 31
0 0x7f720b7f3210 /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f720b7f3210]
( 0.338s) [main thread ] :0 FATL| Signal: SIGSEGV
Segmentation fault

It looks like it’s choking on some X bits. Do you have X running inside your container?

Bingo! Thanks Ben. I did have issue to launch X11 forwarding to my host machine which is resolved now and now I got following errors. Is it related to my X11 setting or how VTK is built?

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 64
Current serial number in output stream: 63

It seems like DRI drivers are not installed. Do you actually need X here? If not, I recommend importing the modules you need directly with from vtkmodules import vtkModuleName rather than import vtk (which imports all of VTK and ends up needing X).

I am trying to launch the vtk-server.py (see https://vtk.org/Wiki/VTK/Examples/Python/Web/RemoteRenderer). I can comment out the code in the condition block (if not _WebCone.view:) but not sure if I still can get the view on the browser without view. I am a newbie to VTK and would like to understand how all these work.

This example actually rely on remote rendering using VTK on the server side. If you don’t have a GPU on the server and you just want your docker to work anywhere, you will need to build VTK against OSMesa for rendering. But be aware that such rendering will be much slower than using a GPU.

For ParaViewWeb we have both an OSMesa version that can work anywhere such as a MacOS. And we have an EGL version which use an NVIDIA GPU. But, for EGL, you must have an NVIDIA graphics card with the proper set of driver installed.

Also in either case, you can use a prebuilt version of ParaView (EGL or OSMesa) to run VTK code by just downloading the proper linux binary here.