# vtkGPUVolumeRayCastMapper and Qt (bug?)

**URL:** https://discourse.vtk.org/t/vtkgpuvolumeraycastmapper-and-qt-bug/1640
**Category:** Development
**Created:** [August 23, 2019, 10:16am UTC](https://discourse.vtk.org/t/vtkgpuvolumeraycastmapper-and-qt-bug/1640 "2019-08-23T10:16:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Romain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/romain/32/32_2.png) [@Romain](https://discourse.vtk.org/u/Romain)
#### Post date: [August 23, 2019, 10:16am UTC](https://discourse.vtk.org/t/vtkgpuvolumeraycastmapper-and-qt-bug/1640/1 "2019-08-23T10:16:55Z")

</div>

Hello everyone,

I’m working on Windows 10 1903, with Visual Studio 2017 (19.16.27031.1), VTK 8.2 and Qt 5.12.4.  
My graphic cards is a RTX 2080 Max-Q and the Nvidia driver version is 431.70.

I try to use vtkGPUVolumeRayCastMapper inside a Qt window.  
I test the example MedicalDemo4 by replacing vtkFixedPointVolumeRayCastMapper by vtkGPUVolumeRayCastMapper and it’s working great inside a VTK Window.

After that, I used the RenderWindowNoUiFile example and add the vtkVolume to the renderer.  
But I have the following error:

```auto
ERROR: In D:\LIBS\_sources\vtk\Rendering\OpenGL2\vtkTextureObject.cxx, line 1991
vtkTextureObject (00000226BA9BFEA0): failed at glCopyTexImage2D 33191 1 OpenGL errors detected
  0 : (1282) Invalid operation

```

I attached you the code that I used and also the CMake file (Maybe I miss some libraries but I’m not sure).

[main.cpp](https://discourse.vtk.org/uploads/short-url/eY0GauIRP1yIoGKzQLWhOLmMx79.cpp) (6.0 KB)  
[CMakeLists.txt](https://discourse.vtk.org/uploads/short-url/98DcgJn8ox3Riw6BFYI1fzPrEL6.txt) (1.7 KB)

Edit:

I print the Qt current context format (OpenGL seems well loaded):

```auto
QSurfaceFormat(version 3.2, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::sRGBColorSpace, profile QSurfaceFormat::CoreProfile)

```
