diff --git a/scripts/apollo.bashrc b/scripts/apollo.bashrc index dc55b2c888ab510725824a8514f52db2ea4ec7e8..e13ab3d6eb0a22da8f79acd2773e77c01ea868e2 100644 --- a/scripts/apollo.bashrc +++ b/scripts/apollo.bashrc @@ -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 diff --git a/scripts/apollo_config.sh b/scripts/apollo_config.sh index dc4056af46eb7cf63560fa333718f7a85e51af82..2d835a587771c6e7e985f673acb690010d641737 100755 --- a/scripts/apollo_config.sh +++ b/scripts/apollo_config.sh @@ -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}" }