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.

install-mkl.sh 1.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash -e
  2. cd $(dirname $0)
  3. #FIXME: anaconda just upload serval lastest version, so this version may lose efficacy
  4. echo "this script only for linux/macos/windows-unix-like-env(MSYS etc) prepare MKL env"
  5. echo "if you build windows for native at cmd.exe, powershell env or Visual Studio GUI,"
  6. echo "u need download MKL package and untar manually"
  7. echo "refs: https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library/choose-download/windows.html"
  8. MKL_VERSION=2019.5
  9. MKL_PATCH=281
  10. CONDA_BASE_URL=https://anaconda.org/intel
  11. OS=$(uname -s)
  12. FILE_PREFIX=null
  13. TAR=tar
  14. if [ $OS = "Darwin" ];then
  15. FILE_PREFIX=osx
  16. elif [ $OS = "Linux" ];then
  17. FILE_PREFIX=linux
  18. elif [[ $OS =~ "NT" ]]; then
  19. FILE_PREFIX=win
  20. # NT use /c/Windows/system32/tar will stuck for big file
  21. # so we back to GNU tar
  22. TAR=/usr/bin/tar
  23. else
  24. echo "DO NOT SUPPORT OS NOW"
  25. exit -1
  26. fi
  27. echo "config FILE_PREFIX to: $FILE_PREFIX"
  28. rm -rf mkl
  29. for platform in 32 64
  30. do
  31. if [ $OS = "Darwin" ]&&[ $platform = 32 ];then
  32. echo "strip 32 bit file for Darwin"
  33. continue
  34. fi
  35. mkdir -p mkl/x86_${platform}
  36. for package in "mkl-include" "mkl-static"
  37. do
  38. DOWNLOAD_FILE=${package}-${MKL_VERSION}-intel_${MKL_PATCH}.tar.bz2
  39. echo "Installing ${DOWNLOAD_FILE} for x86_${platform}..."
  40. URL=${CONDA_BASE_URL}/${package}/${MKL_VERSION}/download/$FILE_PREFIX-${platform}/${DOWNLOAD_FILE}
  41. echo "try download mkl package from: ${URL}"
  42. wget -q --show-progress "${URL}" -O mkl/x86_${platform}/${DOWNLOAD_FILE}
  43. $TAR xvj -C mkl/x86_${platform} -f mkl/x86_${platform}/${DOWNLOAD_FILE}
  44. done
  45. done

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