AmusementClub / vs-mlrt

Efficient CPU/GPU ML Runtimes for VapourSynth (with built-in support for waifu2x, DPIR, RealESRGANv2/v3, Real-CUGAN, RIFE, SCUNet and more!)
GNU General Public License v3.0
310 stars 20 forks source link

Is there a Linux compilation guide in mind? #25

Open xurich-xulaco opened 1 year ago

xurich-xulaco commented 1 year ago

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

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.

WolframRhodium commented 1 year ago

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.

xurich-xulaco commented 1 year ago

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?

WolframRhodium commented 1 year ago

Yes.

AkarinVS commented 1 year ago

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.)