|
1 | 1 |
|
2 |
| -# Based on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#redhat8-installation |
3 |
| - |
4 |
| -- name: Check for OFED/DOCA |
5 |
| - command: |
6 |
| - cmd: dnf list --installed rdma-core |
7 |
| - register: _dnf_rdma_core |
8 |
| - changed_when: false |
9 |
| - |
10 |
| -- name: Assert OFED installed |
11 |
| - assert: |
12 |
| - that: "'mlnx' in _dnf_rdma_core.stdout" |
13 |
| - fail_msg: "Did not find 'mlnx' in installed rdma-core package, is OFED/DOCA installed?" |
| 2 | +# Based on https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/ |
14 | 3 |
|
15 | 4 | - name: Install cuda repo
|
16 | 5 | get_url:
|
|
29 | 18 | when: "'No matching Modules to list' in _cuda_driver_module_enabled.stderr"
|
30 | 19 | changed_when: "'Nothing to do' not in _cuda_driver_module_enable.stdout"
|
31 | 20 |
|
32 |
| -- name: Check if nvidia driver module is installed |
33 |
| - ansible.builtin.command: dnf module list --installed nvidia-driver |
34 |
| - changed_when: false |
35 |
| - failed_when: false |
36 |
| - register: _cuda_driver_module_installed |
37 |
| - |
38 | 21 | - name: Install nvidia drivers
|
39 |
| - ansible.builtin.command: dnf module install -y nvidia-driver |
| 22 | + ansible.builtin.command: dnf install -y nvidia-open |
40 | 23 | register: _cuda_driver_install
|
41 | 24 | when: "'No matching Modules to list' in _cuda_driver_module_installed.stderr"
|
42 | 25 | changed_when: "'Nothing to do' not in _cuda_driver_install.stdout"
|
|
46 | 29 | that: "'kernel ' not in _cuda_driver_install.stdout | default('')" # space ensures we don't flag e.g. kernel-devel-matched
|
47 | 30 | fail_msg: "{{ _cuda_driver_install.stdout_lines | default([]) | select('search', 'kernel ') }}"
|
48 | 31 |
|
| 32 | +# Based on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html |
| 33 | + |
49 | 34 | - name: Install cuda packages
|
50 | 35 | ansible.builtin.dnf:
|
51 | 36 | name: "{{ cuda_packages }}"
|
|
0 commit comments