software-infrastructure/nvidia_test.yml
2024-07-04 19:04:55 +00:00

26 lines
1.0 KiB
YAML

# my playbook
- name: Install Nvidia drivers
hosts: alpha-worker-0
become: true
pre_tasks:
- name: Add contrib & non-free repository
replace:
dest: /etc/apt/sources.list
regexp: '^(deb(?!.* contrib).*)'
replace: '\1 contrib non-free'
- name: Install Linux headers
apt:
name: linux-headers-{{ ansible_kernel }}
state: present
roles:
- role: nvidia.nvidia_driver # should run after cluster install
vars:
# See https://github.com/NVIDIA/ansible-role-nvidia-driver#role-variables
nvidia_driver_skip_reboot: no
nvidia_driver_branch: "555"
nvidia_driver_ubuntu_cuda_repo_baseurl: 'https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64' # enforced 'debian11'
nvidia_driver_ubuntu_cuda_keyring_package: "cuda-keyring_1.1-1_all.deb"
nvidia_driver_ubuntu_install_from_cuda_repo: yes
nvidia_driver_persistence_mode_on: yes
ansible_distribution: Ubuntu # forcing in to the ubuntu part of the role