Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a Linux compilation guide in mind? #25

Open
xurich-xulaco opened this issue Feb 23, 2023 · 4 comments
Open

Is there a Linux compilation guide in mind? #25

xurich-xulaco opened this issue Feb 23, 2023 · 4 comments

Comments

@xurich-xulaco
Copy link

xurich-xulaco commented Feb 23, 2023

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.

@WolframRhodium
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

Yes.

@AkarinVS
Copy link
Member

AkarinVS commented Mar 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants