A while ago I wanted to use the functionality of opengl 4.5+ on my mac, so I installed mesa with macports, and it worked. Recently, however, I tried to use my code again and it said that these versions of opengl are not supported.

I tried running glxinfo, and it seems to be telling me that my renderer is the default intel provided renderer.

The last time it worked was a reasonably long time ago, and it is likely that the reason for the switch is that when I restarted my computer at some point it switched back to the old version. I don't know exactly when it stopped working.

What I want to figure out is how to switch to the mesa version. I checked with macports and even looked at the files internally, and mesa is installed and updated to version 17.1.6, which is the latest version supported by macports. I can't find anything anywhere on how to change the renderer used by my computer. I think it has something to do with libGL maybe, but I can't find any information on how to change or even view libGL's environment variables.

How can I switch to the mesa renderer?

This is made especially difficult because I can't trust that the information from glxinfo is correct. Both mesa and the default intel renderers have their own versions of glxinfo, which may give information that is different from what the current opengl actually running on the system is. I'm not sure which one I am actually running when I run glxinfo with terminal, or how to find the executable for the mesa version.

EDIT: I have looked a little more, and it seems like I can control which version is used during context creation and API loading, but that requires manually doing those things, which is not something I really want to do. Currently, I have only tested this with JOGL, and I can't find anything on what it uses to create a context. I don't know if glfw will use the mesa version, but glew did install in the directory for the mesa/X version and not the core version that I think JOGL is using. It did work before with JOGL, so clearly there is some system wide default setting that can change this, and I would like to know what that is.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.