|
1 | 1 |
|
2 | 2 | # Based on https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#redhat8-installation
|
3 | 3 |
|
4 |
| -- name: Check for OFED |
| 4 | +- name: Check for OFED/DOCA |
5 | 5 | command:
|
6 | 6 | cmd: dnf list --installed rdma-core
|
7 | 7 | register: _dnf_rdma_core
|
|
10 | 10 | - name: Assert OFED installed
|
11 | 11 | assert:
|
12 | 12 | that: "'mlnx' in _dnf_rdma_core.stdout"
|
13 |
| - fail_msg: "Did not find 'mlnx' in installed rdma-core package, is OFED installed?" |
| 13 | + fail_msg: "Did not find 'mlnx' in installed rdma-core package, is OFED/DOCA installed?" |
14 | 14 |
|
15 | 15 | - name: Install cuda repo
|
16 | 16 | get_url:
|
17 |
| - dest: "/etc/yum.repos.d/cuda-{{ cuda_distro }}.repo" |
18 |
| - url: "{{ cuda_repo }}" |
| 17 | + dest: "/etc/yum.repos.d/cuda-rhel{{ ansible_distribution_major_version }}.repo" |
| 18 | + url: "{{ cuda_repo_url }}" |
19 | 19 |
|
20 | 20 | - name: Check if nvidia driver module is enabled
|
21 | 21 | shell:
|
|
25 | 25 | register: _cuda_driver_module_enabled
|
26 | 26 |
|
27 | 27 | - name: Enable nvidia driver module
|
28 |
| - ansible.builtin.command: "dnf module enable -y nvidia-driver:open-dkms" |
| 28 | + ansible.builtin.command: "dnf module enable -y nvidia-driver:{{ cuda_driver_stream }}" |
29 | 29 | register: _cuda_driver_module_enable
|
30 | 30 | when: "'No matching Modules to list' in _cuda_driver_module_enabled.stderr"
|
31 | 31 | changed_when: "'Nothing to do' not in _cuda_driver_module_enable.stdout"
|
|
36 | 36 | when: "'No matching Modules to list' in _cuda_driver_module_enabled.stderr"
|
37 | 37 | changed_when: "'Nothing to do' not in _cuda_driver_install.stdout"
|
38 | 38 |
|
| 39 | +- name: Check kernel has not been modified |
| 40 | + assert: |
| 41 | + that: "'kernel' not in _cuda_driver_install.stdout" |
| 42 | + |
39 | 43 | - name: Install cuda packages
|
40 | 44 | ansible.builtin.dnf:
|
41 | 45 | name: "{{ cuda_packages }}"
|
|
0 commit comments