vs-mlrt
vs-mlrt copied to clipboard
Is there a Linux compilation guide in mind?
I know AmusementClub has compilation instructions for linux for some of their work. However, this project seems to be one of those few exceptions.
I myself tried to compile vs-mlrt for Fedora 37 and Ubuntu 22.04, with vsncnn in mind to be as compatible as possible with any gpu. The main problems I encountered are
- protobuf-config.cmake is a primary dependency for compilation, but almost no distro offers it in their dev/devel packages (My main source of verification was pkgs.org)
- Finding ONNX is sometimes a matter of "hit or miss", sometimes it is available in the main repos or external (nvidia) repos (Ubuntu situation), and sometimes you have to compile it yourself (Fedora situation).
- For all I know, sometimes the Vulkan SDKs provided by their respective distributions may not be compiled with protobuf and ONNX compatibility in mind.
As you can see from my perspective, trying to build VSNCNNN was an irritating experience from which I couldn't even compile anything successfully. I would like to know the opinion of the developers regarding the issue, personally I think that compiling for any of the plugins in the project will be a challenge.
I personally compile protobuf and onnx from source and use static linking. These components should be easy to install and I do develop plugins on linux.
Okay, it seems that this is the option that can avoid more crashes and unexpected results (especially because of the static link), is it the same with the vulkan SDK?
Yes.
In general you can follow the windows build workflow to build on Linux, with only minor changes.
However, note that you do have to compile all dependencies (specifically, pay attention to the version as well, as those AI runtimes are very strict about dependency versions) as specified in the workflow and not use the package provided by the package manager.
For openvino, please see https://github.com/AmusementClub/openvino/blob/github-actions/.github/workflows/windows.yml. For onnxruntime, please see https://github.com/AmusementClub/onnxruntime/blob/github-actions/.github/workflows/windows-cuda.yml. For ncnn, please see https://github.com/AmusementClub/ncnn/blob/github-actions/.github/workflows/windows-x64-gpu.yml, this one also has linux compilation workflow for you reference.
Almost all the issues are caused by using prepackaged packages for the dependencies (even for the seemingly standard onnx and protobuf packages.)