Configure nvidia properly

This commit is contained in:
2024-05-05 11:55:06 +02:00
parent 63d998c1a4
commit 38a1abe7e7
3 changed files with 48 additions and 31 deletions

View File

@@ -1,6 +1,8 @@
font_size_1: 12
font_size_2: 12
gpu: nvidia
users:
- name: hannes-work
vt: 1

View File

@@ -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 }}"

View File

@@ -3,7 +3,6 @@
declare -a aurdeps=()
proctected=(
nvidia-dkms
intel-ucode
amd-ucode
base