# Segmentation fault when building with VTKm

**URL:** https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011
**Category:** ParaView Support
**Tags:** vtkm
**Created:** [November 20, 2019, 5:35pm UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011 "2019-11-20T17:35:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vnpavanelli](https://discourse.paraview.org/user_avatar/discourse.paraview.org/vnpavanelli/32/1998_2.png) [@vnpavanelli](https://discourse.paraview.org/u/vnpavanelli)
#### Post date: [November 20, 2019, 5:35pm UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011/1 "2019-11-20T17:35:12Z")

</div>

Hello!

I’m trying to build ParaView with VTKm enabled but all binaries (paraview, pvpython, and servers) failed with SIGSEGV (segmentation fault) when I start the program, in the initialization without any message, shell or window.  
Without VTKm but with CUDA/OptiX the binaries run fine. Other CUDA apps that I build also run fine so I think my CUDA install is alright.

I tried to change the VTKm\_CUDA\_Architecture from “native” to “pascal” (using a 1060 card here) but both give the SIGSEGV, tried enabling CUDA\_SEPARABLE\_COMPILATION with no success, and tried to enable Debug but it has not improved the backtrace.

I found some mention of a similar error in a CMake merge request ([https://gitlab.kitware.com/cmake/cmake/merge\_requests/457](https://gitlab.kitware.com/cmake/cmake/merge_requests/457)) but don’t know if it’s related, maybe I need to manually set the CMAKE\_CUDA\_FLAGS like “-gencode arch=compute\_61,code=sm\_61” (I use this on my Ph.D. project with success).

Using CMake 3.14.6, CUDA 10.0.130 (with GCC 7.4.0), GCC 9.2.0 for c++ code and NVidia driver 440.31. If more information is needed please let me know.

Can anyone point me in the direction to fix this?

The debug backtrace from cuda-gdb with CMAKE\_BUILD\_TYPE=Debug is:

```
0x00007ffff359139a in __cudaRegisterLinkedBinary(__fatBinC_Wrapper_t const*, void (*)(void**), void*) ()
   from /root/src/paraview_build/bin/../lib64/libvtkPVServerManagerApplication-pv5.7.so.1
(cuda-gdb) bt
#0 0x00007ffff359139a in __cudaRegisterLinkedBinary(__fatBinC_Wrapper_t const*, void (*)(void**), void*) ()
   from /root/src/paraview_build/bin/../lib64/libvtkPVServerManagerApplication-pv5.7.so.1
#1 0x00007ffff3590380 in __cudaRegisterLinkedBinary_48_tmpxft_0000622a_00000000_6_ClipWithField_cpp1_ii_7724b337 ()
   from /root/src/paraview_build/bin/../lib64/libvtkPVServerManagerApplication-pv5.7.so.1
#2 0x00007ffff421670d in __sti____ cudaRegisterAll ()
   from /root/src/paraview_build/bin/../lib64/libvtkPVServerManagerApplication-pv5.7.so.1
#3 0x00007ffff7fe318a in _dl_rtld_di_serinfo () from /lib64/ld-linux-x86-64.so.2
#4 0x00007ffff7fe3286 in _dl_rtld_di_serinfo () from /lib64/ld-linux-x86-64.so.2
#5 0x00007ffff7fd50ca in ?? () from /lib64/ld-linux-x86-64.so.2
#6 0x0000000000000001 in ?? ()
#7 0x00007fffffffe28b in ?? ()
#8 0x0000000000000000 in ?? ()

```

Thanks for your time!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [November 21, 2019, 6:24pm UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011/2 "2019-11-21T18:24:04Z")

</div>

@robert.maynard @allison.vacanti

---

<div class="post-metadata">

### Author: ![robert.maynard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robert.maynard/32/93_2.png) [@robert.maynard](https://discourse.paraview.org/u/robert.maynard)
#### Post date: [November 22, 2019, 12:06am UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011/3 "2019-11-22T00:06:11Z")

</div>

Does this occur if you have VTK-m enabled, and OptiX disabled?

Edit:  
Follow-up. You are building ParaView master?

---

<div class="post-metadata">

### Author: ![vnpavanelli](https://discourse.paraview.org/user_avatar/discourse.paraview.org/vnpavanelli/32/1998_2.png) [@vnpavanelli](https://discourse.paraview.org/u/vnpavanelli)
#### Post date: [November 22, 2019, 5:14pm UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011/4 "2019-11-22T17:14:03Z")

</div>

I’ve tried a clean build with only VTK-m enabled and it worked fine, even with PARAVIEW\_USE\_CUDA=ON. Then just enabling ray tracing and VisRTX worked fine with not SIGSEGV.

I’m using master @697b01a200.

It may be related to some flag I enabled on the previous build, or the fact now I didn’t “make clean” between builds, really don’t know.  
Will try to reproduce the problem here.

---

<div class="post-metadata">

### Author: ![robert.maynard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robert.maynard/32/93_2.png) [@robert.maynard](https://discourse.paraview.org/u/robert.maynard)
#### Post date: [November 27, 2019, 4:09pm UTC](https://discourse.paraview.org/t/segmentation-fault-when-building-with-vtkm/3011/5 "2019-11-27T16:09:21Z")

</div>

This sounds like the classic issue where two dynamic libraries that are using static CUDA and therefore get multiple duplicate symbols.

I think the quickest solution is to add `-Xlinker muldefs` to you CMAKE\_CUDA\_FLAGS and see if that builds properly
