diff --git a/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu.yaml b/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu.yaml new file mode 100644 index 000000000..b09ca0f9b --- /dev/null +++ b/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu.yaml @@ -0,0 +1,29 @@ +--- +# Implements the NVIDIA Driver Installation Quickstart Guide for Ubuntu LTS - see +# https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#ubuntu-lts + +- name: install runfile prereqs + apt: + name: + - linux-headers-{{ ansible_kernel }} + - build-essential + - gcc-12 + - g++-12 + state: present + update_cache: true + retries: 3 + delay: 3 + +- name: configure update-alternatives for gcc + ansible.builtin.command: + cmd: "{{ item }}" + with_items: + - "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12" + - "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 12" + +- name: set gcc 12 as default + ansible.builtin.command: + cmd: "{{ item }}" + with_items: + - "update-alternatives --set gcc /usr/bin/gcc-12" + - "update-alternatives --set cc /usr/bin/gcc-12" diff --git a/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu20.yaml b/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu20.yaml deleted file mode 100644 index b760733d1..000000000 --- a/ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu20.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Implements the NVIDIA Driver Installation Quickstart Guide for Ubuntu LTS - see -# https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#ubuntu-lts - -- name: install runfile prereqs - apt: - name: - - linux-headers-{{ ansible_kernel }} - - build-essential - state: present - update_cache: true - retries: 3 - delay: 3 diff --git a/ansible/roles/gpu/tasks/nvidia-gpu.yaml b/ansible/roles/gpu/tasks/nvidia-gpu.yaml index 4910d62c6..940d27448 100644 --- a/ansible/roles/gpu/tasks/nvidia-gpu.yaml +++ b/ansible/roles/gpu/tasks/nvidia-gpu.yaml @@ -11,8 +11,8 @@ include_tasks: nvidia-gpu-Flatcar.yaml when: ansible_distribution == "Flatcar" -- name: "NVIDIA Gpu - Ubuntu 20" - include_tasks: nvidia-gpu-Ubuntu20.yaml +- name: "NVIDIA Gpu - Ubuntu" + include_tasks: nvidia-gpu-Ubuntu.yaml when: ansible_distribution == "Ubuntu" # disable with these instructions https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-nouveau @@ -117,6 +117,7 @@ --no-cc-version-check args: chdir: "{{ nvidia_remote_bundle_path }}/NVIDIA-Linux-x86_64-{{ nvidia_driver_version }}" + become: yes # solves for this ERROR: nvidia-installer must be run as root - name: Create ld.so conf dir file: