[Mesa-users] Enable OpenGL software rendering on macOS

Martin Pernollet martin.pernollet at protonmail.com
Tue Mar 29 09:00:32 UTC 2022


TLDR : I failed using Mesa software rendering on macOS. I am looking for advice to invoke mesa's libGL.dylib without relying on macOS's system GL.

Hi everyone,

I am building (java) software involving Mesa for CPU rendering. I use CPU rendering as fallback when JOGL (OpenGL binding for Java) fail to use the GPU natively. This is sometime the case for old Linux distributions, this will certainly be frequent on macOS in the future due to Apple's OpenGL deprecation.

Mesa CPU rendering is working great on Ubuntu (by enabling LIBGL_ALWAYS_SOFTWARE=true) and Windows (by simply loading Mesa's DLL instead of system DLL, no need to ask for software mode).

I however thrive to use Mesa's software rendering on macOS for the following reasons

- Spying dynamic library load sequence shows that whenever Mesa's libGL.dylib is loaded, Apple Metal and libGL.dylib are loaded after, even when using DYLD tricks to ensure Mesa get loaded after any other library (except the Java VM) [1] Someone says that Mesa's macOS implementation relies on system GL [4]. I noticed that when enabling LIBGL_ALWAYS_SOFTWARE=true, this activates Apple software rendering but not Mesa's software rendering [5].I wonder how I could avoid this and use a pure Mesa's OpenGL implementation in this situation.
- When getting out of the java World

- Running a pre-built glxgear/glxinfo installed through MacPorts only allows using Apple's libGL.dylib but not Mesa's libGL.dylib [2].
- Building glxinfo myself by linking explicitely to Mesa's GL + X11 lead to an X11 error that I am not able to depict [3].

This has been discussed already on Khronos community [1] but I have no clue how to go further. I hope some experts here can help me solve this!

Thanks in advance,

Martin

[1] https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408
[2] https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/14
[3] https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/19
[4] https://community.khronos.org/t/how-to-use-opengl-on-zink-mesa-moltenvk-and-macos/108160/18
[5] https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-of-macos-provided-opengl-library/108408/17
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-users/attachments/20220329/f6b042e1/attachment.htm>


More information about the mesa-users mailing list