From 38a1abe7e79e970eb2b776c152a4d36ca9680827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 5 May 2024 11:55:06 +0200 Subject: [PATCH] Configure nvidia properly --- _machines/neptune.yml | 2 + playbook.yml | 76 ++++++++++++++++++++------------- remove-unconfigured-packages.sh | 1 - 3 files changed, 48 insertions(+), 31 deletions(-) diff --git a/_machines/neptune.yml b/_machines/neptune.yml index 8ed79e9..fd9cf0c 100644 --- a/_machines/neptune.yml +++ b/_machines/neptune.yml @@ -1,6 +1,8 @@ font_size_1: 12 font_size_2: 12 +gpu: nvidia + users: - name: hannes-work vt: 1 diff --git a/playbook.yml b/playbook.yml index 655df8e..193f616 100644 --- a/playbook.yml +++ b/playbook.yml @@ -607,39 +607,55 @@ permit nopass nolog setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin} :sudonopw become: true - - block: - - name: install AMDGPU packages - package: - name: - - mesa - - lib32-mesa - - xf86-video-amdgpu - - vulkan-radeon - - lib32-vulkan-radeon - - libva-mesa-driver - - lib32-libva-mesa-driver - - mesa-vdpau - - lib32-mesa-vdpau - state: present - become: true + - name: gpu configuration + tags: + - gpu + block: + - name: AMD configuration + when: machine.gpu == 'amd' + block: + - name: install AMDGPU packages + package: + name: + - mesa + - lib32-mesa + - xf86-video-amdgpu + - vulkan-radeon + - lib32-vulkan-radeon + - libva-mesa-driver + - lib32-libva-mesa-driver + - mesa-vdpau + - lib32-mesa-vdpau + state: present + become: true - - name: set AMDGPU options - copy: - owner: root - group: root - mode: "0600" - dest: /etc/X11/xorg.conf.d/20-amdgpu.conf - content: | - Section "Device" - Identifier "AMD" - Driver "amdgpu" - Option "VariableRefresh" "true" - Option "TearFree" "true" - EndSection - become: true + - name: set AMDGPU options + copy: + owner: root + group: root + mode: "0600" + dest: /etc/X11/xorg.conf.d/20-amdgpu.conf + content: | + Section "Device" + Identifier "AMD" + Driver "amdgpu" + Option "VariableRefresh" "true" + Option "TearFree" "true" + EndSection + become: true + - name: Nvidia configuration + when: machine.gpu == 'nvidia' + block: + - name: install nouveau packages + package: + name: + - mesa + - lib32-mesa + state: present + become: true when: - - machine.gpu is defined and machine.gpu == 'amd' + - machine.gpu is defined - set_fact: users: "{{ machine.users }}" diff --git a/remove-unconfigured-packages.sh b/remove-unconfigured-packages.sh index cbefc31..123c427 100755 --- a/remove-unconfigured-packages.sh +++ b/remove-unconfigured-packages.sh @@ -3,7 +3,6 @@ declare -a aurdeps=() proctected=( - nvidia-dkms intel-ucode amd-ucode base