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.