Unable to generate webview when -nodisplay option specified

8 visualizaciones (últimos 30 días)
Adam Austin
Adam Austin el 14 de Jun. de 2022
Comentada: Nihar Gandhi el 4 de Oct. de 2023
I am trying to generate a WebView in an environment where MATLAB is running without a display, i.e. launching MATLAB via:
matlab -nodisplay -nosplash -nodesktop create_webview
Where create_webview is just a wrapper around slwebview with my project's settings configured:
outfname = slwebview(systemp,'LookUnderMasks','all','FollowLinks','on',...
'FollowModelReference','on',... %Required for model reference
'SearchScope','All',... %Required to follow links within model reference
'ViewFile', false, 'ShowProgressBar', false);
The output of the script is:
Create the webview
Starting slwebview generation...
Error using slreportgen.webview.ui.Exporter/export
Simulink Web View is not supported in -nodisplay mode
Why must I have a display configured/enabled to generate the WebView? In Continuous Integration (CI) environments especially, it not possible to have a display configured.

Respuestas (1)

Karan Singh
Karan Singh el 4 de Oct. de 2023
Hi Adam,
From what I understand, the goal is to understand why a display is required to generate the web view and why this limitation exists, particularly in CI environments where having a display is not feasible.
This is because the Simulink Web View relies on graphical capabilities to generate and display the web view of the Simulink model. In “-nodisplay” mode, MATLAB does not have access to a display system, which is required for generating the web view. This limitation is not specific to Continuous Integration (CI) environments but is inherent to MATLAB's design.
If you need to generate a web view without a display, you can consider alternative approaches. For example, you could generate a report or documentation using MATLAB's Report Generator tools (such as MATLAB Report Generator or MATLAB Publishing) and include relevant information about your Simulink model.
Attached below are some documentation links that you may find helpful:
Hope this helps!
Karan Singh Khati
  2 comentarios
Adam Austin
Adam Austin el 4 de Oct. de 2023
Creating model web views also requires having an active display. It seems that almost any interaction that involves Simulink requires a display of some sort.
Our team was able to build a container with a virtual frame buffer (xvfb) running in the background to provide the necessary display support to Simulink.
Nihar Gandhi
Nihar Gandhi el 4 de Oct. de 2023
I've also had success creating a fake $DISPLAY using a vncserver on linux, which allows simulink to generate webviews.

Iniciar sesión para comentar.

Categorías

Más información sobre Create Model Web Views en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by