It seems that the "Model Composer Hub" block attempts to open a window by using the MATLABWindow feature, which fails.
Test that the MATLABWindow feature is operational for your MATLAB installation by running:
>> !./MATLABWindow -url=mathworks.com
If the above commands open a window showing the MathWorks website successfully, then the issue lies with the third-party product "Vitis Model Composer" which is developed by Xilinx/AMD and is external to MathWorks. We recommend contacting Xilinx support for further help. Below are some solutions that have unblocked other users who encountered the error:
Option 1: Check Model Composer, MATLAB & OS versions
- Ensure that you are using a version of Vitis Model Composer that is supported with your current version of MATLAB.
- Ensure that you are using an exact Linux distribution that is supported by both Vitis Model Composer and MATLAB.
- Use the latest possible version of Vitis Model Composer for your current version of MATLAB.
This MATLAB Answer has more details on Model Composer & MATLAB and OS compatibility:
Option 2: Modify LD_LIBRARY_PATH defined in MATLAB session
One user also reported the following workaround:
When starting MATLAB via Model Composer, the LD_LIBRARY_PATH looks as follows for their R2022b installation:
>> oldpath = getenv("LD_LIBRARY_PATH")
'/usr/local/MATLAB/R2022b/sys/os/glnxa64:/usr/local/MATLAB/R2022b/bin/glnxa64:/ ... '
After opening the Model Composer Simulink model, the path changes to:
>> newpath = getenv("LD_LIBRARY_PATH")
'/tools/Xilinx/Vivado/2023.2/lib/lnx64.o:/usr/local/MATLAB/R2022b/sys/os/glnxa64:/ ... '
So Model Composer modifies the LD_LIBRARY_PATH by adding /tools/Xilinx/Vivado/2023.2/lib/lnx64.o with the highest priority (first path). With this configuration, opening the "Vitis Model Composer Hub" block in the model will fail.
After they reverted the LD_LIBRARY_PATH manually with "setenv":
>> setenv("LD_LIBRARY_PATH", oldpath)
then they could open the "Model Composer Hub" window without error.
If this works, you could consider adding the call to "setenv" to either a model callback or block callback, so you don't always have to run it manually:
(which callback may work depends on where Xilinx places the call that modifies LD_LIBRARY_PATH, which we are not aware of).