PaddlePaddle / PaddleCustomDevice

PaddlePaddle custom device implementaion. (『飞桨』自定义硬件接入实现)
Apache License 2.0
70 stars 148 forks source link

Apple M2 环境CMake 构建失败 #1035

Closed tongda closed 7 months ago

tongda commented 7 months ago

环境:macbook air m2 Python 版本:3.10.13 参考教程执行,构建失败,报错日志如下:

-- Found Python: /opt/miniconda3/envs/wiring/bin/python3.10 (found suitable version "3.10.13", required range is "3.10...<3.11") found components: Interpreter Development Development.Module Development.Embed
WANRINGCannot find core_avx.so, using core_noavx.so instead.
FATALcore_noavx.so NOT found in /opt/miniconda3/envs/wiring/lib/python3.10/site-packages/paddle/fluid/
CMake Error at build/third_party/gflags/tmp/extern_gflags-mkdirs.cmake:6 (file):
  file failed to create directory:

    /third_party/gflags

  because: No such file or directory
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:1790 (include)
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4354 (_ep_set_directories)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

CMake Error at /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:3235 (message):
  No download info given for 'extern_gflags' and its source directory:

   /third_party/gflags

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4418 (_ep_add_download_command)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

-- Configuring incomplete, errors occurred!
qili93 commented 7 months ago

@lishicheng1996 帮忙回复下

lishicheng1996 commented 7 months ago

环境:macbook air m2 Python 版本:3.10.13 参考教程执行,构建失败,报错日志如下:

-- Found Python: /opt/miniconda3/envs/wiring/bin/python3.10 (found suitable version "3.10.13", required range is "3.10...<3.11") found components: Interpreter Development Development.Module Development.Embed
WANRINGCannot find core_avx.so, using core_noavx.so instead.
FATALcore_noavx.so NOT found in /opt/miniconda3/envs/wiring/lib/python3.10/site-packages/paddle/fluid/
CMake Error at build/third_party/gflags/tmp/extern_gflags-mkdirs.cmake:6 (file):
  file failed to create directory:

    /third_party/gflags

  because: No such file or directory
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:1790 (include)
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4354 (_ep_set_directories)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

CMake Error at /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:3235 (message):
  No download info given for 'extern_gflags' and its source directory:

   /third_party/gflags

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4418 (_ep_add_download_command)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

-- Configuring incomplete, errors occurred!

不好意思,对苹果M芯片的支持属于实验性质。仅在开发阶段进行了demo验证,未持续跟进paddle框架的更新。

tongda commented 7 months ago

环境:macbook air m2 Python 版本:3.10.13 参考教程执行,构建失败,报错日志如下:

-- Found Python: /opt/miniconda3/envs/wiring/bin/python3.10 (found suitable version "3.10.13", required range is "3.10...<3.11") found components: Interpreter Development Development.Module Development.Embed
WANRINGCannot find core_avx.so, using core_noavx.so instead.
FATALcore_noavx.so NOT found in /opt/miniconda3/envs/wiring/lib/python3.10/site-packages/paddle/fluid/
CMake Error at build/third_party/gflags/tmp/extern_gflags-mkdirs.cmake:6 (file):
  file failed to create directory:

    /third_party/gflags

  because: No such file or directory
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:1790 (include)
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4354 (_ep_set_directories)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

CMake Error at /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:3235 (message):
  No download info given for 'extern_gflags' and its source directory:

   /third_party/gflags

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.3/share/cmake/Modules/ExternalProject.cmake:4418 (_ep_add_download_command)
  cmake/external/gflags.cmake:64 (ExternalProject_Add)
  cmake/third_party.cmake:27 (include)
  CMakeLists.txt:69 (include)

-- Configuring incomplete, errors occurred!

不好意思,对苹果M芯片的支持属于实验性质。仅在开发阶段进行了demo验证,未持续跟进paddle框架的更新。

后续还会跟进么? 我想修复这个错误,可以给些建议么?

ronny1996 commented 7 months ago

你好,目前没有跟进计划,从错误上看是Paddle的更新导致

  1. 可以尝试切换 Paddle 到支持 apple metal 最新提交的时间
  2. 可以对比下 PaddleCustomDevice/backends/mps/cmake/paddle.cmake 和 PaddleCustomDevice/backends/npu/cmake/paddle.cmake,以及 PaddleCustomDevice/backends/mps/kernels 下各个 kernel 是否与 npu 一致
ronny1996 commented 7 months ago

@tongda 请问还有问题吗?

qili93 commented 7 months ago

2周未有新的comments,关闭此issue。如果您有新的问题,可以open新的issue提问,谢谢!