I recently downloaded MATLAB R2015a on my ubuntu 14.04 virtualbox. When I try to run it, I get the blue matlab logo screen and the following error in terminal:

libGL error: unable to load driver: swrast_dri.so

libGL error: failed to load driver: swrast

MATLAB is selecting SOFTWARE OPENGL rendering

When I try to run it as a superuser, I get a licensing error. I'm pretty new to ubuntu and linux in general--let me know if you can help.

  • Do you have a video card capable of running open-gl? (there are many ways to check this... here is an example). If so, run matlab -nosoftwareopengl in a terminal to run Matlab in a hardware mode. Let's see what results. – user308164 Jun 18 '15 at 15:01
  • I have Innotek systemberatung gmbh virtualbox--I'm still having trouble figuring out if it's capable of running open-gl. I tried running matlab -nosoftwareopengl and got the two libGL errors again but not the last line. Again, the matlab logo screen opens. – Asker Jun 18 '15 at 15:31

You need to link the libstdc++ library used by Matlab with the one installed in the system.

At the terminal type the following:

  sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 /usr/local/Matlab/R2015a/sys/os/glnxa64/libstdc++.so.6

You may need to adjust the path to take into account where Matlab is installed in your system. This solved the problem for me.

  • This seems to have fixed the libGL errors. Thanks! But I'm still getting "MATLAB is selecting SOFTWARE OPENGL rendering" and the logo screen that doesn't open. – Asker Jun 18 '15 at 18:13
  • You can try to start Matlab using matlab -nodesktop from the terminal and then issue opengl('save','hardware') at the command prompt and then restart. – Harris Jun 18 '15 at 21:08
  • I get: MATLAB:settings:core:NoWritePermissionOnDirectory Internal Error: No write permission on directory /home/abigail/.matlab/R2015a/temp0x3150x97b. Details: fl:filesystem:AccessDenied.. when I run 'matlab -nodesktop. – Asker Jun 18 '15 at 23:04
  • Also afterwards when I enter opengl('save', 'hardware') I get: MATLAB:dispatcher:loadLibrary Can't reload '/usr/local/MATLAB/R2015a/bin/glnxa64/libmwhgbuiltins.so'. Caught MathWorks::System::FatalException – Asker Jun 19 '15 at 3:06

I had the same issue with MATLAB not starting up and having only the blue logo display. When I tried running matlab from the terminal, I got the same MATLAB is selecting SOFTWARE OPENGL rendering error message.

Trying matlab -nodesktop started up, but gave me the same error message the OP described in the comments to Harris's answer.

To fix this, go to your home directory then into you .matlab folder and make sure that all subfolders and files in that directory are owned by your username, not by root.

To change ownership, use sudo chown username:group folder where username and group are default to your Ubuntu login username.

For example, in OP's case it would be:

sudo chown abigail:abigail /home/abigail/.matlab/R2015a

The same goes for any files and subfolders inside of the R2015a folder

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.