The program in VTK 8.1 can't work in VTK 9.2

The program is as follows, which works well in VTK8.2 :

//vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
vtkSmartPointer<vtkGPUVolumeRayCastMapper> volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapper->SetSampleDistance(volumeMapper->GetSampleDistance() / 2);	//设置光线采样距离

But it can’t work in VTK 9.2. The problem is that the volumeMapper is null pointer.

Is anyone konw why? thank you

This looks to be an object factory base class. Did you call vtk_module_autoinit in your CMake code?