From f6e642978995c4ac6ac9f053919b86d46a02d6ee Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sun, 20 Aug 2023 03:54:11 -0500 Subject: [PATCH] refactor(arch): disable Nvidia dgpu with udev rules --- roles/arch-post-setup/tasks/disable-gpu.yml | 38 ++++++++++----------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/roles/arch-post-setup/tasks/disable-gpu.yml b/roles/arch-post-setup/tasks/disable-gpu.yml index be9bf60..eeb10a2 100644 --- a/roles/arch-post-setup/tasks/disable-gpu.yml +++ b/roles/arch-post-setup/tasks/disable-gpu.yml @@ -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"