MATLAB crash when running external toolbox with real-time model integration
6 次查看(过去 30 天)
显示 更早的评论
I'm encountering a consistent crash in MATLAB when running a toolbox(called ARTEMiS, part of the OPAL-RT RT-LAB environment) that performs real-time simulation model integration. The crash occurs shortly after calling certain high-level functions from the toolbox.
MATLAB is giving the following crash logs:
------------------
Illegal instruction detected at 2025-06-30 03:52:40 +0200
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Graphics card 1 : Microsoft ( 0x0 ) Microsoft Remote Display Adapter Version 10.0.19041.5794 (2006-6-21)
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA NVS 300 Version 9.18.13.4135 (2015-1-9)
Interpreter 0 : Executing request: 736C5F73696D2F44656661756C7453696D756C6174696F6E457865637574696F6E496E7374616E63652E637070
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 8786299
MATLAB Root : C:\Program Files\MATLAB\R2023b
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Microsoft Windows 10 Enterprise
Process ID : 604
Processor ID : x86 Family 6 Model 58 Stepping 9, GenuineIntel
Window System : Version 10.0 (Build 19045)
Fault Count: 1
Abnormal termination:
Illegal instruction
The toolbox requires 64-bit processor. The crash logs indicate the processor is x86 Family 6 Model 58 Stepping 9, GenuineIntel. However, when double checking in system information, the processor is given as intel i7-3770. I suspect the issue is probably due to the fact MATLAB misintepreted the processor type on the workstation somehow. By the way, the same simulink model can run on other PCs therefore it is not due to the model itself. Has anyone ever met similar issues or can provide any possible solutions? Thanks!
1 个评论
Shlok
2025-7-18
Hi,
"Family 6 Model 58 Stepping 9, GenuineIntel" is the internal CPUID signature that MATLAB reads from the processor. For an Intel i7-3770, this is actually the expected CPUID.
Could you please share the complete stack trace from the MATLAB crash log?
回答(1 个)
Ruchika Parag
2025-7-21
Hi @Diran, the crash you are encountering—triggered by an “Illegal instruction” error—is likely due to the use of unsupported CPU instructions by Intel’s Math Kernel Library (MKL), which MATLAB relies on internally. Although your Intel i7-3770 is a 64-bit processor, it does not support certain advanced instruction sets (e.g., AVX) that some MKL versions may attempt to use by default.
This issue has been observed in other MATLAB environments, particularly when MKL is allowed to use higher-level optimizations incompatible with the hardware.
Recommended Workaround
To resolve this, you can restrict MKL to use an instruction set supported by your CPU (SSE4.2), and disable MATLAB’s automatic CPU dispatching logic. This is done by setting two environment variables:
Option 1: Temporary (per session)
Run these commands in the Command Prompt before starting MATLAB:
set MKL_CBWR=SSE4_2
set MATLAB_DISABLE_CBWR=1
Option 2: Permanent (set system-wide using PowerShell):
setx MKL_CBWR "SSE4_2"
setx MATLAB_DISABLE_CBWR "1"
After setting the variables, restart MATLAB and re-run your ARTEMiS toolbox workflow. Additionally you can try the following:
- Ensure that MATLAB is using its bundled MKL and not a system-wide version that may have been installed separately.
- Verify that no third-party software has replaced or interfered with MATLAB’s internal DLLs (e.g., mkl_rt.dll).
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!