Skip to content

Commit

Permalink
update cuda and dev_tools too
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx committed Nov 17, 2024
1 parent 1d47f47 commit 12dae6a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
36 changes: 27 additions & 9 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-downloads?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-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 also registers Vulkan, OpenGL, and OpenCL GPU vendors for future use.

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

## Manual Installation

Follow these instructions to download and install the CUDA Toolkit and the corresponding NVIDIA Driver for Ubuntu 20.04.
### Version compatibility

For Universe, the `cuda_version` version can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)
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.

#### 🛠️ For Advanced Users

⚠️ **Proceed with caution**: Avoid removing essential system components.

To prevent conflicts during NVIDIA installation, we recommend completely removing old NVIDIA Drivers and CUDA by following this guide: [How can I uninstall a NVIDIA driver completely?](https://askubuntu.com/a/206289/761440).

- **Important**: If you remove the previous NVIDIA drivers, ensure you install the recommended versions listed below **before restarting your system**.

Once the drivers are installed correctly, you may safely restart your system.

### CUDA Toolkit and Driver

Follow these instructions to download and install the CUDA Toolkit.

From: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#network-repo-installation-for-ubuntu

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

# 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}
sudo apt-get -y install cuda-toolkit-${cuda_version_dashed}
sudo apt-get install -y cuda-drivers-545
```

Perform the post installation actions:
Expand All @@ -37,9 +51,13 @@ Perform the post installation actions:
# Taken from: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
```

# Register Vulkan, OpenGL, and OpenCL GPU vendors
### GPU Vendors

Register Vulkan, OpenGL, and OpenCL GPU vendors following the instructions below.

```bash
# Create Vulkan directory
sudo mkdir -p /etc/vulkan/icd.d
sudo chmod 0755 /etc/vulkan/icd.d
Expand All @@ -64,4 +82,4 @@ sudo chmod 0644 /etc/glvnd/egl_vendor.d/10_nvidia.json
sudo touch /etc/OpenCL/vendors/nvidia.icd
echo "libnvidia-opencl.so.1" | sudo tee /etc/OpenCL/vendors/nvidia.icd > /dev/null
sudo chmod 0644 /etc/OpenCL/vendors/nvidia.icd
```
```
21 changes: 7 additions & 14 deletions ansible/roles/dev_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,26 @@ This role installs optional development tools for Autoware.
## Inputs

| Name | Required | Description |
| ------------- | -------- | --------------------------------------- |
|---------------| -------- | --------------------------------------- |
| clang-version | true | The version of clang-format to install. |
| ros-distro | true | The ROS distribution. |
| rosdistro | true | The ROS distribution. |

## Manual Installation

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

# Update package lists
sudo apt-get update

# Install Git LFS
sudo apt install python3-pip
sudo apt-get install -y golang
sudo apt-get install -y ros-${rosdistro}-plotjuggler-ros
sudo apt-get install -y git-lfs

# Setup Git LFS
git lfs install

# Install pre-commit using pip3
pip3 install pre-commit

# Install a specific version of clang-format using pip3
pip3 install clang-format==${pre_commit_clang_format_version}

# Install Go
sudo apt-get install -y golang

# Install PlotJuggler
sudo apt-get install -y ros-${ROS_DISTRO}-plotjuggler-ros
```

0 comments on commit 12dae6a

Please sign in to comment.