Loading an Imfusion Plugin that uses Torch c++

I am currently working on development of a C++ plugin to be used in Imfusion Suite.

The plugin imports Torch shared lib via cmake, and imports a header file from torch for reading and executing a trained torchscript model.

I am able to run the plugin as part of a custom built Imfusion Application, however, when loading onto Imfusion Suite , it shows an error :

“Could not load plugin <path_to_dll>: The specified procedure could not be found.”

Through trial and error, I was able to find that the reason for the plugin to be not loaded is due to importing torch headers.

The error message from Imfusion Suite is very vague and I am unable to proceed with using this plugin on Imfusion Suite.

I wanted to know what would be the right way to approach building a c++ plugin that utilizes torch (specifically torchscript to read a trained model and run it on image slice input to the plugin)

In addition, is there any way to get more detailed information on why the plugin couldn’t be loaded.

Hi Waseem,

It seems that you are able to compile the plugin but not load it in the Suite.
This is probably an issue with some DLLs required by your custom plugin that are not found. You should either copy those DLLs in the target directory, or adjust your PATH so that they are found.
If you are not sure which DLLs are required by your plugin, you can use tools like DependencyWalker (https://www.dependencywalker.com/) or Dependency Runner (GitHub - marcoesposito1988/dependency_runner: ldd for Windows - and more!)