Problem with vtkGPUVolumeRayCastMapper

I’m trying to volume render some data that represents the state variables of a fluid defined on the uniform Cartesian grid of a 3D fluid simulation. I’m using VTK Version: 9.3.20240324, and running into trouble with the mapper for the volume.

Here’s the specific problem that happens when I run the code:

2024-04-15 15:31:27.197 ( 0.094s) [ 7A0C113EED00]vtkGPUVolumeRayCastMapp:31 WARN| Error: no override found for ‘vtkGPUVolumeRayCastMapper’.
Segmentation fault (core dumped)

I’ve googled / Chat-GPTed / Clauded this error, but nothing I’ve found has solved it. Can someone help me figure this out? I would be happy to share my code, and explain if necessary.

do you solve this problem?

You’re likely missing linking to vtkRenderingVolumeOpenGL2 module. Check to see if you have that module disabled in your VTK build for some reason. If that is compiled and if you use CMake for your application, make sure you add that module as a component to the find_package(VTK) call like:

find_package(VTK REQUIRED COMPONENTS vtkRenderingVolumeOpenGL2 ...)

And also add that to the vtk_module_autoinit macro in CMakeLists.txt.

1 Like

Thanks for the response. I have rebuilt VTK multiple times with this configuration switched to ‘Yes’, but the error persists.

I’m telling VTK with ccmake to build with VTK_MODULE_ENABLE_VTK_RenderingOpenGL2, VTK_MODULE_ENABLE_VTK_RenderingVolume, and VTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2 all set to YES, but I still get the same issue when I build, and run the code.

When I add what you’ve suggested, the code does not even build. I get the following:

~/Desktop/imhd-CUDA/visualization/build$ cmake ../src
CMake Deprecation Warning at /usr/local/lib/cmake/vtk-9.3/vtk-config.cmake:83 (message):
  The new name for the 'vtkRenderingVolumeOpenGL2' component is
  'RenderingVolumeOpenGL2'
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


CMake Error at /usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:1270 (message):
  Failed to determine the real target for the `vtkRenderingVolumeOpenGL2`
  module.  The module name is not a CMake target.  Is there a typo? Is it
  missing a `Package::` prefix? Is a `find_package` missing a required
  component?
Call Stack (most recent call first):
  /usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:3280 (_vtk_module_real_target)
  CMakeLists.txt:18 (vtk_module_autoinit)


-- Configuring incomplete, errors occurred!

when I change the name from vtkRenderingVolumeOpenGL2 to RenderingVolumeOpenGL2, then I get THIS problem:

~/Desktop/imhd-CUDA/visualization/build$ cmake ../src
CMake Error at /usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:1270 (message):
  Failed to determine the real target for the `RenderingVolumeOpenGL2`
  module.  The module name is not a CMake target.  Is there a typo? Is it
  missing a `Package::` prefix? Is a `find_package` missing a required
  component?
Call Stack (most recent call first):
  /usr/local/lib/cmake/vtk-9.3/vtkModule.cmake:3280 (_vtk_module_real_target)
  CMakeLists.txt:18 (vtk_module_autoinit)

Is there something I’m overlooking? Why can’t CMake find this module when I’ve built VTK to have it?

Wanted to reply here. Managed to solve the issue with the following in CMakeLists.txt:

vtk_module_autoinit(
    TARGETS target_binary
    MODULES ${VTK_LIBRARIES}
)