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
ecd69065
Commit
ecd69065
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Plain Diff
Merge branch 'gpu' into 'master'
Gpu See merge request
!67
parents
c6a95f25
60b874a3
No related branches found
No related tags found
1 merge request
!67
Gpu
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 @
ecd69065
...
@@ -35,18 +35,37 @@
...
@@ -35,18 +35,37 @@
become
:
true
become
:
true
become_user
:
root
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
-
name
:
check nvidia driver
s
hell
:
ls
/usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
s
tat
:
path="
/usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
"
register
:
drivers_installed
register
:
opencl
ignore_errors
:
true
ignore_errors
:
true
-
name
:
get nvidia driver
-
name
:
get nvidia driver
shell
:
wget http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
get_url
:
url=http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run dest=/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
args
:
become
:
true
chdir
:
/tmp
become_user
:
root
creates
:
/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
when
:
not opencl.stat.exists
sudo
:
true
when
:
drivers_installed | failed
#- name: Copy boot file
#- name: Copy boot file
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
...
@@ -60,54 +79,12 @@
...
@@ -60,54 +79,12 @@
template
:
src=xserver.j2 dest=/etc/pam.d/xserver
template
:
src=xserver.j2 dest=/etc/pam.d/xserver
sudo
:
true
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
-
name
:
build nvidia driver
shell
:
chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
shell
:
chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
sudo
:
true
sudo
:
true
when
:
drivers_installed | failed
when
:
not opencl.stat.exists
-
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
-
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 @
ecd69065
#
# 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.
Chris Hines
@chines
mentioned in commit
bb8dea30
·
4 years ago
mentioned in commit
bb8dea30
mentioned in commit bb8dea30a7c2acb18f676ba1a78b5bce8f075d01
Toggle commit list
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