Skip to content

Commit

Permalink
fix: fix compiling issues
Browse files Browse the repository at this point in the history
Change-Id: I189f0dfa796aabea7caf36eb9d7c898f4a3f2028
Signed-off-by: liangjinping <[email protected]>
  • Loading branch information
lykling committed Dec 26, 2023
1 parent ccea4c8 commit bda6d11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docker/scripts/docker_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ function determine_gpu_use_host() {
if [[ "${HOST_ARCH}" == "aarch64" ]]; then
if lsmod | grep -q "^nvgpu"; then
USE_GPU_HOST=1
USE_NVIDIA_GPU=1
fi
elif [[ "${HOST_ARCH}" == "x86_64" ]]; then
if [[ ! -x "$(command -v nvidia-smi)" ]]; then
warning "No nvidia-smi found."
elif [[ -z "$(nvidia-smi)" ]]; then
warning "No NVIDIA GPU device found."
else
USE_GPU_HOST=1
USE_NVIDIA_GPU=1
fi
if [[ ! -x "$(command -v rocm-smi)" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions scripts/apollo.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ function determine_gpu_use_target() {
if lsmod | grep -q nvgpu; then
if ldconfig -p | grep -q cudart; then
use_gpu=1
need_cuda=1
gpu_platform="NVIDIA"
fi
fi
else ## x86_64 mode
Expand Down
17 changes: 5 additions & 12 deletions scripts/apollo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,12 @@ function _determine_planning_disabled() {
fi
}

function _determine_map_disabled() {
if [ "${USE_GPU}" -eq 0 ]; then
DISABLED_TARGETS="${DISABLED_TARGETS} except //modules/map/pnc_map:cuda_pnc_util \
except //modules/map/pnc_map:cuda_util_test"
fi
}

function determine_disabled_targets() {
if [[ "$#" -eq 0 ]]; then
_determine_drivers_disabled
_determine_localization_disabled
_determine_perception_disabled
_determine_planning_disabled
_determine_map_disabled
echo "${DISABLED_TARGETS}"
return
fi
Expand All @@ -605,9 +597,6 @@ function determine_disabled_targets() {
planning*)
_determine_planning_disabled
;;
map*)
_determine_map_disabled
;;
esac
done

Expand Down Expand Up @@ -741,7 +730,11 @@ function run_bazel() {
info "${TAB}$1 Targets: ${sp}${GREEN}${build_targets}${NO_COLOR}"
info "${TAB}Disabled: ${spaces}${YELLOW}${disabled_targets}${NO_COLOR}"

job_args="--copt=-mavx2 --host_copt=-mavx2 --jobs=${count} --local_ram_resources=HOST_RAM*0.7"
if [[ "$(uname -m)" == "x86_64" ]]; then
job_args="--copt=-mavx2 --host_copt=-mavx2 --jobs=${count} --local_ram_resources=HOST_RAM*0.7"
else
job_args="--copt=-march=native --host_copt=-march=native --jobs=${count} --local_ram_resources=HOST_RAM*0.7"
fi
set -x
bazel ${1,,} ${CMDLINE_OPTIONS} ${job_args} -- ${formatted_targets}
set +x
Expand Down

0 comments on commit bda6d11

Please sign in to comment.