Skip to content

Commit

Permalink
build: update to CUDA 12.3 (#3956)
Browse files Browse the repository at this point in the history
* build: update to CUDA 12.3

Signed-off-by: Esteve Fernandez <[email protected]>

* build: cuDNN and TensorRT packages are installed in a separate Ansible script

Signed-off-by: Esteve Fernandez <[email protected]>

---------

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve authored Nov 13, 2023
1 parent d04c4a6 commit a08fc46
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 35 deletions.
6 changes: 3 additions & 3 deletions amd64.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ rmw_implementation=rmw_cyclonedds_cpp
base_image=ubuntu:22.04
cuda_base_image=ubuntu:22.04
prebuilt_base_image=ubuntu:22.04
cuda_version=11.6
cudnn_version=8.4.1.50-1+cuda11.6
tensorrt_version=8.4.2-1+cuda11.6
cuda_version=12.3

This comment has been minimized.

Copy link
@kaspermeck-arm

kaspermeck-arm Dec 7, 2023

@mitsudome-r - can we downgrade this to 12.2 to match https://developer.nvidia.com/embedded/jetpack?

cudnn_version=8.9.5.29-1+cuda12.2
tensorrt_version=8.6.1.6-1+cuda12.0
19 changes: 5 additions & 14 deletions ansible/roles/cuda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@ For Universe, the `cuda_version` version can also be found in:
```bash
wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env

# Modified from: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network

# A temporary workaround for Ubuntu 22.04 with the ubuntu2004 repository
if [[ "$(uname -m)" == "x86_64" ]]; then
liburcu6_url=http://archive.ubuntu.com/ubuntu
else
liburcu6_url=http://ports.ubuntu.com/ubuntu-ports
fi
sudo echo "deb $liburcu6_url focal main restricted" > /etc/apt/sources.list.d/focal.list

# TODO: Use 22.04 in https://github.com/autowarefoundation/autoware/pull/3084. Currently, 20.04 is intentionally used.
os=ubuntu2004
wget https://developer.download.nvidia.com/compute/cuda/repos/$os/$(uname -m)/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
# From: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#network-repo-installation-for-ubuntu

os=ubuntu2204
wget https://developer.download.nvidia.com/compute/cuda/repos/$os/$(uname -m)/cuda-keyring_1.1-1_all.deb
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-${cuda_version_dashed}
Expand Down
27 changes: 9 additions & 18 deletions ansible/roles/cuda/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@
register: cuda_architecture
changed_when: false

- name: (tmp for Ubuntu 22.04) Add liburcu6 repository into sources.list for amd64
become: true
ansible.builtin.apt_repository:
repo: deb http://archive.ubuntu.com/ubuntu focal main restricted
filename: focal
state: present
when: cuda_architecture.stdout == "x86_64"

- name: (tmp for Ubuntu 22.04) Add liburcu6 repository into sources.list for arm64
become: true
ansible.builtin.apt_repository:
repo: deb http://ports.ubuntu.com/ubuntu-ports focal main restricted
filename: focal
state: present
when: cuda_architecture.stdout == "aarch64"

- name: Remove old /etc/apt/sources.list.d/cuda.list
become: true
ansible.builtin.file:
Expand All @@ -33,7 +17,7 @@
- name: Install CUDA keyring
become: true
ansible.builtin.apt:
deb: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/{{ cuda_architecture.stdout }}/cuda-keyring_1.0-1_all.deb
deb: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/{{ cuda_architecture.stdout }}/cuda-keyring_1.1-1_all.deb
update_cache: true

- name: Get dash-case name of cuda_version
Expand All @@ -50,13 +34,20 @@
- cuda-minimal-build-{{ cuda__dash_case_cuda_version.stdout }}
- cuda-libraries-dev-{{ cuda__dash_case_cuda_version.stdout }}
- cuda-nvml-dev-{{ cuda__dash_case_cuda_version.stdout }}
- cuda-nvprof-{{ cuda__dash_case_cuda_version.stdout }}
- libnpp-dev-{{ cuda__dash_case_cuda_version.stdout }}
- libcusparse-dev-{{ cuda__dash_case_cuda_version.stdout }}
- libcublas-dev-{{ cuda__dash_case_cuda_version.stdout }}
- libnccl-dev
update_cache: true

- name: Install extra CUDA libraries for x86_64
become: true
ansible.builtin.apt:
name:
- cuda-nvprof-{{ cuda__dash_case_cuda_version.stdout }}
update_cache: true
when: cuda_architecture.stdout == "x86_64"

- name: Install cuda-drivers
become: true
ansible.builtin.apt:
Expand Down
2 changes: 2 additions & 0 deletions arm64.env
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Override amd64's settings
cudnn_version=8.9.6.50-1+cuda12.2
tensorrt_version=8.6.2.2-1+cuda12.0

0 comments on commit a08fc46

Please sign in to comment.