Render window output is black when I use vtkGPUVolumeRayCastMapper python

Which CPU generation? Which NVidia GTX model? What operating system?

Default Qt surface format of VTK needs modifications depending on your hardware and operating system. See for example how it is set up in 3D Slicer: Intel UHD 620 + VTK + Qt bug with new drivers on windows