Skip to content
Snippets Groups Projects
Commit ea29138f authored by Chris Hines's avatar Chris Hines
Browse files

Merge branch 'update_gpu' into 'master'

updates to the gpu role

See merge request !54
parents 5459641a f666f6aa
No related branches found
No related tags found
No related merge requests found
......@@ -25,74 +25,89 @@
- xorg-x11-proto-devel
- xorg-x11-xkb-utils
- name: Add nouveau from blacklist
lineinfile:
args:
dest: /etc/modprobe.d/blacklist.conf
line: "blacklist nouveau"
state: present
sudo: true
- name: install development tools
yum: name="@Development Tools" state=installed
become: true
become_user: root
- name: Template disable-nouvear.conf
template: dest=/etc/modprobe.d/disable-nouveau.conf src=disable-nouveau.conf.j2
sudo: true
- name: Template nvidia.conf
template: dest=/etc/modprobe.d/nvidia.conf src=nvidia.conf.j2
sudo: true
- name: disable nouveau
template: src=blacklist-nouveau.conf.j2 dest=/etc/modprobe.d/blacklist-nouveau.conf
become: true
become_user: root
- name: check nvidia driver
shell: ls /usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
register: has_been_compiled
register: drivers_installed
ignore_errors: true
- name: Copy boot file
template: src=grub.conf.j2 dest=/boot/grub/grub.conf
sudo: true
- name: get nvidia driver
shell: wget http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
args:
chdir: /tmp
creates: /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo: true
when: drivers_installed | failed
- name: Copy X config file
template: src=xorg.conf.j2 dest=/etc/X11/xorg.conf
sudo: true
#- name: Copy boot file
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
# sudo: true
#
#- name: Copy X config file
# template: src=xorg.conf.j2 dest=/etc/X11/xorg.conf
# sudo: true
- name: Copy xserver file
template: src=xserver.j2 dest=/etc/pam.d/xserver
sudo: true
- name: look for nouveau
shell: /usr/sbin/lsmod
register: lsmod_output
- name: set nouveau string
set_fact: nouveau='nouveau'
- name: restart_host
command: shutdown -r now "Reboot triggered by Ansible"
async: 900
poll: 60
shell: sleep 5 ; shutdown -r now "Reboot triggered by Ansible"
async: 2
poll: 1
sudo: true
ignore_errors: true
when: has_been_compiled | failed
when: nouveau in lsmod_output.stdout
- name: waiting for server to come back
local_action: wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
when: nouveau in lsmod_output.stdout
- name: wait_restart
local_action: wait_for host="{{ inventory_hostname }}" port=22 delay=5 timeout=600
sudo: true
when: has_been_compiled | failed
- name: get nvidia driver
shell: wget http://us.download.nvidia.com/XFree86/Linux-x86_64/{{ nvidia_version }}/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
args:
chdir: /tmp
creates: /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo: true
when: has_been_compiled | failed
- name: build nvidia driver
shell: chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent --kernel-source-path /usr/src/kernels/{{ kernel_version }}.el6.x86_64
shell: chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
sudo: true
when: has_been_compiled | failed
when: drivers_installed | failed
- name: set persistence mode
lineinfile:
args:
dest: /etc/rc.d/rc.local
line: "nvidia-smi --persistence-mode=1"
state: present
- name: restart_host
shell: sleep 5 ; shutdown -r now "Reboot triggered by Ansible"
async: 2
poll: 1
sudo: true
ignore_errors: true
when: drivers_installed | failed
- name: Load module
shell: modprobe nvidia
sudo: true
- name: waiting for server to come back
local_action: wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
when: drivers_installed|failed
#- name: set persistence mode
# lineinfile:
# args:
# dest: /etc/rc.d/rc.local
# line: "nvidia-smi --persistence-mode=1"
# state: present
# sudo: true
#- name: Load module
# shell: modprobe nvidia
# sudo: true
blacklist nouveau
options nouveau modeset=0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment