提交 c3caf706 编写于 作者: S storypku 提交者: Xiangquan Xiao

Build: gpu mode check for arm64

上级 3e321a65
......@@ -90,10 +90,12 @@ function determine_gpu_use() {
if [[ "${arch}" == "aarch64" ]]; then
if lsmod | grep -q nvgpu; then
use_gpu=1
if ldconfig -p | grep -q cudart; then
use_gpu=1
fi
fi
else ## x86_64 mode
# TODO(all): remove USE_GPU when {cyber,dev}_start.sh"
# TODO(all): remove USE_GPU env var in {cyber,dev}_start.sh"
# Check nvidia-driver and GPU device
local nv_driver="nvidia-smi"
if [ ! -x "$(command -v ${nv_driver} )" ]; then
......
......@@ -17,16 +17,11 @@ BAZEL_CONF="${TOP_DIR}/.apollo.bazelrc"
function config_noninteractive() {
echo "${STARTUP_TXT}" > "${BAZEL_CONF}"
# determine_gpu_use
# FIXME(all): Disable gpu mode for aarch64 until we are ready.
if [ "$(uname -m)" = "aarch64" ]; then
echo "build --config=cpu" >> "${BAZEL_CONF}"
determine_gpu_use
if [ "${USE_GPU}" -eq 1 ]; then
echo "build --config=gpu" >> "${BAZEL_CONF}"
else
if [ "${USE_GPU}" -eq 1 ]; then
echo "build --config=gpu" >> "${BAZEL_CONF}"
else
echo "build --config=cpu" >> "${BAZEL_CONF}"
fi
echo "build --config=cpu" >> "${BAZEL_CONF}"
fi
cat "${TOP_DIR}/tools/apollo.bazelrc.sample" >> "${BAZEL_CONF}"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册