02-11-2016 06:14 AM
I am trying to automate the netlist generation of my Simulink model with System Generator blocks using the command line in "headless" mode (Matlab arguments: --nojvm --nodesktop)
I am using the xlGenerateButton command in a Matlab script to trig the generation, however I get the following error:
WES: Headless System Value is true. Exception will be throuwn
Error using xlGenerateButton>setupWaitBox (line 681)
Java exception occurred:
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
Error in xlGenerateButton (line 104)
Is there someone who know how to avoid the usage of graphical windows for the netlist generation?
In case it matters, I use Matlab R2013b together with ISE 14.7 on a 64 bit Linux kernel.
Kind regards Torben
06-15-2018 01:24 AM
06-19-2018 01:52 AM
Ok, so I found a solution that kind of works.
My previous idea with xvfb is also very valid, but MATLAB crashes as the xrandr refresh rate is returned as 0. This was a known bug in Qt (probably this one https://codereview.qt-project.org/#/c/140411/) and fixed in 2015. Looks like MATLAB ist still using the buggy version.
One alternative is to use a vnc server to provide the graphical display required by Xilinx System Generator. I decided for tigervnc, and my script looks like this:
#!/bin/bash vncserver :98 -SecurityType:None -noxstartup -useold export DISPLAY=:98 sysgen -r "run('script.m')" ERROR_CODE=$? vncserver -kill :98 exit $ERROR_CODE
This script is integrated in our continous integration process (that's why sysgen error code is stored and forwarded to the caller). It works ok.
There obviously is the security issue that any local user can now access the VNC server when running, but it's not a concern in our build environment. Actually this "feature" can be used to debug failed CI runs.
Hope this helps others out there...