Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
bb8dea30
Commit
bb8dea30
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/gpu/tasks/main.yml
+32
-55
32 additions, 55 deletions
roles/gpu/tasks/main.yml
roles/gpu/templates/nvidia-persistenced.service
+36
-0
36 additions, 0 deletions
roles/gpu/templates/nvidia-persistenced.service
with
68 additions
and
55 deletions
roles/gpu/tasks/main.yml
+
32
−
55
View file @
bb8dea30
...
...
@@ -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
s
hell
:
ls
/usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
register
:
drivers_installed
s
tat
:
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
This diff is collapsed.
Click to expand it.
roles/gpu/templates/nvidia-persistenced.service
0 → 100644
+
36
−
0
View file @
bb8dea30
#
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment