Low Performance when model is run from Simulink

조회 수: 5 (최근 30일)
Matteo Bordignon
Matteo Bordignon 2023년 2월 8일
댓글: Matteo Bordignon 2023년 2월 9일
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.

답변 (1개)

Smit
Smit 2023년 2월 9일
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”.
You can visit the documentation page for GPU Coder for more information.
  댓글 수: 1
Matteo Bordignon
Matteo Bordignon 2023년 2월 9일
Thank you for your answer.
I had already tried GPU Coder but it seems to be doing more harm than good; the time to compile grew exponentially and the animation was incredibly slow. Moreover, from the Task Manager I could still see that the dedicated GPU was turned off.
I don't think this can be a solution since when I save the model without enabling GPU Acceleration and run the simulation from the Command Window, it should use the 'normal' coder and it activates the GPU correctly.
Do you have any other idea?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by