Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ansible): added the spconv installation to ansible #5794

Merged
merged 11 commits into from
Feb 21, 2025
2 changes: 2 additions & 0 deletions amd64.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ cuda_version=12.4
cudnn_version=8.9.7.29-1+cuda12.2
tensorrt_version=10.8.0.43-1+cuda12.8
pre_commit_clang_format_version=17.0.5
cumm_version=0.5.3
spconv_version=2.3.8
4 changes: 4 additions & 0 deletions ansible/playbooks/install_spconv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Download and install the cumm and spconv packages
hosts: localhost
roles:
- autoware.dev_env.spconv
2 changes: 2 additions & 0 deletions ansible/playbooks/universe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
when: rosdistro != 'rolling'
- role: autoware.dev_env.tensorrt
when: prompt_install_nvidia == 'y'
- role: autoware.dev_env.spconv
when: prompt_install_nvidia == 'y'

# Autoware devel dependencies
- role: autoware.dev_env.dev_tools
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/cuda/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- libcublas-dev-{{ cuda__dash_case_cuda_version.stdout }}
- libcurand-dev-{{ cuda__dash_case_cuda_version.stdout }}
- cuda-nvml-dev-{{ cuda__dash_case_cuda_version.stdout }}
- cuda-nvrtc-dev-{{ cuda__dash_case_cuda_version.stdout }}
update_cache: true
when: install_devel == 'y'

Expand Down
18 changes: 18 additions & 0 deletions ansible/roles/spconv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# spconv

This role install the `cumm` and `spconv` libraries needed to perform sparse convolutions.
The [original implementation](https://github.com/traveller59/spconv) did not provide a shared library, which is pre-generated c++ code and pre-compiled libraries were prepared [separatedly](https://github.com/knzo25/spconv_cpp).

## Manual Installation

For manual installation, please follow the instructions in [this](https://github.com/knzo25/spconv_cpp) repository.

## Run the playbook

The following command will install a particular version of the packages using ansible.

```bash
export CUMM_VERSION=0.5.3
export SPCONV_VERSION=2.3.8
ansible-playbook autoware.dev_env.install_spconv.yaml -e cumm_version=${CUMM_VERSION} -e spconv_version=${SPCONV_VERSION} --ask-become-pass
```
Empty file.
Empty file.
28 changes: 28 additions & 0 deletions ansible/roles/spconv/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# cspell:ignore Bcumm
- name: Normalize dpkg architecture
ansible.builtin.set_fact:
normalized_arch: "{{ ansible_architecture | regex_replace('aarch64', 'arm64') | regex_replace('x86_64', 'amd64') }}"

- name: Download the cumm package
ansible.builtin.get_url:
mode: "0644"
url: https://github.com/knzo25/spconv_cpp/releases/download/spconv_v{{ spconv_version }}%2Bcumm_v{{ cumm_version }}/cumm_{{ cumm_version }}_{{ normalized_arch }}.deb
dest: /tmp/cumm.deb

- name: Install the cumm package
become: true
ansible.builtin.apt:
deb: /tmp/cumm.deb
state: present

- name: Download the spconv package
ansible.builtin.get_url:
mode: "0644"
url: https://github.com/knzo25/spconv_cpp/releases/download/spconv_v{{ spconv_version }}%2Bcumm_v{{ cumm_version }}/spconv_{{ spconv_version }}_{{ normalized_arch }}.deb
dest: /tmp/spconv.deb

- name: Install the spconv package
become: true
ansible.builtin.apt:
deb: /tmp/spconv.deb
state: present
Loading