--- # tasks file for nvidia - name: install nvidia pacman: name: - nvidia - nvidia-utils - nvidia-libgl - lib32-nvidia-utils state: present become: yes when: gpu is defined and gpu.nvidia == true - name: install bumblebee pacman: name: - bumblebee - primus state: present become: yes when: gpu is defined and gpu.bumblebee == true - name: Allowing a user to use the "optirun" and "primusrun" commands user: name: "{{ user.name }}" groups: bumblebee append: yes become: yes when: gpu is defined and gpu.bumblebee == true - name: Enabling Bumblebee systemd: name: bumblebeed enabled: yes become: yes when: gpu is defined and gpu.bumblebee == true - name: Create bbswitch module configuration files file: path: /etc/modprobe.d/bbswitch.conf state: touch mode: 0644 owner: root group: root when: gpu is defined and gpu.bumblebee == true become: yes - name: Load the bbswitch module on boot lineinfile: path: /etc/modprobe.d/bbswitch.conf line: bbswitch when: gpu is defined and gpu.bumblebee == true become: yes - name: Disable the Nvidia card on boot to save power lineinfile: path: /etc/modprobe.d/bbswitch.conf line: options bbswitch load_state=0 unload_state=1 when: gpu is defined and gpu.bumblebee == true become: yes