# VTK 9.x without hardware OpenGL acceleration on Windows

**URL:** https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396
**Category:** Support
**Created:** [September 19, 2022, 8:48pm UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396 "2022-09-19T20:48:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bheld](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/8491ac/32.png) [@bheld](https://discourse.vtk.org/u/bheld)
#### Post date: [September 19, 2022, 8:48pm UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/1 "2022-09-19T20:48:58Z")

</div>

Is there a prescription for VTK 9.x and OpenGL1 (Mesa) now that the OpenGL1 backend in VTK has been removed? The build instructions at [https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md) really only discuss Mesa wrt Linux. Do we simply drop the Mesa dll(s) in the bin folder and run? Or do we configure the CMake build to use it somehow?

The docs on this are pretty thin.

Thanks!

---

<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: [September 20, 2022, 12:27am UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/2 "2022-09-20T00:27:48Z")

</div>

If you get a Mesa build on Windows, you’ll want to point VTK’s build at its SDK and libraries (that is, anything `FindOpenGL` wants should get the Mesa answers). If you’re doing Qt stuff, you’ll run into [this issue](https://bugreports.qt.io/browse/QTBUG-60742) and need to tell Mesa to ignore compat bits (workaround is discussed in that issue).

---

<div class="post-metadata">

### Author: ![bheld](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/8491ac/32.png) [@bheld](https://discourse.vtk.org/u/bheld)
#### Post date: [September 20, 2022, 11:19am UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/3 "2022-09-20T11:19:36Z")

</div>

Can you explain why this is necessary? A lot of documentation suggests just carefully naming and place dlls to make sure that mesa is loaded - and this seems to work. Does pointing VTK at Mesa’s SDK/libs result in a better (or faster) connection?

Our deployment scenario is one where most of our customer have sufficient support for OpenGL2, but some won’t and we want the code to switch to mesa in those limited cases. We do NOT want to deal with 2 different builds of VTK for this.

---

<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: [September 20, 2022, 11:52am UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/4 "2022-09-20T11:52:52Z")

</div>

If that works, sure, it’s worth doing. But it’s not something _I_ would necessarily trust to work in such a way without actual testing. It’s more about making sure that nothing is “leaking” around the “this is what OpenGL is” barriers and causing symbol mismatches or such.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dave_demarle/32/6_2.png) [@Dave\_DeMarle](https://discourse.vtk.org/u/Dave_DeMarle)
#### Post date: [September 20, 2022, 1:01pm UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/5 "2022-09-20T13:01:36Z")

</div>

As for getting a Mesa build on Windows, in the distant past I found this to be extremely helpful. [GitHub - pal1000/mesa-dist-win: Pre-built Mesa3D drivers for Windows](https://github.com/pal1000/mesa-dist-win)

hth

---

<div class="post-metadata">

### Author: ![Dean](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@Dean](https://discourse.vtk.org/u/Dean)
#### Post date: [January 6, 2023, 3:43am UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/6 "2023-01-06T03:43:36Z")

</div>

I am building vtk 9.2 rc4 static release build with a VS 2019 x64 toolchain. I have osmesa built  
using the buildscript in the git repo mentioned in this thread (mesa-dist-win). Configuring my  
build to be static with VTK\_OPEN\_GL\_HAS\_OSMESA gives the following cmake error:

> CMake Error at CMake/vtkOpenGLOptions.cmake:116 (message):  
> The `VTK_OPENGL_HAS_OSMESA` can’t be set to `ON` if any of the following is  
> true: the target platform is Windows, `VTK_USE_COCOA` is `ON`, or  
> `VTK_USE_X` is `ON` or `VTK_USE_SDL2` is `ON`. OSMesa does not support  
> on-screen rendering and VTK’s OpenGL selection is at build time, so the  
> current build configuration is not satisfiable.

Are there cmake variables that would allow specifying the include and lib dirs of the osmesa build ?  
How do I

> point VTK’s build at its SDK and libraries

---

<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: [April 24, 2023, 2:48am UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/7 "2023-04-24T02:48:52Z")

</div>

Support for OSMesa on Windows was merged [recently](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10095). The issue is that OSMesa and any other GL backend aren’t supported with a single build and before this, Windows assumed one would always want the Windows OpenGL implementation, so OSMesa just always conflicted.

---

<div class="post-metadata">

### Author: ![bheld](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/8491ac/32.png) [@bheld](https://discourse.vtk.org/u/bheld)
#### Post date: [May 3, 2023, 4:05pm UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/8 "2023-05-03T16:05:10Z")

</div>

Hi Ben B.,

Can you elaborate on exactly what this change improves?

Thanks

-Ben

---

<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: [May 3, 2023, 8:03pm UTC](https://discourse.vtk.org/t/vtk-9-x-without-hardware-opengl-acceleration-on-windows/9396/9 "2023-05-03T20:03:02Z")

</div>

OSMesa is an OpenGL implementation that can work without any GPU support. It doesn’t support on-screen rendering, but you can capture to images and write them out even if the machine lacks GL acceleration…
