refactor(arch): disable Nvidia dgpu with udev rules

This commit is contained in:
Price Hiller 2023-08-20 03:54:11 -05:00
parent 2fd483026b
commit f6e6429789
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -1,19 +1,4 @@
- name: Install Bumblebee and bbswitch
become: true
community.general.pacman:
name:
- bumblebee
- bbswitch
state: present
- name: Enable and Start Bumblebeed
become: true
ansible.builtin.systemd:
name: bumblebeed.service
state: started
enabled: true
- name: Write bbswitch.conf to modprobe.d & modules-load.d
- name: Disable Nvidia GPU
become: true
ansible.builtin.copy:
content: "{{ item.content }}"
@ -22,7 +7,20 @@
owner: root
group: root
loop:
- content: "options bbswitch load_state=0"
dest: "/etc/modprobe.d/bbswitch.conf"
- content: "bbswitch"
dest: "/etc/modules-load.d/bbswitch.conf"
- content: |
blacklist nouveau
options nouveau modeset=0
dest: "/etc/modprobe.d/blacklist-nouveau.conf"
- content: |
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
dest: "/etc/udev/rules.d/00-remove-nvidia.rules"