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 2.8 kB

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

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