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

feat(ansible): upgrade for CUDA, TensorRT and CUDNN #5608

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions amd64.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rmw_implementation=rmw_cyclonedds_cpp
base_image=ros:humble-ros-base-jammy
autoware_base_image=ghcr.io/autowarefoundation/autoware-base:latest
autoware_base_cuda_image=ghcr.io/autowarefoundation/autoware-base:cuda-latest
cuda_version=12.3
cudnn_version=8.9.5.29-1+cuda12.2
tensorrt_version=8.6.1.6-1+cuda12.0
cuda_version=12.6
cudnn_version=8.9.7.29-1+cuda12.2
tensorrt_version=10.7.0.23-1+cuda12.6
pre_commit_clang_format_version=17.0.5
6 changes: 3 additions & 3 deletions ansible/roles/cuda/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cuda

This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) following [this page](https://developer.nvidia.com/cuda-12-3-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network) and [this page](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions).
This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) following [this page](https://developer.nvidia.com/cuda-12-4-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network) and [this page](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions).

This role also registers Vulkan, OpenGL, and OpenCL GPU vendors for future use.

Expand All @@ -15,7 +15,7 @@ This role also registers Vulkan, OpenGL, and OpenCL GPU vendors for future use.

### Version compatibility

Autoware currently uses CUDA `12.3` and from this [CUDA Application Compatibility Support Matrix](https://docs.nvidia.com/deploy/cuda-compatibility/#use-the-right-compat-package) that only the NVIDIA driver version `545` is compatible with this version of CUDA.
Autoware currently uses CUDA `12.6` which corresponds to the NVIDIA driver version `560` and is minimum required driver version.

#### 🛠️ For Advanced Users

Expand All @@ -42,7 +42,7 @@ sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
cuda_version_dashed=$(eval sed -e "s/[.]/-/g" <<< "${cuda_version}")
sudo apt-get -y install cuda-toolkit-${cuda_version_dashed}
sudo apt-get install -y cuda-drivers-545
sudo apt-get install -y cuda-drivers-560
```

Perform the post installation actions:
Expand Down
49 changes: 39 additions & 10 deletions ansible/roles/tensorrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,63 @@ This role installs TensorRT and cuDNN following [the official NVIDIA TensorRT In

## Manual Installation

### AMD64

```bash
# For the environment variables
wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env

sudo apt-get install -y \
libcudnn8=${cudnn_version} \
libnvinfer8=${tensorrt_version} \
libnvinfer-plugin8=${tensorrt_version} \
libnvparsers8=${tensorrt_version} \
libnvonnxparsers8=${tensorrt_version} \
libnvinfer10=${tensorrt_version} \
libnvinfer-plugin10=${tensorrt_version} \
libnvonnxparsers10=${tensorrt_version} \
libcudnn8-dev=${cudnn_version} \
libnvinfer-dev=${tensorrt_version} \
libnvinfer-plugin-dev=${tensorrt_version} \
libnvinfer-headers-dev=${tensorrt_version} \
libnvinfer-headers-plugin-dev=${tensorrt_version} \
libnvparsers-dev=${tensorrt_version} \
libnvonnxparsers-dev=${tensorrt_version}

sudo apt-mark hold \
libcudnn8 \
libnvinfer8 \
libnvinfer-plugin8 \
libnvparsers8 \
libnvonnxparsers8 \
libnvinfer10 \
libnvinfer-plugin10 \
libnvonnxparsers10 \
libcudnn8-dev \
libnvinfer-dev \
libnvinfer-plugin-dev \
libnvparsers-dev \
libnvonnxparsers-dev \
libnvinfer-headers-dev \
libnvinfer-headers-plugin-dev
```

### ARM64

```bash
# For the environment variables
wget -O /tmp/arm64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/arm64.env && source /tmp/arm64.env

sudo apt-get install -y \
libcudnn9-cuda-12=${cudnn_version} \
libnvinfer10=${tensorrt_version} \
libnvinfer-plugin10=${tensorrt_version} \
libnvonnxparsers10=${tensorrt_version} \
libcudnn9-dev-cuda-12=${cudnn_version} \
libnvinfer-dev=${tensorrt_version} \
libnvinfer-plugin-dev=${tensorrt_version} \
libnvinfer-headers-dev=${tensorrt_version} \
libnvinfer-headers-plugin-dev=${tensorrt_version} \
libnvonnxparsers-dev=${tensorrt_version}

sudo apt-mark hold \
libcudnn9-cuda-12 \
libnvinfer10 \
libnvinfer-plugin10 \
libnvonnxparsers10 \
libcudnn9-dev-cuda-12 \
libnvinfer-dev \
libnvinfer-plugin-dev \
libnvonnxparsers-dev \
libnvinfer-headers-dev \
libnvinfer-headers-plugin-dev
Expand Down
23 changes: 10 additions & 13 deletions ansible/roles/tensorrt/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
become: true
ansible.builtin.apt:
name:
- libcudnn8={{ cudnn_version }}
- libnvinfer8={{ tensorrt_version }}
- libnvinfer-plugin8={{ tensorrt_version }}
- libnvparsers8={{ tensorrt_version }}
- libnvonnxparsers8={{ tensorrt_version }}
- "{{ 'libcudnn9-cuda-12=' + cudnn_version if ansible_architecture == 'aarch64' else 'libcudnn8=' + cudnn_version }}"
- libnvinfer10={{ tensorrt_version }}
- libnvinfer-plugin10={{ tensorrt_version }}
- libnvonnxparsers10={{ tensorrt_version }}
allow_change_held_packages: true
allow_downgrade: true
update_cache: true
Expand All @@ -15,12 +14,11 @@
become: true
ansible.builtin.apt:
name:
- libcudnn8-dev={{ cudnn_version }}
- "{{ 'libcudnn9-dev-cuda-12=' + cudnn_version if ansible_architecture == 'aarch64' else 'libcudnn8-dev=' + cudnn_version }}"
- libnvinfer-dev={{ tensorrt_version }}
- libnvinfer-plugin-dev={{ tensorrt_version }}
- libnvinfer-headers-dev={{ tensorrt_version }}
- libnvinfer-headers-plugin-dev={{ tensorrt_version }}
- libnvparsers-dev={{ tensorrt_version }}
- libnvonnxparsers-dev={{ tensorrt_version }}
allow_change_held_packages: true
allow_downgrade: true
Expand All @@ -34,23 +32,22 @@
name: "{{ item }}"
selection: hold
with_items:
- "{{ 'libcudnn9-cuda-12' if ansible_architecture == 'aarch64' else 'libcudnn8' }}"
- libcudnn8
- libnvinfer8
- libnvinfer-plugin8
- libnvparsers8
- libnvonnxparsers8
- libnvinfer10
- libnvinfer-plugin10
- libnvonnxparsers10

- name: Prevent CUDA-related Dev packages from upgrading
become: true
ansible.builtin.dpkg_selections:
name: "{{ item }}"
selection: hold
with_items:
- libcudnn8-dev
- "{{ 'libcudnn9-dev-cuda-12' if ansible_architecture == 'aarch64' else 'libcudnn8-dev' }}"
- libnvinfer-dev
- libnvinfer-plugin-dev
- libnvinfer-headers-dev
- libnvinfer-headers-plugin-dev
- libnvparsers-dev
- libnvonnxparsers-dev
when: install_devel == 'y'
4 changes: 2 additions & 2 deletions arm64.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Override amd64's settings
cudnn_version=8.9.6.50-1+cuda12.2
tensorrt_version=8.6.2.2-1+cuda12.0
cudnn_version=9.3.0.75-1
tensorrt_version=10.3.0.30-1+cuda12.5
Loading