How do I select hardware OpenGL rendering for MATLAB on Linux

In my Ubuntu 20.04 I solved it with:

export MESA_LOADER_DRIVER_OVERRIDE=i965

This line can also be added to the /etc/environment file so that you don't have to do it again and again.


The first answers that turn up when searching for an answer to this question lead me to try and solve non-existent problems with the opengl libraries on my system. Other solutions proposed setting the option in the startup.m or matlabrc.m files, which didn't work for me.

It took way too long to find what seems like should be the first answer to pop up: Start matlab from the terminal with matlab -nosoftwareopengl.

Once it starts, running opengl info in matlab shows that hardware rendering is indeed selected.

Tags:

Matlab