Have you installed the matlab-support
package? Without it, at least on my workstations with a Radeon Pro WX5100 GPUs and Ubuntu 20.04 + MATLAB 2020a, MATLAB’s hardware OpenGL always fails by default.
sudo apt-get install matlab-support
You point it to where your MATLAB is installed, and agree for it to replace the C++ libs[1], and then hardware OpenGL works fine, check using opengl info
in MATLAB.
If you update MATLAB, you will need to reapply this, which requires a purge then reinstall:
sudo apt-get purge matlab-support
sudo apt-get install matlab-support
[1] I’m not sure if this is strictly necessary, this problem was supposed to be fixed, but I just always do it anyway…