feat: initial commit — Ansible roles storage-01/gpu-01 opérationnels

This commit is contained in:
alkatrazz 2026-05-12 17:17:03 +02:00
commit b3fce8af5d
70 changed files with 2688 additions and 0 deletions

View file

@ -0,0 +1,25 @@
---
rocm_rhel_version: "9.4"
rocm_amdgpu_repo: "https://repo.radeon.com/amdgpu/latest/rhel/{{ rocm_rhel_version }}/main/x86_64/"
rocm_repo: "https://repo.radeon.com/rocm/rhel9/latest/main/"
rocm_gpg_key: "https://repo.radeon.com/rocm/rocm.gpg.key"
rocm_packages:
- rocminfo
- rocm-hip-runtime
- rocm-opencl-runtime
- rocblas
- hipblaslt
# Packages supplémentaires requis pour compiler llama.cpp from source (rôle llama_server)
rocm_build_packages:
- hipblas-devel
- rocblas-devel
- hip-devel
- hipcc
- cmake
- gcc-c++
- git
- patchelf
hsa_override_gfx_version: "10.3.0"

View file

@ -0,0 +1,6 @@
---
- name: Reload amdgpu module
ansible.builtin.shell: |
modprobe -r amdgpu || true
modprobe amdgpu
changed_when: true

View 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'