# CylinderExample vtkXOpenGLRenderWindow error in C++

**URL:** https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953
**Category:** Support
**Created:** [June 7, 2021, 5:06pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953 "2021-06-07T17:06:56Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 7, 2021, 5:06pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/1 "2021-06-07T17:06:56Z")

</div>

I’m running Ubuntu 20.04 on WSL. I succesfully compile the [CylinderExample](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/), and get the following errors at runtime.

```
2021-06-04 19:05:43.417 ( 0.009s) [A4169740]vtkXOpenGLRenderWindow.:251 ERR| vtkXOpenGLRenderWindow (0x55ef95e7e380): Could not find a decent config

2021-06-04 19:05:43.417 ( 0.009s) [A4169740]vtkXOpenGLRenderWindow.:468 ERR| vtkXOpenGLRenderWindow (0x55ef95e7e380): Could not find a decent visual
```

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 7, 2021, 5:18pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/2 "2021-06-07T17:18:01Z")

</div>

Are you running it inside a graphical interface (X) or are you headless?

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [June 7, 2021, 5:17pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/3 "2021-06-07T17:17:11Z")

</div>

You’ll need to install an xserver before you can run graphical programs in WSL.  
There are instructions on the internet on how to do that.

Not that the installed server uses software rendering so they will be slower than using your graphics card.  
Note that you can run VTK directly on Windows though.

Dan

---

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 7, 2021, 5:19pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/4 "2021-06-07T17:19:22Z")

</div>

I have Ximing Xserver installed and running, and I can successfully Render xclock and OpenGL examples from Ubuntu.

And I also I have the libx11-xcb1 and the libx11-xcb-dev libraries installed on the Ubuntu distro.

---

<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 7, 2021, 9:22pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/5 "2021-06-07T21:22:56Z")

</div>

I’m very doubtful that Xming has sufficient OpenGL capabilities for VTK applications. What version of OpenGL does it show when you run `glxinfo`? It should report something like this:

```nohighlight
OpenGL version string: 4.5

```

I wonder if `xvfb-run` might be a better solution.

---

<div class="post-metadata">

### Author: ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)
#### Post date: [June 7, 2021, 9:59pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/6 "2021-06-07T21:59:09Z")

</div>

If anyone has specific instructions/experience successfully running ParaView/VTK with WSL, I would be very interested - it would avoid dual-boot with linux headaches.

---

<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 7, 2021, 10:17pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/7 "2021-06-07T22:17:30Z")

</div>

I just tried running paraview within xvfb, and it seems to run perfectly (this is on an actual linux box, not WSL, but that shouldn’t make a difference). Using xvfb to run glxinfo gives me the following, which shows the capabilities of the software OpenGL renderer that xfvb uses:

```bash
$ xvfb-run glxinfo | grep OpenGL
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 11.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.2.6
OpenGL shading language version string: 1.40

```

If something is running in xvfb, it is possible to pipe it out via vnc. As a very crude test with paraview, I did this:

```bash
xvfb-run -n 99 -f /tmp/Xauthority.99 /path/to/paraview &
x11vnc -display :99 -auth /tmp/Xauthority.99 &

```

From there, I could use a VNC viewer to connect to x11vnc over port 5900, and thereby view and control paraview.

I’m sure that there are tidier ways of putting xvfb and vnc together, but the above serves as a proof-of-concept.

---

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 7, 2021, 10:49pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/8 "2021-06-07T22:49:55Z")

</div>

> server glx version string: 1.2  
> client glx version string: 1.4  
> GLX version: 1.2  
> Max core profile version: 4.5  
> Max compat profile version: 3.1  
> Max GLES1 profile version: 1.1  
> Max GLES[23] profile version: 3.2  
> OpenGL version string: 3.1 Mesa 20.2.6  
> OpenGL shading language version string: 1.40

---

<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 7, 2021, 11:26pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/9 "2021-06-07T23:26:13Z")

</div>

The OpenGL version looks sufficient, but the glx version does not:

> [@](#):
>
> server glx version string: 1.2

I recall that VTK has required glx 1.3 or higher since around 2003.

---

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [June 8, 2021, 12:31am UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/10 "2021-06-08T00:31:34Z")

</div>

If you’re looking for offline software renders (no GUI or display) install these:

```
sudo apt install mesa-common-dev libosmesa6-dev libglu1-mesa-dev

```

Then build VTK with OSMESA.

XServer’s definitely the way to go for GUI right now. But Microsoft is working on GPU and GUI support for WSL 2.0! I believe it’s in their insider program still. Would be very interested in seeing VTK work on there. Also seeing it with EGL for headless.

---

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 8, 2021, 2:57am UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/11 "2021-06-08T02:57:12Z")

</div>

I want to be able to display GUIs for debugging. Should I still install: mesa-common-dev, libosmesa6-dev and libglu1-mesa-dev?

---

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [June 8, 2021, 3:42am UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/12 "2021-06-08T03:42:04Z")

</div>

no. XServer is the way to go if you want GUI.

---

<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, 2021, 3:53am UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/13 "2021-06-08T03:53:47Z")

</div>

With the understanding that you can either:

1. Run the xserver on the windows side, but for VTK 9 you will require an xserver that provides glx 1.4
2. Run the xserver on the linux side, and use e.g. vnc to do the remote viewing
3. Wait until Microsoft provides their own solution to for a WSL GUI

---

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 8, 2021, 7:06pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/14 "2021-06-08T19:06:48Z")

</div>

So if I just want to do local visualizations, I shouldn’t need to setup VNC?

---

<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, 2021, 7:50pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/15 "2021-06-08T19:50:44Z")

</div>

No, I’m pretty sure that you do need vnc. Because if you use xvfb to create a local xserver like in my paraview example above, then you still need some way to view the xvfb framebuffer. That’s where vnc comes in.

It’s possible to run a full X session inside xvfb, which will give you a complete linux desktop that you can connect to via vnc.

---

<div class="post-metadata">

### Author: ![felmoreno1726](https://discourse.vtk.org/user_avatar/discourse.vtk.org/felmoreno1726/32/3534_2.png) [@felmoreno1726](https://discourse.vtk.org/u/felmoreno1726)
#### Post date: [June 9, 2021, 4:03pm UTC](https://discourse.vtk.org/t/cylinderexample-vtkxopenglrenderwindow-error-in-c/5953/16 "2021-06-09T16:03:10Z")

</div>

Using VcXsrv I got it to work!
