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

**URL:** https://discourse.vtk.org/t/the-program-in-vtk-8-1-cant-work-in-vtk-9-2/9753
**Category:** Support
**Created:** [November 7, 2022, 10:07am UTC](https://discourse.vtk.org/t/the-program-in-vtk-8-1-cant-work-in-vtk-9-2/9753 "2022-11-07T10:07:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![supersteven](https://discourse.vtk.org/user_avatar/discourse.vtk.org/supersteven/32/5986_2.png) [@supersteven](https://discourse.vtk.org/u/supersteven)
#### Post date: [November 7, 2022, 10:07am UTC](https://discourse.vtk.org/t/the-program-in-vtk-8-1-cant-work-in-vtk-9-2/9753/1 "2022-11-07T10:07:49Z")

</div>

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

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

```

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

Is anyone konw why? thank you

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [November 7, 2022, 5:35pm UTC](https://discourse.vtk.org/t/the-program-in-vtk-8-1-cant-work-in-vtk-9-2/9753/2 "2022-11-07T17:35:25Z")

</div>

> [@supersteven](#):
>
> `vtkGPUVolumeRayCastMapper`

This looks to be an object factory base class. Did you call [`vtk_module_autoinit`](https://vtk.org/doc/nightly/html/group__module.html#gaa19497c3d949b3a93eaa13ed6df5d416) in your CMake code?
