Closed Xaraxia closed 1 year ago
In general, you cannot use a software-only Mesa implementation (including the swrast driver) as a back end for VirtualGL. It doesn't work and never has. There isn't any point to doing that anyhow, since VirtualGL's sole purpose is to redirect rendering to a GPU. If you're going to run MATLAB with software OpenGL, then don't use VirtualGL. If you're going to run MATLAB with VirtualGL, then don't use software OpenGL. Our User's Guide says as much: https://rawcdn.githack.com/VirtualGL/virtualgl/3.1/doc/index.html#hd0015
Should have checked the User Guide. Thanks for that, appreciate the fast response. Will add these instructions to our own user's guide.
I'm not sure if this is still the case, but back in the day, MATLAB would incorrectly enable software OpenGL by default if it detected that the X server had an extension named VNC-EXTENSION
. This caused it to always enable software OpenGL by default when running in a TurboVNC, TigerVNC, or RealVNC session, regardless of whether VirtualGL was used. IMHO, there is little or no justification these days for applications to provide their own OpenGL implementations. All actively supported Un*x distributions support OpenGL 4.6, to the best of my knowledge, and if for some reason your GPU driver doesn't (which isn't true for any GPU driver I'm aware of), then you can manipulate an environment variable to force the use of software OpenGL. If MathWorks insists on continuing to bundle its own OpenGL implementation, then they should at least change their detection logic so that software OpenGL isn't automatically enabled if VirtualGL is active. (VirtualGL can be detected by looking at the GLX vendor string.)
One of our academics found an interesting bug. When wrapping Matlab in vglrun, it works fine (so far, anyway) when you remember to tell it not to do software rendering. But if you run matlab with no arguments inside a vglrun-wrapped desktop environment, it defaults to OpenGL software render and you get the following as soon as you try to plot something:
We have a workaround (always disable software rendering), but I figured this is probably indicative of a bug somewhere, so I'd shoot it in your direction. It can be reliably reproduced.