# issue with vtkOpenGLRenderWindow on linux with vtk=9.1

**URL:** https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576
**Category:** Support
**Created:** [May 24, 2022, 3:18pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576 "2022-05-24T15:18:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lauramurgatroyd](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lauramurgatroyd/32/3910_2.png) [@lauramurgatroyd](https://discourse.vtk.org/u/lauramurgatroyd)
#### Post date: [May 24, 2022, 3:18pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576/1 "2022-05-24T15:18:23Z")

</div>

I am trying to run a minimal example with python and vtk which was adapted from [this link](https://kitware.github.io/vtk-examples/site/Python/Widgets/EmbedInPyQt/) but with PySide2 instead of Qt4.

This works fine on my windows machine, with any vtk 9.x.x version.

However, on linux I can run this with vtk \< 9.1, but with vtk 9.1.0 I get the following error:

```auto
Qt: Session management error: None of the authentication protocols specified are supported
2022-05-24 15:40:09.687 ( 0.590s) [CC1BB740]vtkOpenGLRenderWindow.c:493 ERR| vtkEGLRenderWindow (0x55732a7a9450): GLEW could not be initialized: Missing GL version
Segmentation fault (core dumped)

```

Any thoughts on why this is happening? Thank you.

Adapted example code:

```auto
import sys
import vtk
from PySide2 import QtWidgets
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
 
class MainWindow(QtWidgets.QMainWindow):
 
    def __init__ (self, parent = None):
        QtWidgets.QMainWindow. __init__ (self, parent)
 
        self.frame = QtWidgets.QFrame()
 
        self.vl = QtWidgets.QVBoxLayout()
        self.vtkWidget = QVTKRenderWindowInteractor(self.frame)
        self.vl.addWidget(self.vtkWidget)
 
        self.ren = vtk.vtkRenderer()
        self.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
        self.iren = self.vtkWidget.GetRenderWindow().GetInteractor()
 
        # Create source
        source = vtk.vtkSphereSource()
        source.SetCenter(0, 0, 0)
        source.SetRadius(5.0)
 
        # Create a mapper
        mapper = vtk.vtkPolyDataMapper()
        mapper.SetInputConnection(source.GetOutputPort())
 
        # Create an actor
        actor = vtk.vtkActor()
        actor.SetMapper(mapper)
 
        self.ren.AddActor(actor)
 
        self.ren.ResetCamera()
 
        self.frame.setLayout(self.vl)
        self.setCentralWidget(self.frame)
 
        self.show()
        self.iren.Initialize()
 
 
if __name__ == " __main__":
 
    app = QtWidgets.QApplication(sys.argv)
 
    window = MainWindow()
 
    sys.exit(app.exec_())

```

---

<div class="post-metadata">

### Author: ![lauramurgatroyd](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lauramurgatroyd/32/3910_2.png) [@lauramurgatroyd](https://discourse.vtk.org/u/lauramurgatroyd)
#### Post date: [May 26, 2022, 4:50pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576/2 "2022-05-26T16:50:23Z")

</div>

I forgot to mention that I installed vtk from conda-forge.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [May 26, 2022, 6:43pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576/3 "2022-05-26T18:43:01Z")

</div>

The Qt error message is probably a red herring. So let’s work on the hypothesis that the error is with OpenGL.

What OpenGL drivers are you using? You can find them with this command:

```
glxinfo | grep OpenGL

```

Does glxinfo give the same answer when you run it with your conda environment activates, as when you conda environment is not activated?

---

<div class="post-metadata">

### Author: ![lauramurgatroyd](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lauramurgatroyd/32/3910_2.png) [@lauramurgatroyd](https://discourse.vtk.org/u/lauramurgatroyd)
#### Post date: [June 8, 2022, 1:06pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576/4 "2022-06-08T13:06:02Z")

</div>

Hi,

The command gives the same result when I run it with either of my conda environments activated or not.

```auto

OpenGL Version String: 4.6.0 NVIDIA 430.40

```

The version of vtk I’m having trouble with is ` vtk 9.1.0 osmesa_py37h29869c8_108`  
The version I have which works is: `vtk 9.0.3 no_osmesa_py37hafc82d9_106`

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [June 8, 2022, 2:40pm UTC](https://discourse.vtk.org/t/issue-with-vtkopenglrenderwindow-on-linux-with-vtk-9-1/8576/5 "2022-06-08T14:40:45Z")

</div>

OpenGL 4.6 is definitely sufficient for VTK 9.1. To eliminate Qt as a possible source of the segfault, can you try a non-Qt VTK example like the [cylinder example](https://kitware.github.io/vtk-examples/site/Python/GeometricObjects/Cylinder/)?

You can also call `renderWindow.ReportCapabilities()` after the first Render to get more information about the VTK\<-\>OpenGL connection (assuming that the Render() doesn’t cause a segfault).

```python
    # Render and interact
    renderWindow.Render()
    print(renderWindow.ReportCapabilities())
    # The Start() is only for non-Qt apps
    renderWindowInteractor.Start()

```
