Skip to content

Commit

Permalink
fix: ubuntu 22.04 gpu support
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq committed Dec 23, 2024
1 parent 5e70596 commit f7d5d74
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
29 changes: 29 additions & 0 deletions ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 0 additions & 13 deletions ansible/roles/gpu/tasks/nvidia-gpu-Ubuntu20.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions ansible/roles/gpu/tasks/nvidia-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f7d5d74

Please sign in to comment.