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

[moltenvk] New Port #14819

Closed
wants to merge 8 commits into from
Closed

[moltenvk] New Port #14819

wants to merge 8 commits into from

Conversation

Haeri
Copy link
Contributor

@Haeri Haeri commented Nov 28, 2020

This is a first attempt to port MoltenVK. This port is not 100% perfect and has TODOs but this is a first base-implementation. The port is based on the unfortunately closed #9575 PR.

  • What does your PR fix? Fixes #
    This is a new port [New Port Request] MoltenVK #14698

  • Which triplets are supported/not supported? Have you updated the CI baseline?
    Only osx is supported. CI is updated.

  • Does your PR follow the maintainer guide?
    As much as possible. Unfortunately the dependencies of MoltenVK are handled with script files. It would require a big patch to adjust the dependencies to vcpkg.

@JackBoosY JackBoosY added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Nov 30, 2020
ports/moltenvk/portfile.cmake Outdated Show resolved Hide resolved
ports/moltenvk/portfile.cmake Outdated Show resolved Hide resolved
ports/moltenvk/portfile.cmake Outdated Show resolved Hide resolved
ports/moltenvk/portfile.cmake Outdated Show resolved Hide resolved
@JackBoosY
Copy link
Contributor

I'll help you to improve this PR later.

Haeri and others added 2 commits December 1, 2020 15:59
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
@JackBoosY
Copy link
Contributor

Ops, the official build type is to use xcodebuild which we don’t support it now.
Let me find other solution.

@JackBoosY
Copy link
Contributor

@Haeri I don't know xcode because I have never used it for development. Can you help me if I have any questions?

scripts/ci.baseline.txt Outdated Show resolved Hide resolved
@Haeri
Copy link
Contributor Author

Haeri commented Dec 3, 2020

@Haeri I don't know xcode because I have never used it for development. Can you help me if I have any questions?

Unfortunately me neither 😅 and I don't have access to a mac either at the moment. I am also not associated with the MoltenVK project in any way. I'm just trying to get it to work with my project. It is a bit unfortunate that they insist on using xcode instead of cmake or actual make (as you saw, their make file just calls xcode) but they argue, that this is justified, since this is an apple only project.

Also it is a bit surprising that the initial PR azure build failed as I have tested that version in my project with GitHub actions:
https://github.com/Haeri/ElementalDraw/runs/1468647387?check_suite_focus=true#step:3:7

PS: Any particular reason you removed the adjustments to ci.baseline.txt?

@JackBoosY
Copy link
Contributor

JackBoosY commented Dec 4, 2020

@Haeri If we added Support keyword in manifest or CONTROL file, we don't need to add the same content on baseline.

@JackBoosY
Copy link
Contributor

@Haeri Can you try this PR locally?

@Haeri
Copy link
Contributor Author

Haeri commented Dec 11, 2020

@JackBoosY The main issue is that the vulkan dependency is only a check if the Vulkan SDK is installed and does not actually contain anything in it. That's why it fails when I run it on the GitHub runner:
https://github.com/Haeri/ElementalDraw/runs/1501915931?check_suite_focus=true#step:4:238

I assume that the Vulkan SDK is installed on the Azure pipeline, seeing that it didn't fail there.

@JackBoosY
Copy link
Contributor

@Haeri No, Vulkan is skipped on our pipeline test.

@JackBoosY
Copy link
Contributor

As @strega-nil said:

macOS does not support vulkan, at least natively; Khronos seems to have created a compatibility layer, maybe, but I'm not sure on that.
I'm not clear if this PR works.

@Haeri
Copy link
Contributor Author

Haeri commented Dec 29, 2020

As @strega-nil said:

macOS does not support vulkan, at least natively; Khronos seems to have created a compatibility layer, maybe, but I'm not sure on that.
I'm not clear if this PR works.

@JackBoosY Not sure if this comment was directed towards me, but moltenvk is the compatibility layer @strega-nil is referring to.

@JackBoosY
Copy link
Contributor

So if this PR works locally, then we can accept this without test on the pipeline.
However, I can't test it on my machine because I can't install vulkan.

@strega-nil
Copy link
Contributor

strega-nil commented Dec 30, 2020

@JackBoosY @Haeri isn't it the case that moltenvk provides vulkan given metal (installed by default on macOS)? You should be able to install it without any prerequisites, right?

@Haeri
Copy link
Contributor Author

Haeri commented Dec 30, 2020

@strega-nil Yes MoltenVk is a portability implementation that allows Vulkan to run on Metal. It does have some prerequisites or dependencies on:

  • Cereal
  • Vulkan-Headers
  • SPIRV-Cross
  • glslang
  • Vulkan-Tools
  • VulkanSamples

All of them already have vcpkg ports except for Vulkan-Tools. I'm not sure if that is the cause, but I am unfortunately not able to successfully compile this current port @JackBoosY. I do a step, where I install the Vulkan SDK so the vulkan port does not abort for not being able to find VULKAN_SDK but still no luck:
https://github.com/Haeri/Mac-Runner/runs/1628063004#step:4:109

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:145 (message):
    Command failed: "xcodebuild build -quiet -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)" -configuration "Debug""
    Working Directory: /Users/runner/work/Mac-Runner/Mac-Runner/extern/vcpkg/buildtrees/moltenvk/x64-osx-dbg
    See logs for more information:

Unfortunately I am not able to find more log files to see what the problem is.

@JackBoosY
Copy link
Contributor

JackBoosY commented Dec 31, 2020

@Haeri Can you manually run the command xcodebuild build -quiet -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)" -configuration "Debug" in directory /Users/runner/work/Mac-Runner/Mac-Runner/extern/vcpkg/buildtrees/moltenvk/x64-osx-dbg ?

According to the official build docs, this command should work.

@Haeri
Copy link
Contributor Author

Haeri commented Dec 31, 2020

@JackBoosY https://github.com/Haeri/Mac-Runner/runs/1628845754?check_suite_focus=true#step:5:56
Looks like it is having trouble finding the dependencies. I guess we will have to manually reimplement the stuff their fetchDependencies.sh is doing...

@JackBoosY
Copy link
Contributor

@Haeri Yeah...

@PhoebeHui
Copy link
Contributor

@Haeri, we prefer using CMake buildsystems, the OSX CI test machines doesn't support to executing the commands, and may not support in future, may be you can add a custom CMakeLists.txt instead?

@Haeri
Copy link
Contributor Author

Haeri commented May 21, 2021

@PhoebeHui I completely understand and I also would have preferred for them to provide a proper cmake build system instead, but unfortunately, that's what they chose.
As I already mentioned, I have no affiliation at all with MoltenVK and to be honest, after spending one month trying to get their stuff to compile, I just can't be bothered to deal with it anymore. So instead I am using OpenGL as a stand-in backend for Vulkan on Apple platforms.
Feel free to close this PR at any time and maybe if someday they decide to switch to cmake, we can finalize this RP.

@PhoebeHui
Copy link
Contributor

@Haeri, thanks for your response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants