Merge pull request #3456 from caisq/mac-gpu
Fix CUDA capability version logic in ci_parameterized_build.sh for non-Docker cases
This commit is contained in:
commit
0cf6daff66
@ -49,10 +49,11 @@
|
|||||||
# to run.
|
# to run.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Constants:
|
|
||||||
# Fixed naming patterns for wheel (.whl) files given different python versions
|
# Fixed naming patterns for wheel (.whl) files given different python versions
|
||||||
declare -A WHL_TAGS
|
if [[ $(uname) == "Linux" ]]; then
|
||||||
WHL_TAGS=(["2.7"]="cp27-none" ["3.4"]="cp34-cp34m" ["3.5"]="cp35-cp35m")
|
declare -A WHL_TAGS
|
||||||
|
WHL_TAGS=(["2.7"]="cp27-none" ["3.4"]="cp34-cp34m" ["3.5"]="cp35-cp35m")
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
INSTALL_EXTRA_PIP_PACKAGES=${TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES}
|
INSTALL_EXTRA_PIP_PACKAGES=${TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES}
|
||||||
|
@ -174,24 +174,57 @@ function get_cuda_capability_version() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Process container type
|
# Container type, e.g., CPU, GPU
|
||||||
CTYPE=${TF_BUILD_CONTAINER_TYPE}
|
CTYPE=${TF_BUILD_CONTAINER_TYPE}
|
||||||
|
|
||||||
|
# Determine if Docker is available
|
||||||
OPT_FLAG=""
|
OPT_FLAG=""
|
||||||
|
if [[ -z "$(which docker)" ]]; then
|
||||||
|
DO_DOCKER=0
|
||||||
|
|
||||||
|
echo "It appears that Docker is not available on this system. "\
|
||||||
|
"Will perform build without Docker."
|
||||||
|
echo "Also, the additional option flags will be applied to the build:"
|
||||||
|
echo " ${NO_DOCKER_OPT_FLAG}"
|
||||||
|
MAIN_CMD="${NO_DOCKER_MAIN_CMD} ${CTYPE}"
|
||||||
|
OPT_FLAG="${OPT_FLAG} ${NO_DOCKER_OPT_FLAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Process container type
|
||||||
if [[ ${CTYPE} == "cpu" ]]; then
|
if [[ ${CTYPE} == "cpu" ]]; then
|
||||||
:
|
:
|
||||||
elif [[ ${CTYPE} == "gpu" ]]; then
|
elif [[ ${CTYPE} == "gpu" ]]; then
|
||||||
OPT_FLAG="--config=cuda"
|
OPT_FLAG="${OPT_FLAG} --config=cuda"
|
||||||
|
|
||||||
# Attempt to determine CUDA capability version and use it
|
# Attempt to determine CUDA capability version automatically and use it if
|
||||||
if [[ "${TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS}" != \
|
# CUDA capability version is not specified by the environment variables.
|
||||||
*"TF_CUDA_COMPUTE_CAPABILITIES="* ]]; then
|
CUDA_CAPA_VER=$(get_cuda_capability_version)
|
||||||
CUDA_CAPA_VER=$(get_cuda_capability_version)
|
|
||||||
if [[ ! -z ${CUDA_CAPA_VER} ]]; then
|
if [[ ! -z ${CUDA_CAPA_VER} ]]; then
|
||||||
echo "TF_CUDA_COMPUTE_CAPABILITIES is not set."
|
AUTO_CUDA_CAPA_VER=0
|
||||||
echo "Using CUDA capability version from deviceQuery: ${CUDA_CAPA_VER}"
|
if [[ ${DO_DOCKER} == "1" ]] && \
|
||||||
|
[[ "${TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS}" != \
|
||||||
|
*"TF_CUDA_COMPUTE_CAPABILITIES="* ]]; then
|
||||||
|
AUTO_CUDA_CAPA_VER=1
|
||||||
TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS=\
|
TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS=\
|
||||||
"${TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS} -e "\
|
"${TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS} -e "\
|
||||||
"TF_CUDA_COMPUTE_CAPABILITIES=${CUDA_CAPA_VER}"
|
"TF_CUDA_COMPUTE_CAPABILITIES=${CUDA_CAPA_VER}"
|
||||||
|
|
||||||
|
echo "Docker GPU build: TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS="\
|
||||||
|
"\"${TF_BUILD_APPEND_CI_DOCKER_EXTRA_PARAMS}\""
|
||||||
|
elif [[ ${DO_DOCKER} == "0" ]] && \
|
||||||
|
[[ -z "${TF_CUDA_COMPUTE_CAPABILITIES}" ]]; then
|
||||||
|
AUTO_CUDA_CAPA_VER=1
|
||||||
|
TF_CUDA_COMPUTE_CAPABILITIES="${CUDA_CAPA_VER}"
|
||||||
|
|
||||||
|
echo "Non-Docker GPU build: TF_CUDA_COMPUTE_CAPABILITIES="\
|
||||||
|
"\"${TF_CUDA_COMPUTE_CAPABILITIES}\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${AUTO_CUDA_CAPA_VER} == "1" ]]; then
|
||||||
|
echo "TF_CUDA_COMPUTE_CAPABILITIES is not set:"
|
||||||
|
echo "Using CUDA capability version from deviceQuery: ${CUDA_CAPA_VER}"
|
||||||
|
echo ""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ ${CTYPE} == "android" ]]; then
|
elif [[ ${CTYPE} == "android" ]]; then
|
||||||
@ -203,19 +236,6 @@ fi
|
|||||||
|
|
||||||
EXTRA_PARAMS=""
|
EXTRA_PARAMS=""
|
||||||
|
|
||||||
# Determine if Docker is available
|
|
||||||
if [[ -z "$(which docker)" ]]; then
|
|
||||||
DO_DOCKER=0
|
|
||||||
|
|
||||||
echo "It appears that Docker is not available on this system. "\
|
|
||||||
"Will perform build without Docker."
|
|
||||||
echo "Also, the additional option flags will be applied to the build:"
|
|
||||||
echo " ${NO_DOCKER_OPT_FLAG}"
|
|
||||||
MAIN_CMD="${NO_DOCKER_MAIN_CMD} ${CTYPE}"
|
|
||||||
OPT_FLAG="${OPT_FLAG} ${NO_DOCKER_OPT_FLAG}"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine if this is a benchmarks job
|
# Determine if this is a benchmarks job
|
||||||
RUN_BENCHMARKS=0
|
RUN_BENCHMARKS=0
|
||||||
if [[ ! -z "${TF_BUILD_RUN_BENCHMARKS}" ]] &&
|
if [[ ! -z "${TF_BUILD_RUN_BENCHMARKS}" ]] &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user