You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUILD_PYTHON_WHL_README.md 3.0 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Python whl package build support status
  2. * Windows build (cpu and gpu)
  3. * Linux build (cpu and gpu)
  4. * MacOS build (cpu only)
  5. # Build env prepare
  6. ## Linux
  7. * refer to [BUILD_README.md](scripts/cmake-build/BUILD_README.md) Linux host build(CUDA env) section to init CUDA environment
  8. ```bash
  9. 1: please refer to https://docs.docker.com/engine/security/rootless/ to enable rootless docker env
  10. 2: cd ./scripts/whl/manylinux2014
  11. 3: ./build_image.sh
  12. 4: as aarch64-linux python3.5 pip do not provide megengine depends prebuild binary package, which definition
  13. in imperative/python/requires.txt, before install megengine wheel package(just python3.5), you need
  14. do follow step to init python3.5 arrow build env:
  15. 4a: wget https://apache.bintray.com/arrow/debian/apache-arrow-archive-keyring-latest-buster.deb
  16. 4b: sudo apt install ./apache-arrow-archive-keyring-latest-buster.deb
  17. 4c: sudo apt update
  18. 4d: sudo apt install libarrow-dev
  19. 4c: sudo apt install libarrow-python-dev
  20. 4e: sudo ln -s /usr/include/locale.h /usr/include/xlocale.h
  21. ```
  22. ## MacOS
  23. * refer to [BUILD_README.md](scripts/cmake-build/BUILD_README.md) MacOS section to init base build environment
  24. * init other wheel build depends env by command:
  25. ```bash
  26. ./scripts/whl/macos/macos_whl_env_prepare.sh
  27. ```
  28. ## Windows
  29. * refer to [BUILD_README.md](scripts/cmake-build/BUILD_README.md) Windows section to init base build environment
  30. # How to build
  31. Note: Guarantee the git repo is mounted in docker container, do not use `git submodule update --init` in to init Project repo
  32. ## Build for linux
  33. * This Project delivers `wheel` package with `manylinux2014` tag defined in [PEP-571](https://www.python.org/dev/peps/pep-0571/).
  34. commands:
  35. ```bash
  36. ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101
  37. ```
  38. * And you can find all of the outputs in `output` directory.If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. eg:
  39. ```bash
  40. ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101
  41. ```
  42. * If you just want to build with cpu only version, you can set `-sdk` environment 'cpu'. eg:
  43. ```bash
  44. ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cpu
  45. ```
  46. ## Build for MacOS
  47. * commands:
  48. ```bash
  49. ./scripts/whl/macos/macos_build_whl.sh
  50. ```
  51. * If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. eg:
  52. ```bash
  53. ALL_PYTHON="3.7.7" ./scripts/whl/macos/macos_build_whl.sh
  54. ```
  55. ## Build for Windows
  56. * commands:
  57. ```bash
  58. ./scripts/whl/windows/windows_build_whl.sh
  59. ```
  60. * If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. eg:
  61. ```bash
  62. ALL_PYTHON="3.8.3" ./scripts/whl/windows/windows_build_whl.sh
  63. ```
  64. * If you just want to build with cpu only version, you can set `BUILD_WHL_CPU_ONLY` environment 'ON'. eg:
  65. ```
  66. BUILD_WHL_CPU_ONLY="ON" ALL_PYTHON="3.8.3" ./scripts/whl/windows/windows_build_whl.sh
  67. ```

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台