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.

prepare.sh 1.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash -e
  2. cd $(dirname $0)
  3. # force use /usr/bin/sort on windows, /c/Windows/system32/sort do not support -V
  4. OS=$(uname -s)
  5. SORT=sort
  6. if [[ $OS =~ "NT" ]]; then
  7. SORT=/usr/bin/sort
  8. fi
  9. requiredGitVersion="1.8.4"
  10. currentGitVersion="$(git --version | awk '{print $3}')"
  11. if [ "$(printf '%s\n' "$requiredGitVersion" "$currentGitVersion" | ${SORT} -V | head -n1)" = "$currentGitVersion" ]; then
  12. echo "Please update your Git version. (foud version $currentGitVersion, required version >= $requiredGitVersion)"
  13. exit -1
  14. fi
  15. function update_cpuinfo() {
  16. git submodule update -f --init cpuinfo
  17. name=`git config --get user.name || true`
  18. if [ -z "$name" ]; then
  19. name="default"
  20. fi
  21. email=`git config --get user.email || true`
  22. if [ -z "$email" ]; then
  23. email="default"
  24. fi
  25. source ./apply-patches.sh
  26. apply_cpuinfo_patches ${name} ${email}
  27. }
  28. function git_submodule_update() {
  29. git submodule sync
  30. git submodule update -f --init midout
  31. git submodule update -f --init intel-mkl-dnn
  32. git submodule update -f --init Halide
  33. git submodule update -f --init protobuf
  34. git submodule update -f --init gtest
  35. git submodule update -f --init flatbuffers
  36. git submodule update -f --init cutlass
  37. git submodule update -f --init Json
  38. git submodule update -f --init pybind11
  39. git submodule update -f --init llvm-project
  40. git submodule update -f --init range-v3
  41. git submodule update -f --init libzmq
  42. git submodule update -f --init cppzmq
  43. git submodule update -f --init OpenBLAS
  44. update_cpuinfo
  45. git submodule update -f --init MegRay
  46. pushd MegRay/third_party >/dev/null
  47. git submodule sync
  48. git submodule update -f --init nccl
  49. git submodule update -f --init gdrcopy
  50. git submodule update -f --init ucx
  51. popd >/dev/null
  52. }
  53. if [[ -z "${ALREADY_UPDATE_SUBMODULES}" ]]; then
  54. git_submodule_update
  55. fi

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