Instructions Wanted for Building VTK apps with Software Rendering on Windows

I have a VTK application which I want to run on Windows 11 without a GPU. Currently, starting it causes an immediate crash due to lack of OpenGL:

Failed to load opengl32sw (The specified module could not be found.)
Failed to load and resolve WGL/OpenGL functions
qt.qpa.gl: Software OpenGL failed. Falling back to system OpenGL.
QOpenGLWindow::beginPaint: Failed to create context
QOpenGLWindow::beginPaint: Failed to make context current
2026-01-08 08:03:23.076 (   0.117s) [18B4C5461F3729CD]vtkOpenGLRenderWindow.c:704    ERR| vtkGenericOpenGLRenderWindow (000001500D579BF0): GLEW could not be initialized: Missing GL version
QOpenGLFunctions created with non-current context

This application typically only renders relatively simple 3D geometries on the screen, so it had no problems working via LLVMpipe on Linux. I also tried providing an old copy of opengl32sw.dll prebuilt by Qt here, but GLEW still couldn’t be initialized, perhaps because the GL version was not supported?

Qt + VTK + OpenGL software rendering on Windows is an arcane topic and poorly documented and discussed anywhere online, so I have no idea how the same can be achieved on Windows. Does anyone know anything about it?

Thanks in advance.

Problem solved.

You need these DLLs from Mesa. For 64-bit applications, make sure all DLLs are from Mesa 64-bit (opengl32.dll , like Win32, is a legacy name for both 32-bit and 64-bit systems):

  • libgallium_wgl.dll
  • opengl32.dll
  • mesadrv.dll
  • dxil.dll

The application should start directly.

The proprietary re-distributable DirectX IL file dxil.dll is needed, because Mesa by default uses the GLonD3D12 backend. In case you don’t want any proprietary libraries, you can omit the file and use the LLVMpipe backend instead. Start PowerShell with:

$env:GALLIUM_DRIVER=”llvmpipe”

In both cases, 3D graphics is working now.

More information can be found at: GitHub - pal1000/mesa-dist-win: Pre-built Mesa3D drivers for Windows

A good way to check is to use the “system-wide deployment” script to deploy Mesa system wide to see whether the application starts. If so, you can figure out the needed DLLs, drivers, and environmental variables later.

https://discourse.paraview.org/t/how-to-run-paraview-including-the-binary-release-using-mesa-on-windows/4321