-
Notifications
You must be signed in to change notification settings - Fork 1
/
rhel-nvidia-cuda.yml
49 lines (41 loc) · 1.3 KB
/
rhel-nvidia-cuda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: RHEL nvidia cuda hosts
hosts: rhelcuda
tasks:
# NOTE: Requires `ansible-galaxy install geerlingguy.repo-epel
- name: Install EPEL
ansible.builtin.import_role:
name: 'geerlingguy.repo-epel'
- name: Add nvidia official repos
ansible.builtin.get_url:
url: "https://developer.download.nvidia.com/compute/cuda/repos/rhel{{ansible_distribution_major_version}}/{{ansible_architecture}}/cuda-rhel{{ansible_distribution_major_version}}.repo"
dest: "/etc/yum.repos.d/cuda-rhel{{ansible_distribution_major_version}}.repo"
mode: "0644"
- name: Clear dnf cache
ansible.builtin.dnf:
update_cache: true
- name: Package Install nvidiia drivers
ansible.builtin.dnf:
state: installed
name:
- "@nvidia-driver:latest-dkms"
notify: Reboot
- name: Blacklist nouveu
ansible.builtin.copy:
src: files/blacklist-nouveau.conf
dest: /etc/modprobe.d/blacklist-nouveau.conf
mode: "0644"
notify: Reboot
- name: Install cuda
ansible.builtin.dnf:
state: installed
name:
- cuda-toolkit
- nvidia-gds
- nvtop
- libcudnn8
- libnccl
handlers:
- name: Reboot
ansible.builtin.reboot:
# vim: ft=yaml.ansible