Libtorch dylib conflict

Hi there,
I’m developing a vst3 plugin on macOS that links to libtorch dylibs.
The problem is that if I try to load it on Nuendo 12 it crashes: it seems to be related to libtorch dylib conflict used by Spectral Layers 8. If I remove Spectral Layers 8 from the plugin folder my plugin works fine. Also, if I don’t link to libtorch dylibs and put Spectral Layers 8 in the plugin folder, my plugin still works fine.
So, it seems to be related to libtorch dylibs.

The same problem occurs on Reaper, but it doesn’t crash, it just avoid to open the problematic plugin.

Because of the nature of the problem, I tried to open Spectral Layers 8 on Reaper and then open my plugin in a sandbox process (Reaper supports it) and because the dylibs are loaded on another process, conflicts are wiped out and everything works fine.

Honestly, I don’t know how to deal with dylibs conflicts: it seems that the first plugin to load libtorch dylibs avoid other plugins to load their versions of them, and because of version mismatch, the plugin is not able to find the needed symbols.
Do I get it right?

Right now I’m quite on a dead end, any of you know how to solve this issue?
Thanks a lot!

This is going to become a bit of a problem unfortunately as more and more plug-ins rely on libtorch, libtensorflow or libonnxruntime dylibs. It’s not really a solution to your problem, but if you can export your model to ONNX format (and run it with onnx runtime), you can check out this repo i made to build a custom onnx runtime static library that you can link with your plug-in binary:

see also

1 Like

Hi Oli, thanks for the suggestion, great work on your static library builder!
I guess I should be able to export the model to ONNX format but I rely on libtorch not only for using the model but also for other preprocessing operations that need libtorch API to work.
So probably I’m not able to entirely give up libtorch linkage.