Force compiled matlab program to run via runtime, not application

Apologies for what might be a basic question. I am trying to get a GUI someone else made and compiled using Matlab 2017b to run on my computer (Windows 10 64 bit). I need it to run off the appropriate Matlab runtime (which was installed along with the GUI, v93) rather than the version of the Matlab application I have installed on my computer (2014a), which is I'm pretty sure what it's doing currently--it should use the GPU for calculations if running off the runtime but it'll use the CPU otherwise, and as far as I can tell it's using the CPU only. What I don't understand is how to force the compiled code to run off the runtime not the application, so far that's beyond my ability to figure out. I've seen these notes about making sure the path the compiled code sees first is the runtime, but I do not understand how to actually change that. I have the GUI application files installed in MATLAB/MATLAB Runtime/v93/runtime/win64/, but I don't know if that's enough to do it.
Thanks for your help.
(If it matters, what the GUI does is fit points from single-molecule fluorescence experiments using a spline function, and if it uses the CPU it can do about 2000 fits/second, but on the GPU it should be able to do about 100,000 fits/second. I am only getting 2000 fit/s which is why I know it's not using the GPU. I have a GTX960 installed with what should be an appropriate CUDA driver).

7 件のコメント

Walter Roberson
Walter Roberson 2018 年 6 月 3 日
Compiled applications always need to use a version of MCR that corresponds to the version they were compiled with. If you compiled with R2017b and have an R2014a MCR on the machine, then the compiled executable will ignore the R2014a MCR.
What can happen is that if you create an executable with R2017b that uses the R2017b MCR, and you also have R2017b with MATLAB Compiler installed, then the executable might use libraries from the R2017b MATLAB Compiler installation instead of from the installed R2017b MCR. Those should be identical, so the only way this really matters is that you might think you are testing that MCR was properly installed but instead be getting the version of the MATLAB Compiler installation.
fredtbn1gs
fredtbn1gs 2018 年 6 月 4 日
The program was compiled (by another group) using R2017b, and their installer adds the R2017b runtime.
If I go to PC:C:\Program Files\MATLAB, I have folders for
1) Matlab Compiler Runtime (v84 inside that folder)
2) Matlab Runtime (v93 inside that folder); this is the one I want
3) R2014a
4) R2015a
Is it possible that the compiled code is trying to use the Matlab Compiler Runtime (v84) rather than the correct v93 Matlab Runtime folder? I don't know how to force it to one or the other, or tell which one it's using.
Greg
Greg 2018 年 6 月 4 日
I'll sum up (restate) what Walter already told you:
It is already using the v93 runtime.
It doesn't work any other way, whatever your problem is has nothing to do with the runtime.
Greg
Greg 2018 年 6 月 4 日
So the real question is why is code I got from somebody else apparently using CPU instead of GPU?
Are you sure the compiled code is written to use the GPU? Do you have source code or just the .EXE file? You should also be able to very easily determine if it's using CPU; just open task manager and launch the application.
Walter Roberson
Walter Roberson 2018 年 6 月 4 日
What would the executable do if it could not detect the GPU?
(Your gtx 960 should be cuda level 5.2 which should be plenty.)
fredtbn1gs
fredtbn1gs 2018 年 6 月 4 日
Thanks for bearing with me, my matlab knowledge is almost entirely scripting fairly simple things for basic data manipulation and I know almost nothing about compiling/making GUIs etc. I understand now that the GUI must be using the correct v93 runtime or else it wouldn't work.
I do have the source code, some of which is m files I can read and some of which is filetypes I've honestly never heard of (I assume some of it is the basic functions and some of it is compiled in various ways). According to the paper this code is published in, the EXE should automatically use the GPU if on Windows with the proper GPU and software (ie CUDA drivers) installed. Otherwise, it will use the CPU. I have been working from their EXE file so far.
The GUI is definitely running off the CPU, it shows up in task manager and the % usage ramps up while it's running, then back down, with no change in GPU usage.
Also I was wrong, it's a GTX970, but I imagine that makes no particular difference.
Walter Roberson
Walter Roberson 2018 年 6 月 4 日
Can you provide a link?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

タグ

質問済み:

2018 年 6 月 3 日

コメント済み:

2018 年 6 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by