Low Performance when model is run from Simulink
8 views (last 30 days)
Show older comments
I'm trying to run a model developed in Simulink, that outputs a "real time" animation.
When I open the model and run it from the Simulink window with the Run button, the animation is laggy and misses some feature, for example the Figure where it should be displayed doesn't open automatically.
However, when I don't open simulink and run the model from the Command Line direcly as
>> sim('ModelName.slx')
it works perfectly, with high frame rate and automatically opens the Figure.
From looking at the Task Manager, it seems that when the model is run with Simulink open, my laptop uses the integrated GPU, while in the other case it defaults to the (more powerful) dedicated GPU.
In the Graphics Settings, MATLAB is listed as "High Performance", meaning it will use the dedicated GPU, as it does. I tried to set the same parameter for Simulink, but I don't seem to find an executable so that I can add it to the program list (it probably hasn't got one since it stays 'under' the Matlab icon).
Does anyone has an idea how to solve this?
Thanks.
0 Comments
Answers (1)
Smit
on 9 Feb 2023
Hi,
I understand you are observing low performance while running your model in Simulink. You have set your GPU to accelerate MATLAB’s executable, but it is not picking up the Simulink GUI.
You can set MATLAB and Simulink to use GPU acceleration as well.
For Simulink, you can use the GPU Coder to accelerate your model simulations. In the Simulink GUI, you can go to “Model Configuration Parameters” (Ctrl+E). In the “Simulation Target” section, you can select the “GPU acceleration” option and configure any additional parameters according to your requirements in the “GPU Acceleration” tab under “Simulation Target”.
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!