Matlab API compatible with Windows 10?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Michael Poppo
Posts: 6
Joined: Thu Aug 20, 2015 9:44 am

Matlab API compatible with Windows 10?

Post by Michael Poppo » Mon Jul 10, 2017 12:44 pm

Hello,

I have recently purchased a new laptop for running OpenSim simulations quicker and am a user of the Matlab API interface regularly. I have moved all my scripts from my old system (which runs Windows 7) to my new system (which runs Windows 10 pro). I was able to configure OpenSim and work with everything properly, however when I run simulations, such as IK, from API I get an error randomly during the run (sometimes early sometimes when it is nearly complete). The error message is: "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." It seems the problem may lie somewhere with the API because there is no Matlab crash report and I can find nothing wrong with my Windows installation or files. I have already contacted Windows and Matlab support. Is this a known issue? What should I do?

Thank you

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Matlab API compatible with Windows 10?

Post by Christopher Dembia » Mon Jul 10, 2017 1:10 pm

Could you provide any additional details? Perhaps the log of the tool, to see better exactly at which point the crash occurs? What version of MATLAB are you using? Are you using 32-bit or 64-bit Windows, MATLAB, OpenSim, etc.?

User avatar
Michael Poppo
Posts: 6
Joined: Thu Aug 20, 2015 9:44 am

Re: Matlab API compatible with Windows 10?

Post by Michael Poppo » Mon Jul 10, 2017 3:05 pm

I am using Matlab R2016a (I have also tried R2017a) and OpenSim 3.3. 64 bit everything. What do you mean by the log of the tool? The output log I assume is what you asked for:

Constructing tool from setup file IKSetup.xml

Loaded model EMP-noexo from file model.osim
MODEL: EMP-noexo
coordinates: 25
forces: 8
actuators: 8
muscles: 8
analyses: 0
probes: 1
bodies: 21
joints: 20
constraints: 2
markers: 35
controllers: 0
contact geometries: 0
misc modelcomponents: 0
Running tool e-noexo.
Loaded marker file (markerFile).trc (35 markers, 414 frames)
Frame 0 (t=0): total squared error = 0.00668753, marker error: RMS=0.0138229, max=0.0492962 (RIGHT_THIGH_FRONT)
Frame 1 (t=0.00833333): total squared error = 0.00674495, marker error: RMS=0.0138821, max=0.0500418 (RIGHT_THIGH_FRONT)
...
Frame 78 (t=0.65): total squared error = 0.00397986, marker error: RMS=0.0106635, max=0.0245835 (LEFT_HIP_UPPER)

That is all that is in the out log. It just stops randomly (should got to ~400 frames). The err log is empty.

Thanks and let me know if there is anything else I can provide.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Matlab API compatible with Windows 10?

Post by Christopher Dembia » Tue Jul 11, 2017 8:42 am

Could you share a minimal working example that produces this issue? If you invoke the tools using the command-line executable, you will likely avoid these issues.

Did the same exact MATLAB code work without issue on your previous machine?

Does MATLAB crash? If so, this could be a memory management bug with the API. If you share a minimal example, we might be able to pinpoint which line is causing the issue.

User avatar
Michael Poppo
Posts: 6
Joined: Thu Aug 20, 2015 9:44 am

Re: Matlab API compatible with Windows 10?

Post by Michael Poppo » Wed Jul 12, 2017 9:50 am

Essentially the code that I am running is

com = 'ik -S IKSetupTool.xml';
system(com);

However, sometimes it makes it all the way through the IK and sometimes it does not (more often not). The exact same code did work on my previous machine. MATLAB does not crash. I know my new machine has 16 GB RAM but memory management sounds like it could be the problem.

I appreciate the help, if you would like to email me I could maybe send you a little more detailed code.
mnpoppo@ncsu.edu

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Matlab API compatible with Windows 10?

Post by Christopher Dembia » Wed Jul 12, 2017 10:44 am

Can you try running

Code: Select all

ik -S IKSetupTool.xml
in a command prompt (that is, cmd.exe) or PowerShell, without MATLAB? Do you encounter the same issue?

User avatar
Michael Poppo
Posts: 6
Joined: Thu Aug 20, 2015 9:44 am

Re: Matlab API compatible with Windows 10?

Post by Michael Poppo » Sat Jul 22, 2017 1:43 pm

Sorry for the slow reply, I was able to run that in the command prompt and it worked fine with no errors.

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: Matlab API compatible with Windows 10?

Post by Thomas Uchida » Sat Jul 22, 2017 4:41 pm

I have recently purchased a new laptop for running OpenSim simulations quicker and am a user of the Matlab API interface regularly. ... Essentially the code that I am running is com = 'ik -S IKSetupTool.xml'; system(com);
The system() command does not use the OpenSim MATLAB API (the OpenSim Tool is simply executed as if it were run from the command line). There may be issues with using the system() command this way (see, for example, the discussion here: https://blogs.mathworks.com/community/2 ... om-matlab/). You may have better luck using the MATLAB API:

Code: Select all

import org.opensim.modeling.*;
iktool = InverseKinematicsTool('IKSetupTool.xml');
iktool.run();
Also see the "Scripting with Matlab" page in the Confluence documentation (http://simtk-confluence.stanford.edu:80 ... ith+Matlab).

User avatar
Michael Poppo
Posts: 6
Joined: Thu Aug 20, 2015 9:44 am

Re: Matlab API compatible with Windows 10?

Post by Michael Poppo » Mon Jul 24, 2017 10:23 am

After implementing your recommended code, the program ran successfully but I did still experience the same issue. I did discover something that may help to diagnose the issue. When running API on my old system, I would often encounter a dialogue box that said "MATLAB has encountered an internal problem and needs to close". Clicking any option in this dialogue box would close MATLAB however if I simply ignored it I could continue working normally which is what I would normally do. I have not yet experienced this issue on the new system. Could it be the root of the current issue?

These are the details from the error on the old system.

MATLAB crash file:C:\Users\Michael\AppData\Local\Temp\matlab_crash_dump.7072-1:


------------------------------------------------------------------------
Assertion detected at Thu Jul 20 13:59:38 2017
------------------------------------------------------------------------

Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown software
Default Encoding : windows-1252
Graphics card 1 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics Family Version 8.15.10.2321
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA NVS 4200M Version 9.18.13.1269
Host Name : Michael-THINK
Java Crash Report : C:\Users\Michael\AppData\Local\Temp\hs_error_pid7072.log
MATLAB Architecture : win64
MATLAB Root : C:\Program Files (x86)\MATLAB\2016a
MATLAB Version : 9.0.0.341360 (R2016a)
OpenGL : software
Operating System : Microsoft Windows 7 Professional
Processor ID : x86 Family 6 Model 42 Stepping 7, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 6.1 (Build 7601: Service Pack 1)

Fault Count: 1


Assertion in void __cdecl `anonymous-namespace'::mwJavaAbort(void) at b:\matlab\src\jmi\jmi\javainit.cpp line 1389:
Fatal Java Exception. See Java Crash Report for details.

Register State (captured):
RAX = 00000000fe9dd001 RBX = 0000000000000000
RCX = 000000005f96a100 RDX = 0000000000000000
RSP = 000000005f969c70 RBP = 0000000011b2d8a0
RSI = 000000005f96a740 RDI = 00000000fe9ccfb8

R8 = 000007fffff94000 R9 = 000007fedb040000
R10 = 00000000fe9cd008 R11 = 00000000fe9cd008
R12 = 0000000011b2d8a0 R13 = 0000000000000010
R14 = 00000000fe9dd088 R15 = 00000000fe9dd008

RIP = 00000000fe80961a EFL = 00000202

CS = 0033 FS = 0053 GS = 002b

Stack Trace (captured):
[ 0] 0x00000000fe80961a C:\Program Files (x86)\MATLAB\2016a\bin\win64\libmwfl.dll+00103962
[ 1] 0x00000000fe805b58 C:\Program Files (x86)\MATLAB\2016a\bin\win64\libmwfl.dll+00088920
[ 2] 0x00000000fe8054a7 C:\Program Files (x86)\MATLAB\2016a\bin\win64\libmwfl.dll+00087207
[ 3] 0x00000000fe809068 C:\Program Files (x86)\MATLAB\2016a\bin\win64\libmwfl.dll+00102504
[ 4] 0x0000000011acffc7 C:\Program Files (x86)\MATLAB\2016a\bin\win64\jmi.dll+00589767
[ 5] 0x000000006e127b6d C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02390893
[ 6] 0x000000006e110ad8 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02296536
[ 7] 0x000000006e1288e6 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02394342
[ 8] 0x000000006e12c2d8 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02409176
[ 9] 0x000000006e1c3a48 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+03029576
[ 10] 0x0000000077bf91ad C:\Windows\SYSTEM32\ntdll.dll+00168365
[ 11] 0x0000000077be8baf C:\Windows\SYSTEM32\ntdll.dll+00101295
[ 12] 0x0000000077c1db38 C:\Windows\SYSTEM32\ntdll.dll+00318264
[ 13] 0x000000006e0b8b41 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+01936193
[ 14] 0x000000006e10fafa C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02292474
[ 15] 0x000000006e1107af C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02295727
[ 16] 0x000000006e1288e6 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02394342
[ 17] 0x000000006e12c2d8 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02409176
[ 18] 0x000000006e1c3a48 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+03029576
[ 19] 0x0000000077bf91ad C:\Windows\SYSTEM32\ntdll.dll+00168365
[ 20] 0x0000000077be8baf C:\Windows\SYSTEM32\ntdll.dll+00101295
[ 21] 0x0000000077c1db38 C:\Windows\SYSTEM32\ntdll.dll+00318264
[ 22] 0x000000006e0b6b3a C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+01927994
[ 23] 0x000000006e1c3e38 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+03030584
[ 24] 0x000000006e10f88d C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02291853
[ 25] 0x000000006e1107af C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02295727
[ 26] 0x000000006e1288e6 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02394342
[ 27] 0x000000006e12c2d8 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+02409176
[ 28] 0x000000006e1c3a48 C:\Program Files (x86)\MATLAB\2016a\sys\java\jre\win64\jre\bin\server\jvm.dll+03029576
[ 29] 0x0000000077bf91ad C:\Windows\SYSTEM32\ntdll.dll+00168365
[ 30] 0x0000000077be8baf C:\Windows\SYSTEM32\ntdll.dll+00101295
[ 31] 0x0000000077c1db38 C:\Windows\SYSTEM32\ntdll.dll+00318264
[ 32] 0x00000f0005cfe105 <unknown-module>+00000000
[ 33] 0x000007fed43b5f57 C:\OpenSim 3.3\bin\osimTools.dll+00089943
[ 34] 0x000007fed43d3131 C:\OpenSim 3.3\bin\osimTools.dll+00209201
[ 35] 0x000007fed43d3786 C:\OpenSim 3.3\bin\osimTools.dll+00210822
[ 36] 0x000007fed6fbd563 C:\OpenSim 3.3\bin\osimCommon.dll+00251235
[ 37] 0x000007fed43d32d1 C:\OpenSim 3.3\bin\osimTools.dll+00209617
[ 38] 0x000007fed4c4f5c5 C:\OpenSim 3.3\bin\osimJavaJNI.dll+00062917
[ 39] 0x000007fed4dbaddd C:\OpenSim 3.3\bin\osimJavaJNI.dll+01551837
[ 40] 0x000000003e813150 <unknown-module>+00000000
[ 41] 0x000000003b6811e8 <unknown-module>+00000000
[ 42] 0x0000000062860af0 <unknown-module>+00000000
[ 43] 0x0000000100000004 C:\Program Files (x86)\MATLAB\2016a\bin\win64\libmwi18n.dll+01048580
[ 44] 0x0000000400000018 <unknown-module>+00000000
[ 45] 0x000000003b681000 <unknown-module>+00000000
[ 46] 0x000000005f96f5d0 <unknown-module>+00000000
[ 47] 0x000000005f96f500 <unknown-module>+00000000
[ 48] 0x00000007e4baeef0 <unknown-module>+00000000
[ 49] 0x000000005f96f568 <unknown-module>+00000000
[ 50] 0x00000007e4bc64a8 <unknown-module>+00000000


If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help.

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: Matlab API compatible with Windows 10?

Post by Thomas Uchida » Mon Jul 24, 2017 11:00 am

One hypothesis is that the MATLAB script is expecting the output from the IK Tool to be available immediately after the call to iktool.run(). The file may not be immediately available (e.g., if MATLAB is using multiple threads). There are other possible explanations but it's difficult to diagnose without seeing the code.

POST REPLY