How can I run a batch program on Mac OSX that produces high quality figures when there is no display and no opengl?

2 visualizzazioni (ultimi 30 giorni)
I have a matlab script that creates high-quality 3-D figures (it uses export_fig). I would like to run this script as a cron job on Mac OS X yosemite. Because the Mac display isn't always on (it sleeps), I would like to use the "-nodisplay" option when launching matlab from cron. However, this generates the following warning: "Matlab cannot use OpenGL for printing when used with the nodisplay option." It still creates the figures, but they are of poor quality (for example, lines that should be continuous are now broken). Changing the renderer to painters and zbuffer produced the same effect.
/Applications/MATLAB_R2014b.app/bin/matlab -nodisplay -nosplash < mypath/myfile.m 1> mypath/mylog.out 2>&1
In the Matlab opengl documentation it states "Macintosh systems do not support software OpenGL." I tried "opengl hardware" and it generated the error: "Switching to hardware OpenGL rendering is not supported on the MAC platform".
If I try to run the script in cron with only the "-nosplash" option when the display is asleep, Matlab fails to start and exits with a segmentation violation: "PostVMInit failed to initialize com.mathworks.mwswing.MJStartupForDesktop" (adding -nojvm solves this issue, but then graphics don't work).
The script works correctly only if the Mac display is on (not asleep) and the "-nodisplay" and "-nojvm" options are not set.
Is there a workaround for this that doesn't involve leaving the display on all of the time?
  3 Commenti
Peter Gaube
Peter Gaube il 4 Ago 2015
Modificato: Peter Gaube il 4 Ago 2015
I've received the following info from Mathworks, it looks like it's a JAVA error and can't be fixed. I suggest leaving your monitor on.
I was working with my colleagues and we determined that this is an issue with Java on the Mac OS X. MATLAB uses Java 7 to obtain the the screen's device parameters which are not available when the display goes to sleep. You can obtain more information from the following bug report provided by Oracle:
The only workaround that I can provide you is to wait for MATLAB to initialize and then allow the display to sleep which was the one that I had mentioned in one of the earlier emails.
I apologize for the inconvenience caused. If you have any additional questions regarding this issue, please reply back to this email and I would be happy to answer them.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by