Hi,
I can display a VTK scene both on a Windows Remote machine through RDP (with no GPU), and on a local Windows machine. Through RDP, I managed to do this by loading GitHub - pal1000/mesa-dist-win: Pre-built Mesa3D drivers for Windows dlls. If I do not load these dlls, I get the message:
2025-07-24 22:50:48.412 ( 76.582s) [84168C5CCF6F0470]vtkWin32OpenGLRenderWin:661 ERR| vtkWin32OpenGLRenderWindow (000001ACAFEECD30): failed to get wglChoosePixelFormatARB
ERROR:root:failed to get wglChoosePixelFormatARB
2025-07-24 22:50:48.429 ( 76.598s) [84168C5CCF6F0470]vtkWin32OpenGLRenderWin:736 ERR| vtkWin32OpenGLRenderWindow (000001ACAFEECD30): failed to get valid pixel format.
ERROR:root:failed to get valid pixel format.
2025-07-24 22:50:48.443 ( 76.613s) [84168C5CCF6F0470]vtkOpenGLRenderWindow.c:804 WARN| vtkWin32OpenGLRenderWindow (000001ACAFEECD30): Failed to initialize OpenGL functions!
2025-07-24 22:50:48.450 ( 76.619s) [84168C5CCF6F0470]vtkOpenGLRenderWindow.c:819 WARN| vtkWin32OpenGLRenderWindow (000001ACAFEECD30): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue.
2025-07-24 22:50:48.474 ( 76.643s) [84168C5CCF6F0470]vtkOSOpenGLRenderWindow:137 WARN| osmesa.dll not found. It appears that OSMesa is not installed in your system. Please install the OSMesa library. You can obtain pre-built binaries for Windows from GitHub - pal1000/mesa-dist-win: Pre-built Mesa3D drivers for Windows. Ensure that osmesa.dll is available in PATH.
Now, when run on a local Windows machine, or a remote machine which has a GPU, I don’t want to always load these dlls because they greatly decrease the performance.
I thought I could programmatically determine whether the dll are needed or not (I’m in Python) using:
from vtkmodules.vtkRenderingCore import vtkRenderWindow
vtkRenderWindow().SupportsOpenGL()
But this always returns 0, locally and remotely through RDP until something happens regarding OpenGL, like for example after:
import vtk
In this case, the behavior will then differ locally and through RDP. Locally vtkRenderWindow().SupportsOpenGL() returns 1. Through RDP, and when mesa dll are not loaded, the error message above is displayed.
So the question is, how to programmatically determine if mesa dlls are needed to display a scene?
Thanks for your help.