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

Merge branch 'gpu' into 'master'

Gpu



See merge request !67

Former-commit-id: ecd69065
parents 9ff7df9f 170b8d14
No related branches found
No related tags found
No related merge requests found
......@@ -35,18 +35,37 @@
become: true
become_user: root
- name: template unit for for persistenced
template: src=nvidia-persistenced.service dest=/etc/systemd/system/nvidia-persistenced.service
become: true
become_user: root
- name: create the nvidia-persistenced user
user: name=nvidia-persistenced state=present system=yes shell=/bin/false
become: true
become_user: root
- name: enable persistenced on boot
service: name=nvidia-persistenced state=started enabled=yes
become: true
become_user: root
- name: remove nouveau
modprobe: name=nouveau state=absent
become: true
become_user: root
- name: check nvidia driver
shell: ls /usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
register: drivers_installed
stat: path="/usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}"
register: opencl
ignore_errors: 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
get_url: url=http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run dest=/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
become: true
become_user: root
when: not opencl.stat.exists
#- name: Copy boot file
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
......@@ -60,54 +79,12 @@
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
shell: sleep 5 ; shutdown -r now "Reboot triggered by Ansible"
async: 2
poll: 1
sudo: true
ignore_errors: true
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: build nvidia driver
shell: chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
sudo: true
when: drivers_installed | failed
- 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: 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
when: not opencl.stat.exists
- name: set the GOM
shell: nvidia-smi --gom=0
become: true
become_user: root
#
# Copyright (c) 2013 NVIDIA Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# This is a sample systemd service file, designed to show how the NVIDIA
# Persistence Daemon can be started.
#
[Unit]
Description=NVIDIA Persistence Daemon
Wants=syslog.target
[Service]
Type=forking
ExecStart=/usr/bin/nvidia-persistenced --persistence-mode --user nvidia-persistenced
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced
[Install]
WantedBy=multi-user.target
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