Why is my Simulink Desktop Real-Time simulation slow or halts in Windows when Hyper-V is enabled?

I am trying to use Simulink Desktop Real-Time (SLDRT) on my Windows machine, but when I run the example model "sldrtex_vdp.slx", it runs slowly, halts, or may even cause a bluescreen. The following warning or error messages may be shown:
Warning: The "Real-Time Synchronization" block has timed out while trying to synchronize to real-time kernel.
------
Model sldrtex_vdp loaded
A disconnect message was sent to the target 10 seconds ago. Waiting for response.. [6 similar]
Never received disconnect response from target. Disconnecting...
Model sldrtex_vdp unloaded
------
Warning: The Hyper-V hypervisor has been detected. The Simulink Desktop Real-Time kernel cannot run in the presence of the hypervisor. Please disable the Hyper-V operating system component before attempting to use Simulink Desktop Real-Time.
------
Warning: The Hyper-V hypervisor has been detected. The Simulink Desktop Real-Time kernel is unable to run in the presence of the hypervisor. Please disable the Hyper-V operating system component before attempting to use Simulink Desktop Real-Time.

 Accepted Answer

Depending on the MATLAB release used, Simulink Desktop Real-Time (SLDRT) has different levels of compatibility with Microsoft Hyper-V:
  • In MATLAB R2022b and earlier, the SLDRT kernel is not compatible with Hyper-V or any features that rely on Microsoft virtualization technology (e.g., WSL/WSL2). If Hyper-V is enabled, SLDRT cannot load and start the real-time kernel, and you will see error messages indicating this failure. Disabling Hyper-V is mandatory when using MATLAB R2022b or prior versions. To run a virtual machine, you could, for example, use VMWARE.
  • In MATLAB R2023a and later, the SLDRT kernel includes support for Hyper-V. However, this does not guarantee full compatibility on all systems. In some cases, SLDRT may still fail to run correctly when Hyper-V is enabled. If you encounter issues such as halts, crashes, kernel load failures, or limited performance, you should disable Hyper-V as a troubleshooting step, even on newer releases. In some cases, enabling Hyper-V may even be necessary to use SLDRT R2023a and later, as explained in this MATLAB Answer.

Steps to disable Hyper-V:

Disable Hyper-V on your Windows 10 or Windows 11 PC by performing the following steps:
1. Find Turn Windows features on or off by using Windows search.
2. Clear the boxes for the following features, as shown in the screenshot below:
  • Hyper-V
  • Virtual Machine Platform
  • Windows Hypervisor Platform
  • Windows Subsystem for Linux
This operation begins the uninstall process.
3. Restart the computer as prompted after the uninstall process completes.

Further Troubleshooting:

If the above steps don't help, please see the following MATLAB Answers post for troubleshooting steps:

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!