提交 12e71f4f 编写于 作者: M Megvii Engine Team

feat(windows/bazel/cl): misc opt

1: make bazel depends vs create by scripts/whl/windows/env_prepare.sh
2: fix --copt --cuda_arch_override=6.1 do not take effect on windows to
reduce ci time

GitOrigin-RevId: 2cbce0e9ce6184bad970a1203c0a99cc623be90c
上级 e63e8538
......@@ -10,6 +10,9 @@ if [ -z "$NT" ];then
fi
# MegEngine dev tools install prefix
# please do not modify the prefix, because megvii3 will use this prefix
# detail: megvii3/tools/toolchain/windows/configure.bzl and
# megvii3/tools/toolchain/windows/windows_cc_configure.bzl
MEGENGINE_DEV_TOOLS_PREFIX_DIR=/c/Users/${USER}/megengine_dev_tools
# vs_buildtools download url
......@@ -23,6 +26,9 @@ WIN_SDK_VER="18362"
# VC Component version
# please install 14.26.28801, others may cause build error or windows xp sp3 runtime error
# please do not modify this tag, because megvii3 will use this prefix
# detail: megvii3/tools/toolchain/windows/configure.bzl and
# megvii3/tools/toolchain/windows/windows_cc_configure.bzl
VC_VER="14.26"
CVARS_VER_NEED="14.26.28801"
......
......@@ -229,6 +229,30 @@ function install_vs() {
echo "vs is already installed at ${VS_INSTALL_PATH}"
fi
echo "vs install success"
# config vs default vcvars_ver
# at NONE bazel-cuda, we have chance to config cvars_ver from scripts/cmake-build/host_build.sh
# but at bazel-cuda, we have no chance to config cvars_ver, why nvcc do not provide a flag to
# do this? or we do not find it? what`s more, latest cvars_ver have some compat issue, for example
# 14.29.30133 will have mutex issue, which will cause runtime crash on windows xp sp3 env
# also 14.29.30037 do not compat with cuda 10.1 at build stage, 'STL1002: Unexpected compiler version, expected CUDA 10.1 Update 2 or newer'
# as a workload, we config default cvars_ver to CVARS_VER_NEED define in scripts/whl/windows/config.sh
# by force modify some config file
if [ ! -f ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt ];then
echo "broken env?(may need remote ${VS_INSTALL_PATH}) can not find ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt"
exit -1
fi
if [ ! -f ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt ];then
echo "broken env?(may need remote ${VS_INSTALL_PATH}) can not find ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt"
exit -1
fi
if [ ! -f ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.v142.default.txt ];then
echo "broken env?(may need remote ${VS_INSTALL_PATH}) can not find ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.v142.default.txt"
exit -1
fi
echo ${CVARS_VER_NEED} > ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt
echo ${CVARS_VER_NEED} > ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt
echo ${CVARS_VER_NEED} > ${VS_INSTALL_PATH}/VC/Auxiliary/Build/Microsoft.VCToolsVersion.v142.default.txt
}
##########################################################
......
......@@ -212,21 +212,7 @@ function depend_real_copy() {
if [ ${BUILD_WHL_CPU_ONLY} = "OFF" ]; then
echo "copy nvidia lib...."
IFS=: read -a lib_name_array <<<"$TRT_LIBS"
for lib_name in ${lib_name_array[@]};
do
echo "Copy ${lib_name} to ${REAL_DST}"
cp ${lib_name} ${REAL_DST}
done
IFS=: read -a lib_name_array <<<"$CUDNN_LIBS"
for lib_name in ${lib_name_array[@]};
do
echo "Copy ${lib_name} to ${REAL_DST}"
cp ${lib_name} ${REAL_DST}
done
IFS=: read -a lib_name_array <<<"$CUDA_LIBS"
IFS=: read -a lib_name_array <<<"${TRT_LIBS}:${CUDNN_LIBS}:${CUDA_LIBS}"
for lib_name in ${lib_name_array[@]};
do
echo "Copy ${lib_name} to ${REAL_DST}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册