Skip to content

Commit

Permalink
feat(setup): add an option to install dev packages (#2923)
Browse files Browse the repository at this point in the history
* feat(setup): add an option to install dev packages

Signed-off-by: Shark Liu <[email protected]>

* ci(pre-commit): autofix

Signed-off-by: Shark Liu <[email protected]>
Co-authored-by: Shark Liu <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 6, 2022
1 parent 3a9bbd0 commit b64cfdb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ansible/playbooks/universe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Universe
- role: autoware.dev_env.autoware_universe
- role: autoware.dev_env.cuda
when: prompt_install_nvidia == 'y'
when: prompt_install_nvidia == 'y' and install_devel == 'true'
- role: autoware.dev_env.pacmod
when: rosdistro != 'rolling'
- role: autoware.dev_env.tensorrt
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/tensorrt/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install_devel: true
21 changes: 19 additions & 2 deletions ansible/roles/tensorrt/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
ansible.builtin.apt:
name:
- libcudnn8={{ cudnn_version }}
- libcudnn8-dev={{ cudnn_version }}
- libnvinfer8={{ tensorrt_version }}
- libnvinfer-plugin8={{ tensorrt_version }}
- libnvparsers8={{ tensorrt_version }}
- libnvonnxparsers8={{ tensorrt_version }}
allow_change_held_packages: true
allow_downgrade: true
update_cache: true

- name: Install cuDNN and TensorRT Dev
become: true
ansible.builtin.apt:
name:
- libcudnn8-dev={{ cudnn_version }}
- libnvinfer-dev={{ tensorrt_version }}
- libnvinfer-plugin-dev={{ tensorrt_version }}
- libnvparsers-dev={{ tensorrt_version }}
- libnvonnxparsers-dev={{ tensorrt_version }}
allow_change_held_packages: true
allow_downgrade: true
update_cache: true
when: install_devel | bool

# apt-mark hold
- name: Prevent CUDA-related packages from upgrading
Expand All @@ -24,12 +33,20 @@
selection: hold
with_items:
- libcudnn8
- libcudnn8-dev
- libnvinfer8
- libnvinfer-plugin8
- libnvparsers8
- libnvonnxparsers8

- name: Prevent CUDA-related Dev packages from upgrading
become: true
ansible.builtin.dpkg_selections:
name: "{{ item }}"
selection: hold
with_items:
- libcudnn8-dev
- libnvinfer-dev
- libnvinfer-plugin-dev
- libnvparsers-dev
- libnvonnxparsers-dev
when: install_devel | bool
12 changes: 12 additions & 0 deletions setup-dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ while [ "$1" != "" ]; do
# Disable installation of 'cuda-drivers' in the role 'cuda'.
option_no_cuda_drivers=true
;;
--no-dev)
# Disable installation dev packages .
option_no_dev=true
;;
*)
args+=("$1")
;;
Expand Down Expand Up @@ -77,6 +81,14 @@ if [ "$option_no_cuda_drivers" = "true" ]; then
ansible_args+=("--extra-vars" "install_cuda_drivers=false")
fi

# Check installation of dev package
if [ "$option_no_dev" = "true" ]; then
ansible_args+=("--extra-vars" "install_devel=false")
ansible_args+=("--extra-vars" "installation_type=ros-base")
else
ansible_args+=("--extra-vars" "install_devel=true")
fi

# Load env
source "$SCRIPT_DIR/amd64.env"
if [ "$(uname -m)" = "aarch64" ]; then
Expand Down

0 comments on commit b64cfdb

Please sign in to comment.