mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-08 08:44:43 +02:00
feat: initial commit — Ansible roles storage-01/gpu-01 opérationnels
This commit is contained in:
commit
b3fce8af5d
70 changed files with 2688 additions and 0 deletions
60
ansible/roles/rocm/tasks/main.yml
Normal file
60
ansible/roles/rocm/tasks/main.yml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
- name: Import AMD GPG key
|
||||
ansible.builtin.rpm_key:
|
||||
key: "{{ rocm_gpg_key }}"
|
||||
state: present
|
||||
|
||||
- name: Add amdgpu repository
|
||||
ansible.builtin.yum_repository:
|
||||
name: amdgpu
|
||||
description: AMD GPU drivers
|
||||
baseurl: "{{ rocm_amdgpu_repo }}"
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
gpgkey: "{{ rocm_gpg_key }}"
|
||||
|
||||
- name: Add ROCm repository
|
||||
ansible.builtin.yum_repository:
|
||||
name: rocm
|
||||
description: ROCm
|
||||
baseurl: "{{ rocm_repo }}"
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
gpgkey: "{{ rocm_gpg_key }}"
|
||||
|
||||
- name: Install kernel headers and devel (requis pour amdgpu-dkms)
|
||||
ansible.builtin.dnf:
|
||||
name:
|
||||
- kernel-headers
|
||||
- kernel-devel
|
||||
state: present
|
||||
|
||||
- name: Install ROCm packages
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ rocm_packages }}"
|
||||
state: present
|
||||
notify: Reload amdgpu module
|
||||
|
||||
- name: Add ansible user to video and render groups
|
||||
ansible.builtin.user:
|
||||
name: "{{ ansible_service_user }}"
|
||||
groups:
|
||||
- video
|
||||
- render
|
||||
append: true
|
||||
|
||||
- name: Set HSA_OVERRIDE_GFX_VERSION system-wide
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/environment
|
||||
regexp: '^HSA_OVERRIDE_GFX_VERSION='
|
||||
line: "HSA_OVERRIDE_GFX_VERSION={{ hsa_override_gfx_version }}"
|
||||
create: true
|
||||
mode: '0644'
|
||||
|
||||
- name: Set HSA_OVERRIDE_GFX_VERSION dans profile.d (sessions interactives)
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/profile.d/rocm.sh
|
||||
content: |
|
||||
export HSA_OVERRIDE_GFX_VERSION={{ hsa_override_gfx_version }}
|
||||
export PATH=$PATH:/opt/rocm/bin
|
||||
mode: '0644'
|
||||
Loading…
Add table
Add a link
Reference in a new issue