2019-04-11 16:52:29 +00:00
|
|
|
---
|
|
|
|
# tasks file for nvidia
|
|
|
|
|
|
|
|
- name: install nvidia
|
|
|
|
pacman:
|
|
|
|
name:
|
2020-01-30 19:55:50 +00:00
|
|
|
- nvidia
|
|
|
|
- nvidia-utils
|
2020-03-01 20:06:02 +00:00
|
|
|
- libxnvctrl
|
2020-01-30 19:55:50 +00:00
|
|
|
- lib32-nvidia-utils
|
2019-04-11 16:52:29 +00:00
|
|
|
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
|