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

[mnn,flatbuffers] add a new port and patch #15717

Merged
merged 20 commits into from
Mar 23, 2021
Merged

[mnn,flatbuffers] add a new port and patch #15717

merged 20 commits into from
Mar 23, 2021

Conversation

luncliff
Copy link
Contributor

@luncliff luncliff commented Jan 17, 2021

Changes

Create a new port for https://github.com/alibaba/mnn. Focused general desktop build configurations.

Patches

ports/flatbuffers/fix-issue-6036.patch

Workaround for google/flatbuffers#6036. The patch can be removed when the flatbuffers package gets the next release.

use-packages-and-install.patch

The project embedded several libraries that are available in VcPkg. It modifies the CMakeLists.txt files to use those packages.

fix-dllexport.patch

Some symbols become duplicated when MNN.dll is being generated. The scripts of the project don't generate executables in the Windows platform, so it seems like this issue is not reported.
This patch makes minimum changes to enable the tools feature.

Extracted all code changes to alibaba/MNN#1391

Feature

Supports 5 features.

  • test: Generate train/benchmark executables
  • tools: Not available for Windows
  • opencl, vulkan, cuda: API backends that use packages in VcPkg
  • metal: API backend only for the Apple platform

Known Issues

cuda errors when Ninja in Windows environment. PREFER_NINJA won't be used in this case.
Notice that CUDA installation may affect the build result.

Using the metal feature may require Xcode CLI tools configuration in the environment. Please reference
gfx-rs/gfx#2309 (comment)

Which triplets are supported/not supported?

arm, uwp, ios, android won't be considered in this PR. (Probably in the next port update?)

  • x64-windows
  • x86-windows
  • x64-osx
  • x64-linux

Does your PR follow the maintainer guide?

Checked!

@luncliff luncliff marked this pull request as draft January 17, 2021 18:23
@JackBoosY JackBoosY self-assigned this Jan 18, 2021
@JackBoosY JackBoosY added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jan 18, 2021
Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run command vcpkg x-add-version --all then commit the changes.

@JackBoosY
Copy link
Contributor

Please get failure logs here.

@luncliff
Copy link
Contributor Author

luncliff commented Feb 1, 2021 via email

@JackBoosY
Copy link
Contributor

@luncliff Fine.

@luncliff
Copy link
Contributor Author

luncliff commented Feb 3, 2021

Issues - cuda feature

This note is for future visitors

Encountered Issue related to google/flatbuffers#6036. Looking for a workaround to deal with this.

With flatbuffers 1.12, mnn[cuda,test,tools] will fail with the following log.

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:145 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j13
    Working Directory: D:/vcpkg/buildtrees/mnn/x64-windows-dbg
    See logs for more information:
      D:\vcpkg\buildtrees\mnn\install-x64-windows-dbg-out.log

The file says, CUDA file's can't be compiled with the implementation.

D:\vcpkg\installed\x64-windows\include\flatbuffers/flatbuffers.h(1875): error: function "flatbuffers::vector_downward::operator=(const flatbuffers::vector_downward &)"
(1002): here cannot be referenced -- it is a deleted function

1 error detected in the compilation of "D:/vcpkg/buildtrees/mnn/src/1.1.0-b6e0383c18/source/backend/cuda/execution/DeconvSingleInputExecution.cu".
DeconvSingleInputExecution.cu
CMake Error at MNN_Cuda_Main_generated_DeconvSingleInputExecution.cu.obj.Debug.cmake:280 (message):
  Error generating file
  D:/vcpkg/buildtrees/mnn/x64-windows-dbg/source/backend/cuda/CMakeFiles/MNN_Cuda_Main.dir/execution/./MNN_Cuda_Main_generated_DeconvSingleInputExecution.cu.obj

After fixing flatbuffers.h to use the pointer, the CUDA sources can be compiled.

/** flatbuffers.h 1861 */
  /// @cond FLATBUFFERS_INTERNAL
  template<typename T> struct TableKeyComparator {
    TableKeyComparator(vector_downward &buf) : buf_(&buf) {}
    TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {}
    bool operator()(const Offset<T> &a, const Offset<T> &b) const {
      auto table_a = reinterpret_cast<T *>(buf_->data_at(a.o));
      auto table_b = reinterpret_cast<T *>(buf_->data_at(b.o));
      return table_a->KeyCompareLessThan(table_b);
    }
    vector_downward *buf_;

   private:
    TableKeyComparator &operator=(const TableKeyComparator &other) {
      buf_ = other.buf_;
      return *this;
    }
  };
  /// @endcond

luncliff and others added 7 commits February 10, 2021 11:20
* create a patch, embed copyright
* touching install options
* feature cuda reqires cudnn
* patch creates version config.cmake
* run vcpkg_copy_tools for 'tools' feature
* make PREFER_NINJA optional for 'cuda' feature
@luncliff luncliff marked this pull request as ready for review February 10, 2021 12:04
@luncliff
Copy link
Contributor Author

@JackBoosY , I want to check the log files in the failed builds, but looks like artifacts are about dependent packages. Is there another way to can .logs?
The install was successful for my Ubuntu on Docker and Mac device. IMO there is a subtle difference from CI environment...

@luncliff luncliff changed the title [mnn] add a new port [mnn,flatbuffers] add a new port and patch Feb 10, 2021
@luncliff luncliff requested a review from JackBoosY February 17, 2021 03:30
@JackBoosY
Copy link
Contributor

[261/263] /usr/bin/c++ -DMNN_SUPPORT_TFLITE_QUAN -DMNN_USE_SSE -DMNN_USE_THREAD_POOL -DMNN_VERSION=\"1.1.0.0-d6795ad\" -DMNN_VERSION_MAJOR=1 -DMNN_VERSION_MINOR=1 -DMNN_VERSION_PATCH=0 -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/include -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/express -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/tools -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/schema/current -I/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/3rd_party/half -I/mnt/vcpkg-ci/installed/x64-linux/share/rapidjson/../../include -isystem /mnt/vcpkg-ci/installed/x64-linux/include -fPIC -std=c++11 -D__STRICT_ANSI__ -O3 -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math -fno-rtti -fno-exceptions  -O3 -DNDEBUG   -fPIC -std=gnu++11 -MD -MT express/CMakeFiles/MNNExpress.dir/Expr.cpp.o -MF express/CMakeFiles/MNNExpress.dir/Expr.cpp.o.d -o express/CMakeFiles/MNNExpress.dir/Expr.cpp.o -c /mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/express/Expr.cpp
/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/express/Expr.cpp: In static member function ‘static void MNN::Express::Variable::save(const std::vector<MNN::Express::VARP>&, MNN::NetT*)’:
/mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/express/Expr.cpp:819:6: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
 void Variable::save(const std::vector<VARP>& vars, NetT* dest) {
      ^~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/functional:54,
                 from /mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/include/MNN/expr/Expr.hpp:12,
                 from /mnt/vcpkg-ci/buildtrees/mnn/src/1.1.0-d41eed3663.clean/express/Expr.cpp:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 2 and 11 bytes into a destination of size 10
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^

Please get failure logs here.

@luncliff
Copy link
Contributor Author

luncliff commented Feb 18, 2021

Thanks. I just checked both logs.

Error from x64-osx looks similar to gfx-rs/gfx#2309. Kind of Xcode CLI tools issue in the environment... I will do more survey on it.

[238/291] cd /Volumes/data/buildtrees/mnn/x64-osx-dbg && xcrun -sdk macosx metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalBackend.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalBinary.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalCast.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolution1x1.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionActivation.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionDepthwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionGEMM.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionWinograd.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDeconvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDefine.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDequantize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalEltwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalFixedPoint.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalMatMul.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalPReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalROIPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReLU6.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReduction.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalResize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalScale.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalUnary.metal -o /Volumes/data/buildtrees/mnn/x64-osx-dbg/mnn.metallib
FAILED: mnn.metallib 
cd /Volumes/data/buildtrees/mnn/x64-osx-dbg && xcrun -sdk macosx metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalBackend.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalBinary.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalCast.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolution1x1.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionActivation.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionDepthwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionGEMM.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalConvolutionWinograd.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDeconvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDefine.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalDequantize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalEltwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalFixedPoint.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalMatMul.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalPReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalROIPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReLU6.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalReduction.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalResize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalScale.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-d41eed3663.clean/source/backend/metal/MetalUnary.metal -o /Volumes/data/buildtrees/mnn/x64-osx-dbg/mnn.metallib
xcrun: error: unable to find utility "metal", not a developer tool or in PATH

x64-linux report looks like a simple problem. I will add more commits after testing with my local machine.

CMake Error at scripts/cmake/vcpkg_fixup_cmake_targets.cmake:126 (message):
  '/mnt/vcpkg-ci/packages/mnn_x64-linux/debug/share/mnn' does not exist.
Call Stack (most recent call first):
  ports/mnn/portfile.cmake:74 (vcpkg_fixup_cmake_targets)
  scripts/ports.cmake:131 (include)

@luncliff luncliff marked this pull request as draft February 19, 2021 06:56
@JackBoosY
Copy link
Contributor

Only osx regression:

[238/291] cd /Volumes/data/buildtrees/mnn/x64-osx-dbg && xcrun -sdk macosx metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalBackend.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalBinary.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalCast.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolution1x1.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionActivation.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionDepthwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionGEMM.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionWinograd.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDeconvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDefine.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDequantize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalEltwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalFixedPoint.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalMatMul.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalPReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalROIPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReLU6.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReduction.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalResize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalScale.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalUnary.metal -o /Volumes/data/buildtrees/mnn/x64-osx-dbg/mnn.metallib
FAILED: mnn.metallib 
cd /Volumes/data/buildtrees/mnn/x64-osx-dbg && xcrun -sdk macosx metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalBackend.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalBinary.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalCast.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolution1x1.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionActivation.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionDepthwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionGEMM.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalConvolutionWinograd.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDeconvolution.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDefine.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalDequantize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalEltwise.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalFixedPoint.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalMatMul.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalPReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalROIPooling.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReLU.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReLU6.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalReduction.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalResize.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalScale.metal /Users/vagrant/Data/buildtrees/mnn/src/1.1.0-7b4f0aaa49.clean/source/backend/metal/MetalUnary.metal -o /Volumes/data/buildtrees/mnn/x64-osx-dbg/mnn.metallib
xcrun: error: unable to find utility "metal", not a developer tool or in PATH

@luncliff luncliff marked this pull request as ready for review February 21, 2021 16:00
@luncliff
Copy link
Contributor Author

luncliff commented Feb 21, 2021

Before c6cd2d7, when it turns out the build is targeting the Apple platforms, the port enabled metal feature automatically.

mnn[metal] should be available in a normal local developer environment, but CI may not.
Considering such cases, after c6cd2d7, the port mnn will be CPU only mode unless it is requested explicitly with mnn[metal].

* possibly break osx build with the chnage
@JackBoosY JackBoosY added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Mar 2, 2021
@luncliff
Copy link
Contributor Author

@JackBoosY. I'd like to try ARM/Android support of this port.
Is there a plan for the merge of reviewed PRs? Thanks for your team's works :)

@JackBoosY
Copy link
Contributor

Ping @ras0219 @ras0219-msft for merge this PR.

Copy link
Contributor

@ras0219-msft ras0219-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good to merge once my comments are addressed :)

* find_package(CUDNN) in patch
* use vcpkg_download_distfile
* ONLY_STATIC_LIBRARY for Windows
@luncliff luncliff requested a review from ras0219-msft March 22, 2021 02:32
Copy link
Contributor

@ras0219-msft ras0219-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more needed change :)

@JackBoosY JackBoosY added requires:author-response and removed info:reviewed Pull Request changes follow basic guidelines labels Mar 23, 2021
luncliff and others added 2 commits March 23, 2021 10:43
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
@JackBoosY JackBoosY requested a review from ras0219-msft March 23, 2021 08:35
@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Mar 23, 2021
@ras0219-msft ras0219-msft merged commit b35f1ed into microsoft:master Mar 23, 2021
@ras0219-msft
Copy link
Contributor

LGTM, thanks for the new library!

@luncliff luncliff deleted the port/mnn branch March 25, 2021 13:04
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! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants